Skip to content

feat: accept t as function#807

Merged
tricoder42 merged 2 commits intolingui:mainfrom
semoal:feat-accept-t-as-expression
Nov 2, 2020
Merged

feat: accept t as function#807
tricoder42 merged 2 commits intolingui:mainfrom
semoal:feat-accept-t-as-expression

Conversation

@semoal
Copy link
Copy Markdown
Contributor

@semoal semoal commented Nov 2, 2020

Closes #800

Couldn't update the docs because i'm shit writing tables with RST.. any suggerence? haha

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 2, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/lingui-js/js-lingui/pngj51p80
✅ Preview: https://js-lingui-git-feat-accept-t-as-expression.lingui-js.now.sh

@tricoder42
Copy link
Copy Markdown
Contributor

I don't know either. It's pain. But it looks good when it's done. I'll write the docs tonight. Thanks for the PR, I'll review it tonight as well!

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 2, 2020

Codecov Report

Merging #807 into main will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #807      +/-   ##
==========================================
+ Coverage   84.36%   84.45%   +0.09%     
==========================================
  Files          39       39              
  Lines        1266     1274       +8     
  Branches      334      335       +1     
==========================================
+ Hits         1068     1076       +8     
  Misses        118      118              
  Partials       80       80              
Impacted Files Coverage Δ
packages/macro/src/macroJs.ts 89.55% <100.00%> (+0.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb68e51...4b430a0. Read the comment docs.

@tricoder42
Copy link
Copy Markdown
Contributor

Docs added, PR looks good! Great job 👍

@tricoder42 tricoder42 merged commit 2211d09 into lingui:main Nov 2, 2020
@Bertg
Copy link
Copy Markdown
Contributor

Bertg commented Nov 5, 2020

Hi!

So I was trying to use this functionality today (using v3.0.3) but I'm getting a typescript error:

          <li>
            {t({id: "long_value"})}
          </li>
Argument of type '{ id: string; }' is not assignable to parameter of type 'TemplateStringsArray'.
  Object literal may only specify known properties, and 'id' does not exist in type 'TemplateStringsArray'.ts(2345)

I'm guessing the typescript definitions did not get updated?

@tricoder42
Copy link
Copy Markdown
Contributor

It just wasn't released yet. We don't have an automatic release process for pre-releases and I wanted to make a new minor release next week on Monday. There's still few new features in development.

@Bertg
Copy link
Copy Markdown
Contributor

Bertg commented Nov 5, 2020

@tricoder42 Oh! Ok now i see! That makes sense.

However, the public documentation already mentions this feature. That is why I wanted to try it.
Maybe there is a need to look at the documentation release process?

@tricoder42
Copy link
Copy Markdown
Contributor

Yeah, this is a mistake... We should merge new features into a next branch next time, so we can publish pre-releases and documentation preview independently on what's currently in main. Good point, thanks 👍

@semoal semoal deleted the feat-accept-t-as-expression branch November 5, 2020 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support id and comment in t macro

3 participants