Skip to content

feat(macro): support renamed identifiers in macro#1463

Merged
andrii-bodnar merged 1 commit into
lingui:nextfrom
timofei-iatsenko:feature/support-renaming-in-macro
Feb 24, 2023
Merged

feat(macro): support renamed identifiers in macro#1463
andrii-bodnar merged 1 commit into
lingui:nextfrom
timofei-iatsenko:feature/support-renaming-in-macro

Conversation

@timofei-iatsenko
Copy link
Copy Markdown
Collaborator

Description

Support for all macros.:

import { t as t2 } from '@lingui/macro';
const a = t2`Message`;

Looks like this is a rare case, because no one has raised the issue so far. But that is quite common case if code after other transpiler would be passed to lingui (custom extractor case)

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Fixes # (issue)

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 23, 2023 at 3:32PM (UTC)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 23, 2023

size-limit report 📦

Path Size
./packages/core/build/esm/index.js 1.72 KB (0%)
./packages/detect-locale/build/esm/index.js 812 B (0%)
./packages/react/build/esm/index.js 1.79 KB (0%)
./packages/remote-loader/build/esm/index.js 7.25 KB (0%)

@timofei-iatsenko timofei-iatsenko force-pushed the feature/support-renaming-in-macro branch from d57f6f1 to abf8f26 Compare February 23, 2023 15:31
@timofei-iatsenko timofei-iatsenko changed the title feat(macro) support renamed identifiers in macro feat(macro): support renamed identifiers in macro Feb 23, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 23, 2023

Codecov Report

Base: 73.96% // Head: 74.15% // Increases project coverage by +0.18% 🎉

Coverage data is based on head (abf8f26) compared to base (3107902).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1463      +/-   ##
==========================================
+ Coverage   73.96%   74.15%   +0.18%     
==========================================
  Files          75       75              
  Lines        1928     1942      +14     
  Branches      514      517       +3     
==========================================
+ Hits         1426     1440      +14     
  Misses        383      383              
  Partials      119      119              
Impacted Files Coverage Δ
packages/macro/test/js-defineMessage.ts 100.00% <ø> (ø)
packages/macro/test/js-plural.ts 100.00% <ø> (ø)
packages/macro/test/js-t.ts 100.00% <ø> (ø)
packages/macro/test/jsx-plural.ts 100.00% <ø> (ø)
packages/macro/test/jsx-trans.ts 100.00% <ø> (ø)
packages/macro/src/index.ts 96.29% <100.00%> (+0.21%) ⬆️
packages/macro/src/macroJs.ts 96.62% <100.00%> (+0.11%) ⬆️
packages/macro/src/macroJsx.ts 92.45% <100.00%> (+0.29%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@andrii-bodnar
Copy link
Copy Markdown
Contributor

What about the SWC plugin? Does it also need this or it already supports this?

@timofei-iatsenko
Copy link
Copy Markdown
Collaborator Author

It already supports.

@andrii-bodnar andrii-bodnar merged commit 5883fa6 into lingui:next Feb 24, 2023
@timofei-iatsenko timofei-iatsenko deleted the feature/support-renaming-in-macro branch February 24, 2023 10:40
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.

3 participants