Comments (10)
The Unicode databases required are rather large; perhaps this should be an optional dependency? That is, something like:
String.prototype.normalize = function(form) { return require('unorm')[String(form).toLowerCase()](this); }
with the appropriate error handling and helpful messages if require('unorm') fails.
from es6-shim.
String.prototype.normalize = function(){return String(this);}
from es6-shim.
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.
from es6-shim.
from es6-shim.
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 es6-shim.js
file that shims as much as it can is very important to the purpose of the shim.
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.
from es6-shim.
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.
from es6-shim.
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.
from es6-shim.
yup totally agree, including ultra-big shims with the lib is not good
at least until we will have custom builds
from es6-shim.
I added a pointer to unorm
in the documentation (see c185084 and a04221b).
from es6-shim.
Closing this for now - when/if #136 happens, we will include String#normalize
as an includable option.
from es6-shim.
Related Issues (20)
- Support for Promise.prototype.finally HOT 2
- Symbol.split polyfill poor performance HOT 1
- Question: Template literals supported? HOT 4
- Possible to only use needed components? HOT 1
- Function.prototype.name getter brokes function name getter HOT 2
- native Promise broken in node 10.0 and 10.1 HOT 1
- Unneeded argument for overrideNative HOT 2
- Promise 'then' incorrect? HOT 10
- For statement doesn't loop? HOT 4
- Shimmed Symbol.iterator is not recognized HOT 10
- TypeError: Object doesn't support property or method 'next' in IE browser HOT 10
- Does the array `of` shim apply to `for...of`? HOT 3
- WhiteSource warning - jQuery Vulnerability CVE-2020-11022 HOT 3
- babel-polyfill and es6-shim HOT 8
- Allowed iterator on empty object HOT 2
- Promise shim missing finally method HOT 1
- This software has new code recently, but no new version has been released. Will there be a new version released recently? HOT 4
- [spam]
- About update a new release HOT 3
- Documentation Icon Errors and typos HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from es6-shim.