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: Update swc #40983

Merged
merged 11 commits into from Sep 29, 2022
40 changes: 0 additions & 40 deletions packages/next-swc/.cargo/config.toml
@@ -1,24 +1,8 @@

[build]

rustdocflags = []
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.aarch64-apple-darwin]
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
Expand All @@ -27,31 +11,7 @@ rustflags = [
"target-feature=-crt-static",
"-C",
"link-arg=-lgcc",
"-Z",
"new-llvm-pass-manager=no",
]

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.aarch64-linux-android]
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.aarch64-pc-windows-msvc]
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.wasm32-unknown-unknown]
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]
20 changes: 11 additions & 9 deletions packages/next-swc/crates/core/tests/telemetry.rs
Expand Up @@ -8,7 +8,7 @@ use once_cell::sync::Lazy;

use swc_core::{
base::{try_with_handler, Compiler},
common::{FileName, FilePathMapping, SourceMap},
common::{FileName, FilePathMapping, SourceMap, GLOBALS},
ecma::transforms::base::pass::noop,
};

Expand Down Expand Up @@ -41,14 +41,16 @@ export function getServerSideProps() {
);
assert!(
try_with_handler(COMPILER.cm.clone(), Default::default(), |handler| {
COMPILER.process_js_with_custom_pass(
fm,
None,
handler,
&Default::default(),
|_, _| next_ssg(eliminated_packages.clone()),
|_, _| noop(),
)
GLOBALS.set(&Default::default(), || {
COMPILER.process_js_with_custom_pass(
fm,
None,
handler,
&Default::default(),
|_, _| next_ssg(eliminated_packages.clone()),
|_, _| noop(),
)
})
})
.is_ok()
);
Expand Down