You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds public NodeId, ScopeId, and BindingId types to swc_ecma_ast, adds node_id fields to scope-owning AST nodes, and adds scope_id to Ident. The resolver now assigns deterministic node/scope ids and records binding/reference scope ids while preserving the existing SyntaxContext projection for downstream compatibility.
This also updates serde defaults and camelCase schema output, rkyv/encoding coverage, generated visit/hooks code, TypeScript public types, parser/transformer construction sites, and focused node/scope id tests.
Validation:
git submodule update --init --recursive
cargo test -p generate-code test_ecmascript -- --nocapture
Direct construction or exhaustive pattern matching of the affected AST structs must account for the new node_id and scope_id fields. Existing serde JSON without these fields continues to deserialize with default ids.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.
No successful run was found on main (0d8e651) during the generation of this report, so 21873b0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
So this improves the performance, but not very impactful
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Adds public
NodeId,ScopeId, andBindingIdtypes toswc_ecma_ast, addsnode_idfields to scope-owning AST nodes, and addsscope_idtoIdent. The resolver now assigns deterministic node/scope ids and records binding/reference scope ids while preserving the existingSyntaxContextprojection for downstream compatibility.This also updates serde defaults and camelCase schema output, rkyv/encoding coverage, generated visit/hooks code, TypeScript public types, parser/transformer construction sites, and focused node/scope id tests.
Validation:
git submodule update --init --recursivecargo test -p generate-code test_ecmascript -- --nocapturecargo check --all --all-targetscargo test -p swc_ecma_ast --features serde-implcargo test -p swc_ecma_visitcargo test -p swc_ecma_transforms_basecargo test -p swc_ecma_minifiercargo fmt --allcargo clippy --all --all-targets -- -D warningscargo check -p swc_ecma_ast --features rkyv-implcargo check -p swc_ecma_ast --features encoding-implBREAKING CHANGE:
Direct construction or exhaustive pattern matching of the affected AST structs must account for the new
node_idandscope_idfields. Existing serde JSON without these fields continues to deserialize with default ids.Related issue (if exists):
N/A