Skip to content

feat(ast/estree): ESTree AST ExportNamedDeclaration always have attributes field#9546

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-04-feat_ast_estree_estree_ast_exportnameddeclaration_always_have_attributes_field
Mar 5, 2025
Merged

feat(ast/estree): ESTree AST ExportNamedDeclaration always have attributes field#9546
graphite-app[bot] merged 1 commit intomainfrom
03-04-feat_ast_estree_estree_ast_exportnameddeclaration_always_have_attributes_field

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 4, 2025

Acorn does not include an attributes field on ExportNamedDeclaration when source == null. I think that's an oversight - acornjs/acorn#1346.

Bump acorn-test262 to include commit oxc-project/estree-conformance@96faefa which adds the missing attributes field to Acorn's AST.

This allows simplifying serialization/deserialization code, as we now don't need to deal with this special case.

Copy link
Member Author

overlookmotel commented Mar 4, 2025

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 4, 2025

CodSpeed Performance Report

Merging #9546 will create unknown performance changes

Comparing 03-04-feat_ast_estree_estree_ast_exportnameddeclaration_always_have_attributes_field (3e4f909) with main (734b6b6)

Summary

🆕 39 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 parser_napi[RadixUIAdoptionSection.jsx] N/A 4.8 ms N/A
🆕 parser_napi[pdf.mjs] N/A 1.8 s N/A
🆕 parser_napi_raw[RadixUIAdoptionSection.jsx] N/A 1.3 ms N/A
🆕 parser_napi_raw[cal.com.tsx] N/A 700 ms N/A
🆕 parser_napi_raw[checker.ts] N/A 1.1 s N/A
🆕 parser_napi_raw[pdf.mjs] N/A 266.6 ms N/A
🆕 codegen[checker.ts] N/A 23.1 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 66.2 ms N/A
🆕 isolated-declarations[vue-id.ts] N/A 57.8 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 20.9 µs N/A
🆕 lexer[antd.js] N/A 24.1 ms N/A
🆕 lexer[cal.com.tsx] N/A 5.7 ms N/A
🆕 lexer[checker.ts] N/A 14.5 ms N/A
🆕 lexer[pdf.mjs] N/A 3.8 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.7 ms N/A
🆕 linter[cal.com.tsx] N/A 1.2 s N/A
🆕 linter[checker.ts] N/A 2.9 s N/A
🆕 mangler[antd.js] N/A 16.1 ms N/A
🆕 mangler[react.development.js] N/A 297.4 µs N/A
🆕 mangler[typescript.js] N/A 39.8 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 5, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 5, 2025

Merge activity

…tributes` field (#9546)

Acorn does not include an `attributes` field on `ExportNamedDeclaration` when `source == null`. I think that's an oversight - acornjs/acorn#1346.

Bump `acorn-test262` to include commit oxc-project/estree-conformance@96faefa which adds the missing `attributes` field to Acorn's AST.

This allows simplifying serialization/deserialization code, as we now don't need to deal with this special case.
@graphite-app graphite-app bot force-pushed the 03-03-ci_benchmarks_benchmark_napi_parser branch from 49a4100 to a9889f5 Compare March 5, 2025 02:21
@graphite-app graphite-app bot force-pushed the 03-04-feat_ast_estree_estree_ast_exportnameddeclaration_always_have_attributes_field branch from e6e6279 to 3e4f909 Compare March 5, 2025 02:21
graphite-app bot pushed a commit that referenced this pull request Mar 5, 2025
Similar to #9546. Acorn has inconsistent field order for `Property` nodes - acornjs/acorn#1347.

Bump `acorn-test262` to include commit oxc-project/estree-conformance@7b7fa95, which orders the fields consistently in Acorn's AST.

This allows simplifying serialization/deserialization code, as we now don't need to deal with shuffling field order to match Acorn.
graphite-app bot pushed a commit that referenced this pull request Mar 5, 2025
Similar to #9546. Acorn outputs `RegExpLiteral`'s flags in same order as in source text. There is nothing wrong with this, but it makes our serialization/deserialization code more complex than it needs to be, just to match Acorn. I don't think we need to follow Acorn here - there's no particular "good" order for the flags.

Bump `acorn-test262` to include commit oxc-project/estree-conformance@3d7013e, which reorders the flags in alphabetical order in Acorn's AST.

This allows simplifying serialization/deserialization code on our side.
Base automatically changed from 03-03-ci_benchmarks_benchmark_napi_parser to main March 5, 2025 02:30
@graphite-app graphite-app bot merged commit 3e4f909 into main Mar 5, 2025
33 checks passed
@graphite-app graphite-app bot deleted the 03-04-feat_ast_estree_estree_ast_exportnameddeclaration_always_have_attributes_field branch March 5, 2025 02:34
@oxc-bot oxc-bot mentioned this pull request Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-ast Area - AST C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants