transform bundle so no runtime parsing is needed #89
ivanhofer
started this conversation in
Optimizations
Replies: 2 comments 6 replies
-
I recently saw this babel plugin that does something similar |
Beta Was this translation helpful? Give feedback.
1 reply
-
Maybe make it an unplugin thing (unplugin are plugins that work with any bundler) |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In its current implementation
typesafe-i18n
needs to parse each translation the first time it gets called. The parsing part is taking about half of the bundle size. The whole library could be trimmed to < 500 bytes if the parsing would take place compile-time.Instead of this:
the production bundle output could be:
This would mean slightly larger output for each translation file, but this should compress (
gzip
) better because of its repetitive pattern. If the parsing is not needed run-time, the library should be even faster (mostly nanoseconds).What needs to be done:
Beta Was this translation helpful? Give feedback.
All reactions