-
Notifications
You must be signed in to change notification settings - Fork 390
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(): Experimental Deps extractor #1469
feat(): Experimental Deps extractor #1469
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
6d14918
to
46e9034
Compare
This comment was marked as outdated.
This comment was marked as outdated.
46e9034
to
d1f4016
Compare
d5347c0
to
bd10c9f
Compare
bd10c9f
to
5be2349
Compare
68421f7
to
d47d0a1
Compare
124a331
to
3947672
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## next #1469 +/- ##
==========================================
+ Coverage 73.93% 74.30% +0.37%
==========================================
Files 67 76 +9
Lines 1872 1969 +97
Branches 493 514 +21
==========================================
+ Hits 1384 1463 +79
- Misses 383 392 +9
- Partials 105 114 +9
... and 1 file with indirect coverage changes 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 in Codecov by Sentry. |
@thekip I already briefly checked this PR and going to explore it in more detail later this week |
@thekip thank you, looks good to me! 🚀 I just left two minor comments. Also, please add a section to the migration guide about this new extractor. |
It's not replacing the current extractor, so no migration is needed. It's just an alternative. I want to test this on different projects and check what errors might appear, what should be changed in the design of the api and configurations and so on. Another question how configuration would look like when it becomes "stable" instead of "experimental". We need to merge configurations somehow. I actually have no idea where to write this. I think we need to write a blog post with new capabilities, such as typescript doing for new versions. |
3947672
to
f785a3f
Compare
f785a3f
to
4753824
Compare
@thekip ok, we can keep it not documented for the test period. I consider the migration article as a place for letting users know about new features also. On the official v4 release probably we will create a blog post with everything included.
can we keep both the approaches (current and this experimental) as alternative solutions? The current will be default and if needed, users may use this "advanced" extractor |
It's still requiring proper naming. Because current "experimental" is not a good for the future. So settings for both two extractors should somehow play well with each other. Actually, i see something like in
I think something similar could be implemented in lingui as well. Both versions of extractors would live side by side, and users event would not know that there two diffrent implementations it should be just a matter of different configuration. But i'm going to consider this for next major release (v5 for example) |
@andrii-bodnar merge? |
let's merge this, i will write docs in follow ups. I'm going to add a dedicated nextjs doc, and dedicated page for that extractor. But first i want to finish all ongoing PR, and there already would be conflicts between this and custom formatters. |
Implements: #1458
Process overview:
src/pages/**/*.ts
resolve them into pathsbuildExternalizeFilter
test. Externalization can be configured withincludeDeps: string[]
andexcludeDeps: string[]
Notes
@lingui/conf
(i will explain later)Regarding multithreading:
Communication between threads is done by messages. Where message should be a serializable structure.
Extractor workers depedns on the
@lingui/config
, but lingui config itself might not be serializable to json. Custom extractor might be defined as an inline function in the config.So passing config from parent process to childs is not possible because of that.
Other way would be read config in each worker separately. But reading config has significant overhead especially when config written in typescript. Recursive search and parsing / compiling, would be called in each worker, so overhead could be bigger than just doing it all in one thread.
So there are 2 possible solutions:
First option is simpler, but has bad DX, second option is better for DX, but harder for implementation.