-
-
Notifications
You must be signed in to change notification settings - Fork 51
Problems with standardized targets RFC #95 and javascript #104
Description
While RFC #95 allows efficient transpilation and targeting modern JS engines, flaws appear when actually applying this.
I have 2 concrete issues, which both occurs when targeting modern browsers that allow ES6 features.
The first major issue is minification: The currently used UglifyJS does not support ES6 syntax and throws arcane errors when trying to produce a minified build. This can be somewhat alleviated by using ember-cli-babili, which supports such syntax. However, there are 2 specific reasons why this works: First, it only applies ES5-safe transforms. To do anything else, it would need to take into account the full browser matrix. Secondly, it uses the babel engine, ensuring syntax compatibility. Without this, it will break when new syntax elements are introduced to the language.
The second issue is testing: Currently PhantomJS is used, which again does not support ES6 syntax. This has a quick fix (add a PhantomJS compatible browser to the targets when testing), but this somewhat undermines the actual testing.
Even if this was replaced with a more compatible JS engine, there is no guarantee that it would match the targets that the user has specified, and will thus always require a test-specific transpilation target (which again undermines the validity).
With these 2 issues I think that the targets RFC actually ends up doing more harm than good. It is great to leverage the tremendous effort that has been put into creating these browser targets, but not so great when the supporting eco-system has to do a comparable effort to support this, and we have a deep vendor lock-in.
TDLR: The targets needs to respected at 3 tiers of JS, rather than just the one that was intended, which greatly complicates the eco-system.