-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ES6 instantiation fixes #209
Comments
The assumption is that Teverse interop is simplified through 6to5's compilation output though. |
For the second point above, this is better handled by having 6to5s compilation of CommonJS and then ignoring |
Reopening - we need ES6 modules to be interchangeable with transpiled ES6 into CommonJS in order to have an interop story where we publish both CommonJS and ES6 and expect the same results. Now that 6to5 adds the Previously I was happy to accept that the flattening of exports onto the base-level module does avoid the need to detect this flag in SystemJS, but there is one edge case: export var p = 5;
export default 'test'; Transpiles to: exports.p = 5;
exports.default = 'test';
exports.__esModule = true; If I then do: import test, {p} from 'test'; and run the above code in SystemJS with export flattening implemented against the transpiled module for test, I will get The edge case is thus specifically for the default export when shared with named exports, but is a big enough edge case that we absolutely do need to handle the flag. |
Moved to #359, patch to follow shortly. |
It should be possible formetadata.execute
to return an ES6 module object, in which case it does not get treated like a default-only export, but a full ES6 module. This is pending Consider Reflect.isModule implementation ModuleLoader/es-module-loader#216.__esModule
flag, it should be converted into an ES6 module object to support loading ES6 compiled into CommonJS through Traceur. This is less of a critical issue as we have no evidence people are doing this yet, but this is pending CommonJS and AMD interop with single exports google/traceur-compiler#1388.The text was updated successfully, but these errors were encountered: