-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement @lingui/vite-plugin #1306
feat: implement @lingui/vite-plugin #1306
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Tests failing because vite is in dev deps which requires min node v16. Do we really need to support all this ancient node versions? |
by the way configuration of monorepo is also not well ergonomic, I would like to add "real" test for this plugin involving execution of vite itself, but it's not possible because ESM/CJS inconsistency and lack of ability to change jest config exactly for this subproject. |
@thekip will it work on Node 14? Currently, I am upgrading the CI/CD (#1325) and Node 14 - now is the min version for tests (since this version LTS period going to end on 2023-04-30) |
I'm not sure actually. Vite probably requires node v16 so this will not work. I think the whole pipeline should be changed to be independent for each package. |
It's quite a big change for the entire build and release process |
Yes I know. Looks like bumping node to v14 would be enough for now
|
@thekip could you please rebase the branch? |
3956d39
to
6891daf
Compare
@andrii-bodnar rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the failing validate
workflow job.
You should also remove the empty CHANGELOG.md
file.
It's also should be registered in |
Forgot to mention that, thanks! |
@thekip is it possible to finalize and release this PR? Also, I would suggest adding the corresponding docs article within this PR so users would be able to easily find this info |
6891daf
to
29159b5
Compare
size-limit report 📦
|
29159b5
to
fc62e36
Compare
This comment was marked as resolved.
This comment was marked as resolved.
fc62e36
to
e8989d6
Compare
e8989d6
to
3c87250
Compare
The scope of this PR was expanded. I tried to integrate it into the current build process and found that it not generates typings for And create an isolated command for building the package with |
I also noticed what could be improved in this plugin. This plugin can compile only The issue wouldn'be fixed by just changing a regexp to accepting So better solution would be take a catalog's regexp from lingui config and treat all files matching this regexp as catalogs no matter of extension. Probably snowpack plugin also has this issue, it treat all json files in bundle as catalogs and tries to compile all of them. I think for the first iteration we could merge it as-is (with |
@thekip thank you. I think we can start from the Regarding the comment about the |
c5e0756
to
937a278
Compare
done |
@thekip one more thing regarding the |
Yes. With tsc it's not possible to use path mapping. If you noticed, the tsconfig in vite-plugin is not extended from the root one. Because in this case tsc generates structure choosing root as longest path. Example: So I was forced not to use tsconfig's path mapping and use yarn workspace linking instead. Renaming api.js to .ts was needed to make typings works and satisfy compiler |
9416ef8
to
7771281
Compare
7771281
to
66bf39d
Compare
done |
Codecov ReportBase: 82.60% // Head: 82.68% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1306 +/- ##
==========================================
+ Coverage 82.60% 82.68% +0.07%
==========================================
Files 56 66 +10
Lines 1799 1761 -38
Branches 506 483 -23
==========================================
- Hits 1486 1456 -30
+ Misses 183 177 -6
+ Partials 130 128 -2
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. |
Thank you @thekip, @Martin005! I'm going to release a new version later this week |
Implementation of Vite Plugin based on Snowpack Plugin
.po
this plugin works only with.po
. This is because we need a certain way to tell Vite to use proper loader for extension. Therefore files withjson
extension would be processed by Vite itself, and it's quite uncertain how to tell vite to use this loader for some subset of json files (we probably can play with query parameters in request, but I would prefer avoid it because.po
is recommended way and everybody should use it.vite-plugin-
prefix, but in this project other plugins have own internal naming convention. I followed this convention instead of vite's. I left decision which one is right up to maintaners.