Skip to content

fix(ast): estree compat Program.sourceType#8919

Merged
overlookmotel merged 2 commits intooxc-project:mainfrom
hi-ogawa:fix-estree-sourceType
Feb 6, 2025
Merged

fix(ast): estree compat Program.sourceType#8919
overlookmotel merged 2 commits intooxc-project:mainfrom
hi-ogawa:fix-estree-sourceType

Conversation

@hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Feb 6, 2025

part of #2854
ref: https://github.com/estree/estree/blob/master/es2015.md#programs

I tried to move via customization on struct SourceType, but couldn't find a way maybe because struct is defined in oxc_span. For now, I made this as via on Program::source_type field.

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 6, 2025

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.

@github-actions github-actions bot added A-ast Area - AST C-bug Category - Bug labels Feb 6, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 6, 2025

CodSpeed Performance Report

Merging #8919 will not alter performance

Comparing hi-ogawa:fix-estree-sourceType (a702d5a) with main (6942d2d)

Summary

✅ 33 untouched benchmarks

@hi-ogawa hi-ogawa marked this pull request as ready for review February 6, 2025 08:16
@hi-ogawa hi-ogawa changed the title fix(ast): match Prograrm.sourceType with estree fix(ast): estree compat Prograrm.sourceType Feb 6, 2025
@overlookmotel overlookmotel changed the title fix(ast): estree compat Prograrm.sourceType fix(ast): estree compat Program.sourceType Feb 6, 2025
Copy link
Member

@overlookmotel overlookmotel left a comment

Choose a reason for hiding this comment

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

I think we can simplify this. I'll do a follow-up PR if I can make it work.

@overlookmotel overlookmotel merged commit a520986 into oxc-project:main Feb 6, 2025
28 checks passed
graphite-app bot pushed a commit that referenced this pull request Feb 7, 2025
#8919 fixed serialization of the `Program::source_type` field.

Remove the custom `Serialize` impl for this - use `#[estree(flatten)]` and `#[estree(skip)]` attributes to achieve the same thing. Also, remove extraneous TS type definitions for the parts of `SourceType` which aren't part of the ESTree AST.
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.

2 participants