Plugin to transform dynamic import using the spec mode require wrapper#4986
Closed
Jessidhia wants to merge 109 commits intobabel:masterfrom
Closed
Plugin to transform dynamic import using the spec mode require wrapper#4986Jessidhia wants to merge 109 commits intobabel:masterfrom
Jessidhia wants to merge 109 commits intobabel:masterfrom
Conversation
added 30 commits
December 9, 2016 00:12
* master: update `regenerator-runtime` in `babel-polypill` (babel#4966) Temp fix for make watch [skip ci] (babel#4967) Add (and fix) failing test of function parameter bindings in a catch block (babel#4880) Upgrade regenerator-runtime to version 0.10.0. (babel#4877) Add `/.test` and `/src` to `babel-plugin-transform-regenerator` `.npmignore`. (babel#4961) [skip ci] Only base async fn arity on non-default/non-rest params - fixes babel#4891 (babel#4901) Add generator support for Import (babel#4945)
Throws in v8 with "Invalid property descriptor. Cannot both specify accessors and a value or writable attribute" I guess this is why the spec defines "magic changing values" instead of getters 😅
Repeat the shorter identifier in the block.
Mostly for testing interaction of the transform with other es2015 plugins.
If they're named, they can be modified, so the binding has to be kept live.
added 20 commits
December 12, 2016 11:19
* master: make installing runtime/transform-runtime clearer [skip ci] (babel#4991) Add example to es2015-unicode-regex [skip ci] (babel#4983) v6.20.3 Calculate the correct arity for async functions with destructuring - fixes babel#4977 (babel#4978) v6.20.2 fix object spread (babel#4976) fix clean lib update readme [skip ci] v6.20.1 Fix nested object spread (babel#4974) v6.20.0 v6.20.0 changelog [skip ci] (babel#4971) Raise limit on code size before compacting (babel#4965) Use regenerator-transform to implement babel-plugin-transform-regenerator (babel#4881) Add getBindingIdentifierPaths/getOuterBindingIdentifierPaths (babel#4876) Hoist generateDeclaredUidIdentifier helper function (babel#4934)
Even if the path.remove did work, the import would have been deleted without generating the corresponding require.
* modules-commonjs-spec: (67 commits) Remove accidental ! Be more proactive with the Invalid import throw Convert spec-test-helpers to ES6 Avoid calling scope.getBinding on Flow types Remove unused variable, update fixture Huge refactoring; reimplement spec / specImport modes with visitors Build the babel-runtime dist scripts from current code transform-runtime: flag blacklisted helpers for skipping transform Allow the helperGenerator hook to return the helper itself Fix order in options.json; test still failing Add failing test (fix TODO) Fix crash when processing ThisExpression Update fixtures Use a helper for the SameValue check Update fixtures Use better SameValue algorithm Use propertyIsEnumerable instead of getOwnPropertyDescriptor Add missing before hooks; fix tests failing on Node < 6 make installing runtime/transform-runtime clearer [skip ci] (babel#4991) Check if renamed reexports are correctly exported ...
9 tasks
Member
|
@Jessidhia Is this PR still needed? We now support |
Member
|
This is supported now in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This transforms dynamic
import()calls intoPromise-wrappedrequirecalls that go through the commonjsspec: trueimport helper.Per the latest TC39 meeting, the resulting
Promisealways runs on the next tick (always asynchronously).This continues off another PR so the diff is huge for now 😅
Input
Output