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

chore: Drop cyclic dependency #9217

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/swc_ecma_transforms_react/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" }
[dev-dependencies]
swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen/" }
swc_ecma_transforms_compat = { version = "0.167.0", path = "../swc_ecma_transforms_compat/" }
swc_ecma_transforms_module = { version = "0.184.0", path = "../swc_ecma_transforms_module" }
swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" }
testing = { version = "0.37.0", path = "../testing" }
21 changes: 2 additions & 19 deletions crates/swc_ecma_transforms_react/src/jsx/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use swc_ecma_transforms_compat::{
es2015::{arrow, classes},
es3::property_literals,
};
use swc_ecma_transforms_module::common_js::common_js;
use swc_ecma_transforms_testing::{parse_options, test, test_fixture, FixtureTestConfig, Tester};
use swc_ecma_visit::FoldWith;
use testing::NormalizedOutput;
Expand Down Expand Up @@ -871,15 +870,7 @@ test!(
}),
|t| {
let top_level_mark = Mark::fresh(Mark::root());
chain!(
tr(t, Default::default(), top_level_mark),
common_js(
top_level_mark,
Default::default(),
Default::default(),
Some(t.comments.clone())
)
)
tr(t, Default::default(), top_level_mark)
},
issue_351,
"import React from 'react';
Expand All @@ -905,15 +896,7 @@ test!(
}),
|t| {
let top_level_mark = Mark::fresh(Mark::root());
chain!(
tr(t, Default::default(), top_level_mark),
common_js(
Mark::fresh(Mark::root()),
Default::default(),
Default::default(),
Some(t.comments.clone())
)
)
tr(t, Default::default(), top_level_mark)
},
issue_517,
"import React from 'react';
Expand Down
7 changes: 0 additions & 7 deletions crates/swc_ecma_transforms_react/src/refresh/tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use swc_common::chain;
use swc_ecma_transforms_base::resolver;
use swc_ecma_transforms_module::common_js::common_js;
use swc_ecma_transforms_testing::{test, Tester};

use super::*;
Expand Down Expand Up @@ -564,12 +563,6 @@ test!(
top_level_mark,
unresolved_mark
),
common_js(
unresolved_mark,
Default::default(),
Default::default(),
Some(t.comments.clone())
)
)
},
include_hook_signature_in_commonjs,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = /*#__PURE__*/ _interop_require_default(require("react"));
/*#__PURE__*/ _react.default.createElement("div", null);
import React from 'react';
/*#__PURE__*/ React.createElement("div", null);
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = /*#__PURE__*/ _interop_require_default(require("react"));
/*#__PURE__*/ _react.default.createElement("div", {
import React from 'react';
/*#__PURE__*/ React.createElement("div", {
style: "white-space: pre"
}, "Hello World");
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return App;
}
});
var _hooks = require("./hooks");
var _foo = /*#__PURE__*/ _interop_require_default(require("./foo"));
var _s = $RefreshSig$();
function App() {
import { useFancyState } from './hooks';
import useFoo from './foo';
export default function App() {
_s();
const bar = (0, _hooks.useFancyState)();
const foo = (0, _foo.default)();
const bar = useFancyState();
const foo = useFoo();
return /*#__PURE__*/ React.createElement("h1", null, bar);
}
_s(App, "useFancyState{bar}\nuseFoo{foo}", false, function() {
return [
_hooks.useFancyState,
_foo.default
useFancyState,
useFoo
];
});
_c = App;
Expand Down
Loading