-
Notifications
You must be signed in to change notification settings - Fork 14
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
Disable "smartness" of the compiler #10
Comments
Actually, the goal of the compiler is to create runtime code for you. That means: fast and small code that doesn't require CLDR. The compiler could be a little smarter and figure out that the
Should we include all the code and data for all the available currencies? Including the whole code and data to allow any currency basically leads us back to step 0, where we are actually using Globalize normal modules, not the runtime modules. Note, this only gets worse if more and more variables are undetermined, for example:
Here we would have to include all the code and data for all the available currency formatters. For that reason, I suggest a different approach in your code: var currentcyFormatter = Globalize.currencyFormatter( curr ); If you need multiple formatters, do this:
|
I have closed this issue, but feel free to post new comments if you have any other question or suggestion. Thanks |
Thanks for the answer :) |
I'm reopening this issue so that we can brainstorm about potential ways to solve this. One is to allow the compiler to take an option with a list of supported currencies and use that list of currencies instead of the static currency (or probably a variable) it finds in the code. |
If I have the following code in my project:
I get the following error message
curr is not defined
I think the compiler is trying to be a little bit too smart here and is trying to figure out which cldr data to include. But when I load stuff like this e.g. from a API, it can't know this just from the code.
So is there a option to disable this and to just tell the compiler maybe statically which data to include instead of trying to deduce it from the source?
The text was updated successfully, but these errors were encountered: