Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jun 23, 2025

Pure refactor. Pre-calculate number of node types in codegen. This prepares the way for replacing the Map with a plain JS object.

@github-actions github-actions bot added the A-ast-tools Area - AST tools label Jun 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-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Jun 23, 2025
@overlookmotel overlookmotel marked this pull request as ready for review June 23, 2025 11:16
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jun 23, 2025
Copy link
Member Author

overlookmotel commented Jun 23, 2025

Merge activity

  • Jun 23, 11:16 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jun 23, 11:46 AM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Jun 23, 11:48 AM UTC: overlookmotel added this pull request to the Graphite merge queue.

Comment on lines +191 to +193
NODE_TYPE_IDS_MAP,
NODE_TYPES_COUNT: 178,
LEAF_NODE_TYPES_COUNT: 38,
Copy link
Contributor

@camc314 camc314 Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

random thought, it could be cool if the minifier calculate these at compile time

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you mean? Does the minifier create Vec's with a number of elements equal to the number of node types / AstKinds?

@overlookmotel overlookmotel merged commit 0bf7815 into main Jun 23, 2025
16 checks passed
@overlookmotel overlookmotel deleted the 06-21-refactor_napi_parser_lazy_visitor_pre-calculate_count_of_node_types branch June 23, 2025 11:46
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants