Skip to content
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
Prev Previous commit
Next Next commit
Update fixtures
  • Loading branch information
nicolo-ribaudo committed Mar 13, 2024
commit c5332a8611fc2b69b02c319a5054042b83d8771d
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;
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";
Copy link
Member Author

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.

const j = JSON.parse(_readFileSync(new URL(import.meta.resolve("./x.json")))),
j2 = JSON.parse(_readFileSync2(new URL(import.meta.resolve("./x2.json"))));
someBody;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Tuple as _Tuple } from "my-polyfill";
import { Record as _Record } from "my-polyfill";
import { Record as _Record, Tuple as _Tuple } from "my-polyfill";
const r2 = _Record({
a: _Record({
b: 456
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Tuple as _Tuple } from "my-polyfill";
import { Record as _Record } from "my-polyfill";
import { Record as _Record, Tuple as _Tuple } from "my-polyfill";
const r2 = _Record({
a: _Record({
b: 456
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Tuple as _Tuple } from "@bloomberg/record-tuple-polyfill";
import { Record as _Record } from "@bloomberg/record-tuple-polyfill";
import { Record as _Record, Tuple as _Tuple } from "@bloomberg/record-tuple-polyfill";
const r2 = _Record({
a: _Record({
b: 456
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var _jsxFileName = "<CWD>/packages/babel-plugin-transform-react-jsx-development/test/fixtures/linux/auto-import-dev/input.js";
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime";
import { createElement as _createElement } from "react";
import { Fragment as _Fragment } from "react/jsx-dev-runtime";
var x = /*#__PURE__*/_jsxDEV(_Fragment, {
children: /*#__PURE__*/_jsxDEV("div", {
children: [/*#__PURE__*/_jsxDEV("div", {}, "1", false, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { jsx as _jsx } from "react/jsx-runtime";
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { createElement as _createElement } from "react";
import { jsxs as _jsxs } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
var x = /*#__PURE__*/_jsx(_Fragment, {
children: /*#__PURE__*/_jsxs("div", {
children: [/*#__PURE__*/_jsx("div", {}, "1"), /*#__PURE__*/_jsx("div", {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as react from "react";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { createElement as _createElement } from "react";
import { jsxs as _jsxs } from "react/jsx-runtime";
var y = react.createElement("div", {
foo: 1
});
Expand Down
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: ["foo", "bar", "baz", /*#__PURE__*/_jsx("div", {
children: "buz bang"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { jsx as _jsx } from "react/jsx-runtime";
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { createElement as _createElement } from "react";
import { jsxs as _jsxs } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
var x = /*#__PURE__*/_jsx(_Fragment, {
children: /*#__PURE__*/_jsxs("div", {
children: [/*#__PURE__*/_jsx("div", {}, "1"), /*#__PURE__*/_jsx("div", {
Expand Down
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, {});
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", {})
});
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')]]
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { jsx as _jsx } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
/*#__PURE__*/_jsx("div", {
children: /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsxs(_Fragment, {
Expand Down
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";
/*#__PURE__*/_jsx("div", {
children: "wow"
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { jsxs as _jsxs } from "react/jsx-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
var HelloMessage = React.createClass({
displayName: "HelloMessage",
render: function () {
Expand Down
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("div", {
children: /*#__PURE__*/_jsx("br", {})
Expand Down
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("div", {}, "1"), /*#__PURE__*/_jsx("div", {
meow: "wolf"
Expand Down