-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fix incorrect module path when absoluteRuntime is specified #11893
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7487331
- Added failing tests for issue #11885.
sz-coder 9bfbc44
- Fix issue #11885: absoluteRuntime does not work as expected with co…
sz-coder 175413c
- Removed helper code from test output files (tests for issue #11885).
sz-coder 88809eb
chore: add @babel/runtime-corejs3 to dev deps
JLHwung 433c55d
chore: update test fixtures
JLHwung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
8 changes: 8 additions & 0 deletions
8
...el-plugin-transform-runtime/test/fixtures/absoluteRuntime/true-corejs3-proposals/input.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Array.map; | ||
function* makeIterator() { | ||
yield 1; | ||
yield 2; | ||
} | ||
for (const itItem of makeIterator()) { | ||
console.log(itItem); | ||
} |
7 changes: 7 additions & 0 deletions
7
...lugin-transform-runtime/test/fixtures/absoluteRuntime/true-corejs3-proposals/options.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"presets": ["env"], | ||
"plugins": [ | ||
["transform-runtime", { "absoluteRuntime": true, "corejs": { "version": 3, "proposals": true } }], | ||
["external-helpers", { "helperVersion": "7.100.0" }] | ||
] | ||
} |
41 changes: 41 additions & 0 deletions
41
...l-plugin-transform-runtime/test/fixtures/absoluteRuntime/true-corejs3-proposals/output.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
var _regeneratorRuntime = require("<CWD>/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime-corejs3/regenerator"); | ||
|
||
var _mapInstanceProperty = require("<CWD>/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime-corejs3/core-js/instance/map"); | ||
|
||
var _marked = /*#__PURE__*/_regeneratorRuntime.mark(makeIterator); | ||
|
||
_mapInstanceProperty(Array); | ||
|
||
function makeIterator() { | ||
return _regeneratorRuntime.wrap(function makeIterator$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
_context.next = 2; | ||
return 1; | ||
|
||
case 2: | ||
_context.next = 4; | ||
return 2; | ||
|
||
case 4: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _marked); | ||
} | ||
|
||
var _iterator = babelHelpers.createForOfIteratorHelper(makeIterator()), | ||
_step; | ||
|
||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var itItem = _step.value; | ||
console.log(itItem); | ||
} | ||
} catch (err) { | ||
_iterator.e(err); | ||
} finally { | ||
_iterator.f(); | ||
} |
8 changes: 8 additions & 0 deletions
8
...babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/true-corejs3-stable/input.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Array.map; | ||
function* makeIterator() { | ||
yield 1; | ||
yield 2; | ||
} | ||
for (const itItem of makeIterator()) { | ||
console.log(itItem); | ||
} |
7 changes: 7 additions & 0 deletions
7
...l-plugin-transform-runtime/test/fixtures/absoluteRuntime/true-corejs3-stable/options.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"presets": ["env"], | ||
"plugins": [ | ||
["transform-runtime", { "absoluteRuntime": true, "corejs": { "version": 3, "proposals": false } }], | ||
["external-helpers", { "helperVersion": "7.100.0" }] | ||
] | ||
} |
41 changes: 41 additions & 0 deletions
41
...abel-plugin-transform-runtime/test/fixtures/absoluteRuntime/true-corejs3-stable/output.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
var _regeneratorRuntime = require("<CWD>/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime-corejs3/regenerator"); | ||
|
||
var _mapInstanceProperty = require("<CWD>/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime-corejs3/core-js-stable/instance/map"); | ||
|
||
var _marked = /*#__PURE__*/_regeneratorRuntime.mark(makeIterator); | ||
|
||
_mapInstanceProperty(Array); | ||
|
||
function makeIterator() { | ||
return _regeneratorRuntime.wrap(function makeIterator$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
_context.next = 2; | ||
return 1; | ||
|
||
case 2: | ||
_context.next = 4; | ||
return 2; | ||
|
||
case 4: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _marked); | ||
} | ||
|
||
var _iterator = babelHelpers.createForOfIteratorHelper(makeIterator()), | ||
_step; | ||
|
||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var itItem = _step.value; | ||
console.log(itItem); | ||
} | ||
} catch (err) { | ||
_iterator.e(err); | ||
} finally { | ||
_iterator.f(); | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is meant to fix the e2e error: https://app.circleci.com/pipelines/github/babel/babel/3524/workflows/90153e91-f615-4930-8a0f-5ed243d3a6cc/jobs/26605/parallel-runs/0/steps/0-103
The error is thrown because
@babel/runtime-corejs3
is not hoisted to the top level ine2e-test
. The other test is passing because@babel/runtime-corejs3
is hoisted to the top level from fixture locations, this is not guaranteed and dev deps should be declared.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!