js-lingui icon indicating copy to clipboard operation
js-lingui copied to clipboard

feat(vite-plugin): add error handling for dynamic import of @lingui/macro

Open maastrich opened this issue 1 year ago • 6 comments

Description

Make sure the user understands why @lingui/macro is not handled by babel/swc when dynamically imported.

Types of changes

  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] 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
  • [ ] Examples update

Checklist

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

maastrich avatar Oct 18 '24 08:10 maastrich

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

Name Status Preview Updated (UTC)
js-lingui ✅ Ready (Inspect) Visit Preview Aug 4, 2025 7:58am

vercel[bot] avatar Oct 18 '24 08:10 vercel[bot]

size-limit report 📦

Path Size
./packages/core/dist/index.mjs 2.88 KB (0%)
./packages/detect-locale/dist/index.mjs 723 B (0%)
./packages/react/dist/index.mjs 1.68 KB (0%)
./packages/remote-loader/dist/index.mjs 7.26 KB (0%)

github-actions[bot] avatar Oct 18 '24 08:10 github-actions[bot]

LGTM, thanks for contribution

timofei-iatsenko avatar Oct 18 '24 09:10 timofei-iatsenko

Codecov Report

:x: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 76.66%. Comparing base (6bb8983) to head (6a2ab2b). :warning: Report is 212 commits behind head on main.

Files with missing lines Patch % Lines
packages/vite-plugin/src/index.ts 0.00% 2 Missing :warning:
...ite-plugin/test/dynamic-macro-error/vite.config.ts 0.00% 2 Missing :warning:

:x: Your patch status has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2056      +/-   ##
==========================================
- Coverage   77.05%   76.66%   -0.39%     
==========================================
  Files          84       90       +6     
  Lines        2157     2507     +350     
  Branches      555      652      +97     
==========================================
+ Hits         1662     1922     +260     
- Misses        382      468      +86     
- Partials      113      117       +4     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Oct 18 '24 09:10 codecov[bot]

@maastrich are you going to add something to this PR or you finished? We are preparing v5 release and it would be better to switch it to the next branch.

timofei-iatsenko avatar Oct 18 '24 09:10 timofei-iatsenko

Hi @maastrich, is there anything we can do to move this PR forward?

andrii-bodnar avatar Nov 04 '24 09:11 andrii-bodnar

@andrii-bodnar @maastrich i adjusted the code to the latest version, please review and merge it. Thanks

timofei-iatsenko avatar Aug 04 '25 07:08 timofei-iatsenko

By the way, is it really a feature? It's more like something that should be included in a patch update, not a minor one.

andrii-bodnar avatar Aug 04 '25 08:08 andrii-bodnar

@andrii-bodnar correct, adjusted the PR name

timofei-iatsenko avatar Aug 04 '25 08:08 timofei-iatsenko

@andrii-bodnar please use squash and merge, when merging this PR to avoid bloat in the git history. Thanks

timofei-iatsenko avatar Aug 04 '25 08:08 timofei-iatsenko