-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Support merging imports in import injector #16349
Merged
nicolo-ribaudo
merged 10 commits into
babel:main
from
nicolo-ribaudo:helper-module-imports-merge-imports
Mar 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
342715d
Test current brhavior
nicolo-ribaudo fd6fe1c
Support merging imports
nicolo-ribaudo 879c46c
Fix namespace imports
nicolo-ribaudo ce6f690
Merge when `importPosition: before`
nicolo-ribaudo c5332a8
Update fixtures
nicolo-ribaudo 73a3df6
Handle more cases
nicolo-ribaudo a678ac1
More tests
nicolo-ribaudo db9819f
Co-authored-by: Conrad Buck <conartist6@gmail.com>
nicolo-ribaudo 9938e06
Babel 8 fixtures
nicolo-ribaudo bb7e373
Update fixtures (Windows)
babel-bot 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
Update fixtures
- Loading branch information
commit c5332a8611fc2b69b02c319a5054042b83d8771d
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
...proposal-import-wasm-source/test/fixtures/node-esm/import-declaration-multiple/output.mjs
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { readFileSync as _readFileSync2 } from "fs"; | ||
import { readFileSync as _readFileSync } from "fs"; | ||
import { readFileSync as _readFileSync, readFileSync as _readFileSync2 } from "fs"; | ||
const s = new WebAssembly.Module(_readFileSync(new URL(import.meta.resolve("./x.wasm")))), | ||
s2 = new WebAssembly.Module(_readFileSync2(new URL(import.meta.resolve("./x2.wasm")))); | ||
someBody; |
3 changes: 1 addition & 2 deletions
3
...lugin-proposal-json-modules/test/fixtures/node-esm/import-declaration-multiple/output.mjs
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { readFileSync as _readFileSync2 } from "fs"; | ||
import { readFileSync as _readFileSync } from "fs"; | ||
import { readFileSync as _readFileSync, readFileSync as _readFileSync2 } from "fs"; | ||
const j = JSON.parse(_readFileSync(new URL(import.meta.resolve("./x.json")))), | ||
j2 = JSON.parse(_readFileSync2(new URL(import.meta.resolve("./x2.json")))); | ||
someBody; |
3 changes: 1 addition & 2 deletions
3
...cord-and-tuple/test/fixtures/import-polyfill/custom-name-implies-should-import/output.mjs
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
3 changes: 1 addition & 2 deletions
3
...bel-plugin-proposal-record-and-tuple/test/fixtures/import-polyfill/custom-name/output.mjs
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
3 changes: 1 addition & 2 deletions
3
...el-plugin-proposal-record-and-tuple/test/fixtures/import-polyfill/default-name/output.mjs
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
3 changes: 1 addition & 2 deletions
3
...bel-plugin-transform-react-jsx-development/test/fixtures/linux/auto-import-dev/output.mjs
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
4 changes: 1 addition & 3 deletions
4
...nsform-react-jsx/test/fixtures/autoImport/auto-import-react-source-type-module/output.mjs
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
3 changes: 1 addition & 2 deletions
3
packages/babel-plugin-transform-react-jsx/test/fixtures/autoImport/react-defined/output.mjs
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
3 changes: 1 addition & 2 deletions
3
...-react-jsx/test/fixtures/react-automatic/concatenates-adjacent-string-literals/output.mjs
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
4 changes: 1 addition & 3 deletions
4
...orm-react-jsx/test/fixtures/react-automatic/does-not-add-source-self-automatic/output.mjs
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
3 changes: 1 addition & 2 deletions
3
...form-react-jsx/test/fixtures/react-automatic/handle-fragments-with-no-children/output.mjs
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
import { Fragment as _Fragment } from "react/jsx-runtime"; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime"; | ||
var x = /*#__PURE__*/_jsx(_Fragment, {}); |
3 changes: 1 addition & 2 deletions
3
...abel-plugin-transform-react-jsx/test/fixtures/react-automatic/handle-fragments/output.mjs
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { Fragment as _Fragment } from "react/jsx-runtime"; | ||
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; | ||
var x = /*#__PURE__*/_jsx(_Fragment, { | ||
children: /*#__PURE__*/_jsx("div", {}) | ||
}); |
3 changes: 1 addition & 2 deletions
3
...lugin-transform-react-jsx/test/fixtures/react-automatic/handle-static-children/output.mjs
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { jsxs as _jsxs } from "react/jsx-runtime"; | ||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; | ||
var x = /*#__PURE__*/_jsxs("div", { | ||
children: [/*#__PURE__*/_jsx("span", {}), [/*#__PURE__*/_jsx("span", {}, '0'), /*#__PURE__*/_jsx("span", {}, '1')]] | ||
}); |
4 changes: 1 addition & 3 deletions
4
...ransform-react-jsx/test/fixtures/react-automatic/should-allow-nested-fragments/output.mjs
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
3 changes: 1 addition & 2 deletions
3
...rm-react-jsx/test/fixtures/react-automatic/should-escape-xhtml-jsxtext-babel-7/output.mjs
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
3 changes: 1 addition & 2 deletions
3
...form-react-jsx/test/fixtures/react-automatic/should-handle-attributed-elements/output.mjs
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
3 changes: 1 addition & 2 deletions
3
...jsx/test/fixtures/react-automatic/should-have-correct-comma-in-nested-children/output.mjs
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
3 changes: 1 addition & 2 deletions
3
...-transform-react-jsx/test/fixtures/react-automatic/should-properly-handle-keys/output.mjs
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
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 sub-optimal -- I'll open a separate PR.