-
Notifications
You must be signed in to change notification settings - Fork 388
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
Need String#normalize #134
Comments
String.prototype.normalize = function(){return String(this);} |
Unfortunately it's far more complex than that. The spec says that it takes a "form" argument that defaults to "NFC", and it throws a RangeError if String(form) is not "NFC", "NFD", "NFKC", or "NFKD" - then it uses the Unicode Normalization Algorithm for the specified form. |
The Unicode databases required are rather large; perhaps this should be an optional dependency? That is, something like:
with the appropriate error handling and helpful messages if require('unorm') fails. |
https://github.com/walling/unorm/blob/master/lib/unorm.js doesn't seem that large… While that's a valid concern, I think having a single As for a require, that'd be nice, but we'd need to ensure the shim still works with all the module systems it currently has - it might be better to copy/paste it in, like I did with the Math.fround/numberConversion stuff. |
https://github.com/walling/unorm/blob/master/lib/unorm.js is 141kB. That's the standalone version of the library (it appears to combine unorm.js with https://github.com/walling/unorm/blob/master/src/unormdata.js, which is 122kB). For comparison, unminimized es6-shim.js is currently 42kB. So this would be a 435% increase in the size of es6-shim -- probably a larger increase if you look at the minimized sizes. I think that's large enough that people would avoid using es6-shim for mobile projects. |
Fair point. If we want to point people at https://github.com/walling/unorm, then we need to make it very clear in the documentation. |
yup totally agree, including ultra-big shims with the lib is not good at least until we will have custom builds |
Closing this for now - when/if #136 happens, we will include |
No description provided.
The text was updated successfully, but these errors were encountered: