-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add an option to parse FTL during build #107
base: main
Are you sure you want to change the base?
Conversation
commit: |
1ef57da
to
fc9ed8d
Compare
Thanks @Demivan for preparing this PR. I just tried the My observations:
So, all in all I think it's hard to draw an decisive conclusion which approach should be preferred. For projects with little strings there is in total a small advantage in file size. With more strings, the savings from omitting the FluentResource class will be shadowed by the larger FTL files. During build I get the following warning, if
|
@rangermeier Thanks for such an extensive testing. I get similar results on my project too. We have a lot more translations, so size diff was +14Kb (Gzip) instead of a reduction, and performance improvement was ~3ms for an average page. So for small projects, this is clearly a nice addition. You get a smaller bundle size and slightly better performance. For big projects, time to download a bigger bundle would, most likely, negate the runtime performance gain. One benefit I see for big projects is that after a browser caches the bundle, you just get a performance gain with no downside. I think, I will polish this PR, fix the warning that you got, and merge it. But I'm on the fence whether this should be enabled or disabled by default. |
Description
Add an option to do FTL parsing during build instead of during runtime on component initialization.
Option
parseFtl?: boolean
for both SFC and External plugins.Linked Issues
Closes #101
Additional context