feat(vite-plugin): add error handling for dynamic import of @lingui/macro
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)
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 |
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%) |
LGTM, thanks for contribution
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.
@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.
Hi @maastrich, is there anything we can do to move this PR forward?
@andrii-bodnar @maastrich i adjusted the code to the latest version, please review and merge it. Thanks
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 correct, adjusted the PR name
@andrii-bodnar please use squash and merge, when merging this PR to avoid bloat in the git history. Thanks