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
normalize swc_ecma_astserde-impl output at the Program entrypoint to a TypeScript-ESTree / typescript-eslint-oriented shape
remove internal serialization details like span and ctxt, and normalize representative node shapes including Program, ChainExpression, MemberExpression for super, PrivateIdentifier, PropertyDefinition, MethodDefinition, and TS* node names
add parser-driven serialization tests covering program roots, class/private fields, constructor parameter properties, optional chaining, and key TypeScript declaration/signature nodes
Details
keep deserialization on the existing SWC-facing format while making serialization intentionally asymmetric
add a normalization layer in swc_ecma_ast::serde_impl and wire Program to use it for serialization
make SyntaxContext-backed ctxt fields deserialize with defaults so older JSON inputs without ctxt continue to parse
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.
Next steps: Take a moment to review the security alert above. Review
the linked package source code to understand the potential risk. Ensure the
package is not malicious before proceeding. If you're unsure how to proceed,
reach out to your security team or ask the Socket team for help at
support@socket.dev.
Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.
Mark the package as acceptable risk. To ignore this alert only
in this pull request, reply with the comment
@SocketSecurity ignore npm/js-beautify@1.14.7. You can
also ignore all packages with @SocketSecurity ignore-all.
To ignore an alert for all future pull requests, use Socket's Dashboard to
change the triage state of this alert.
Comparing kdy1:kdy1/ts-estree-serde-output (44232e9) with main (236eff0)1
Footnotes
No successful run was found on main (87dee57) during the generation of this report, so 236eff0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
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.
Summary
swc_ecma_astserde-imploutput at theProgramentrypoint to a TypeScript-ESTree /typescript-eslint-oriented shapespanandctxt, and normalize representative node shapes includingProgram,ChainExpression,MemberExpressionforsuper,PrivateIdentifier,PropertyDefinition,MethodDefinition, andTS*node namesDetails
swc_ecma_ast::serde_impland wireProgramto use it for serializationSyntaxContext-backedctxtfields deserialize with defaults so older JSON inputs withoutctxtcontinue to parseTesting
git submodule update --init --recursivecargo fmt --allcargo test -p swc_ecma_astcargo test -p swc_ecma_ast --features serde-implcargo clippy --all --all-targets -- -D warningscargo clippy -p swc_ecma_ast --features serde-impl --all-targets -- -D warnings