Do Anonymous Exports Solve the Backwards Compatibility Problem?
khs4473 at gmail.com
Wed Dec 19 13:27:54 PST 2012
> In summary, I do not believe there is a technical issue with export
> assignment and backcompat, which was the what started this thread.
Why not? I've attempted to show that it's not possible to correctly use
this feature for backward compatibility without parsing the code first.
Pre-parsing everything at runtime isn't practical. Therefore, using this
feature for backward compatibility at runtime isn't practical.
Of course, you could use other ad hoc methods to tell the loader not to
apply the `export =` trick, but then you'd be layering tricks upon tricks.
I think the best migration strategy for Node will be to use `require` for
Node-style modules, and to use import syntax for ES6 modules. Node needs
to modify it's URL resolution rules for ES6 modules anyway. : )
For the web, the answer is transcompilation from ES6 to ES5, using
CommonJS-style function wrappers to emulate modules.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss