Skip to content

Commit

Permalink
chore: Drop cyclic dependency (#9217)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 authored Jul 12, 2024
1 parent fd94562 commit 87b1ad9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 57 deletions.
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

0 comments on commit 87b1ad9

Please sign in to comment.