Skip to content

fix(ast/estree): fix TS-ESTree AST for TSModuleDeclaration#10574

Merged
graphite-app[bot] merged 1 commit intomainfrom
04-23-fix_ast_estree_fix_ts-estree_ast_for_tsmoduledeclaration_
Apr 23, 2025
Merged

fix(ast/estree): fix TS-ESTree AST for TSModuleDeclaration#10574
graphite-app[bot] merged 1 commit intomainfrom
04-23-fix_ast_estree_fix_ts-estree_ast_for_tsmoduledeclaration_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Apr 23, 2025

Part of #9705.

Our AST represents module X.Y.Z {} as 3 x nested TSModuleDeclarations. TS-ESTree represents it as a single TSModuleDeclaration, with a nested tree of TSQualifiedNames as id.

Additionally, TS-ESTree skips the body field if the module declaration has no body e.g. module "foo";.

Align our TS-ESTree AST with these oddities.

@github-actions github-actions bot added the A-ast Area - AST label Apr 23, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-bug Category - Bug label Apr 23, 2025
@overlookmotel overlookmotel marked this pull request as ready for review April 23, 2025 19:27
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 23, 2025

CodSpeed Instrumentation Performance Report

Merging #10574 will not alter performance

Comparing 04-23-fix_ast_estree_fix_ts-estree_ast_for_tsmoduledeclaration_ (d1f5abb) with main (d22c1ae)

Summary

✅ 36 untouched benchmarks

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Apr 23, 2025
Copy link
Member Author

overlookmotel commented Apr 23, 2025

Merge activity

  • Apr 23, 3:33 PM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Apr 23, 3:33 PM EDT: overlookmotel added this pull request to the Graphite merge queue.
  • Apr 23, 7:54 PM UTC: The Graphite merge queue couldn't merge this PR because it timed out.
  • Apr 23, 4:20 PM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Apr 23, 4:27 PM EDT: overlookmotel added this pull request to the Graphite merge queue.
  • Apr 23, 4:39 PM EDT: Merged by the Graphite merge queue.

graphite-app bot pushed a commit that referenced this pull request Apr 23, 2025
Part of #9705.

Our AST represents `module X.Y.Z {}` as 3 x nested `TSModuleDeclaration`s. TS-ESTree represents it as a single `TSModuleDeclaration`, with a nested tree of `TSQualifiedName`s as `id`.

Additionally, TS-ESTree skips the `body` field if the module declaration has no body e.g. `module "foo";`.

Align our TS-ESTree AST with these oddities.
@graphite-app graphite-app bot force-pushed the 04-23-fix_ast_estree_fix_ts-estree_ast_for_tsmoduledeclaration_ branch from 256c67e to a2a32d7 Compare April 23, 2025 19:34
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 23, 2025
overlookmotel added a commit that referenced this pull request Apr 23, 2025
Part of #9705.

Our AST represents `module X.Y.Z {}` as 3 x nested `TSModuleDeclaration`s. TS-ESTree represents it as a single `TSModuleDeclaration`, with a nested tree of `TSQualifiedName`s as `id`.

Additionally, TS-ESTree skips the `body` field if the module declaration has no body e.g. `module "foo";`.

Align our TS-ESTree AST with these oddities.
@overlookmotel overlookmotel force-pushed the 04-23-fix_ast_estree_fix_ts-estree_ast_for_tsmoduledeclaration_ branch from a2a32d7 to 587b555 Compare April 23, 2025 20:20
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Apr 23, 2025
Part of #9705.

Our AST represents `module X.Y.Z {}` as 3 x nested `TSModuleDeclaration`s. TS-ESTree represents it as a single `TSModuleDeclaration`, with a nested tree of `TSQualifiedName`s as `id`.

Additionally, TS-ESTree skips the `body` field if the module declaration has no body e.g. `module "foo";`.

Align our TS-ESTree AST with these oddities.
@graphite-app graphite-app bot force-pushed the 04-23-fix_ast_estree_fix_ts-estree_ast_for_tsmoduledeclaration_ branch from 587b555 to d1f5abb Compare April 23, 2025 20:30
@graphite-app graphite-app bot merged commit d1f5abb into main Apr 23, 2025
29 checks passed
@graphite-app graphite-app bot deleted the 04-23-fix_ast_estree_fix_ts-estree_ast_for_tsmoduledeclaration_ branch April 23, 2025 20:39
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant