Skip to content

Commit 0e5aafe

Browse files
committed
refactor(javascript): migrate parser to swc next
1 parent fb16d93 commit 0e5aafe

122 files changed

Lines changed: 8764 additions & 7935 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 217 additions & 213 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ swc_html_minifier = { version = "61.0.0", default-features = false }
156156
swc_plugin_runner = { version = "34.0.0", default-features = false }
157157
swc_typescript = { version = "34.0.0", default-features = false }
158158

159-
swc_experimental_allocator = { version = "0.11.0", default-features = false }
160-
swc_experimental_ecma_ast = { version = "0.11.0", default-features = false }
161-
swc_experimental_ecma_parser = { version = "0.11.0", default-features = false }
162-
swc_experimental_ecma_semantic = { version = "0.11.0", default-features = false }
163-
swc_experimental_ecma_transforms_base = { version = "0.11.0", default-features = false }
164-
swc_experimental_ecma_utils = { version = "0.11.0", default-features = false }
159+
# Keep the analysis parser on Rspack's migration branch until the SWC Next API
160+
# is published with the compatibility guarantees required by this workspace.
161+
swc_next_allocator = { git = "https://github.com/swc-project/swc-next.git", branch = "seal/rspack-migration" }
162+
swc_next_ecma_ast = { git = "https://github.com/swc-project/swc-next.git", branch = "seal/rspack-migration" }
163+
swc_next_ecma_parser = { git = "https://github.com/swc-project/swc-next.git", branch = "seal/rspack-migration" }
164+
swc_next_ecma_semantic = { git = "https://github.com/swc-project/swc-next.git", branch = "seal/rspack-migration" }
165165

166166
tracy-client = { version = "=0.18.4", default-features = false, features = ["enable", "sampling", "demangle", "system-tracing"] }
167167
wasi-common = { version = "36.0.13", default-features = false }
@@ -369,18 +369,6 @@ opt-level = "s"
369369
[profile.release.package.swc_ecma_loader]
370370
opt-level = "s"
371371

372-
[profile.release.package.swc_experimental_ecma_ast]
373-
opt-level = "s"
374-
375-
[profile.release.package.swc_experimental_ecma_parser]
376-
opt-level = "s"
377-
378-
[profile.release.package.swc_experimental_ecma_semantic]
379-
opt-level = "s"
380-
381-
[profile.release.package.swc_experimental_ecma_visit]
382-
opt-level = "s"
383-
384372
[profile.release.package.chrono]
385373
opt-level = "s"
386374

crates/rspack_core/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ urlencoding = { workspace = true }
7474
ustr = { workspace = true }
7575
winnow = { workspace = true }
7676

77-
swc_experimental_allocator = { workspace = true }
78-
swc_experimental_ecma_ast = { workspace = true }
79-
swc_experimental_ecma_parser = { workspace = true }
80-
swc_experimental_ecma_semantic = { workspace = true }
77+
swc_next_allocator = { workspace = true }
78+
swc_next_ecma_ast = { workspace = true }
79+
swc_next_ecma_parser = { workspace = true }
80+
swc_next_ecma_semantic = { workspace = true }
8181

8282
[target.'cfg(not(target_family = "wasm"))'.dependencies]
8383
turbo-persistence = { workspace = true }

crates/rspack_core/src/cache/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ pub use cache_entry::{
1111
pub use codec::CacheCodec;
1212
pub use options::{BuildDepsOptions, PersistentCacheOptions, StorageOptions};
1313
pub use snapshot::{PathMatcher, SnapshotOptions, SnapshotStrategyOptions};
14+
15+
/// Bump when compiler-internal analysis changes make persisted build results
16+
/// incompatible without changing the published Rspack package version.
17+
pub(crate) const CACHE_COMPATIBILITY_VERSION: &str = "swc-next-parser-1";

0 commit comments

Comments
 (0)