Replies: 1 comment 3 replies
-
Thank you for your discussion!
Yeah! As mentioned in my slide at the following URL, the purpose of pre-compilation is to improve rendering performance. I’ll plan to optimize messages function generation. |
Beta Was this translation helpful? Give feedback.
-
I'd like to understand better the reason for introducing message compilation in v2 of this loader / v9 of vue-i18n.
I can see that when using the loader a small JSON with 3 strings like:
gets compiled to something like:
One disadvantage with that seems to be the sheer size of compiled code - it's much bigger than a JSON file.
What are the advantages though? Is it only about the performance or maybe it can also provide some better typing when used with TS?
BTW. Is it possible to optimize the
const {normalize: t} = e;
import so that it's not repeated for each translation? That would reduce the size considerably.Beta Was this translation helpful? Give feedback.
All reactions