Re:Microsoft Edge supports ES6 modules
by koolba on Tuesday May 17, 2016 @02:28PM
(#11716045)
Short of browser useragent sniffing (yuck...) is there any way to make use of ES6 features in a browser agnostic app? Seems like the only way to work is with a transpiler and series of polyfills.
[ Parent
| on HN ]
Re:Microsoft Edge supports ES6 modules
by wavefunction on Tuesday May 17, 2016 @03:55PM
(#11716817)
Depending on the ES6 features and your supported browsers, you don't need anything.
If you want to use all the ES6 features, no single modern browser implements them all (Webkit is still lacking on modules) and so you will need to use a collection of polyfills.
You could do something like
try {
eval('"use strict"; import "jquery";');
} catch (e) {
// No imports.
}
but I wouldn't really recommend it.
Re:Microsoft Edge supports ES6 modules
by MatthewPhillips on Tuesday May 17, 2016 @04:38PM
(#11717212)
That won't work, you can't eval modules.