Skip to content

Conversation

@hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Mar 20, 2025

Copy link
Contributor Author

hi-ogawa commented Mar 20, 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.

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

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

codspeed-hq bot commented Mar 20, 2025

CodSpeed Instrumentation Performance Report

Merging #9913 will not alter performance

Comparing 03-18-fix_ast_estree_fix_function.this_param_ (8228b74) with main (5631ebd)

Summary

✅ 33 untouched benchmarks

@hi-ogawa hi-ogawa force-pushed the 03-18-fix_ast_estree_fix_function.this_param_ branch from 431392e to 7936dae Compare March 20, 2025 07:07
@hi-ogawa hi-ogawa marked this pull request as ready for review March 20, 2025 07:53
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 there's a better way than adding SequenceSerializer::serialize_ts_element. I'll make a follow-up PR.

But... test passes % into double figures! Still a long way to go, but we're getting somewhere now...

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Mar 21, 2025
Copy link
Member

overlookmotel commented Mar 21, 2025

Merge activity

  • Mar 21, 2:27 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 21, 2:57 AM EDT: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..
  • Mar 21, 2:57 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 21, 2:59 AM EDT: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..
  • Mar 21, 2:59 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 21, 3:25 AM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 21, 3:31 AM EDT: A user merged this pull request with the Graphite merge queue.

Base automatically changed from 03-20-fix_ast_extree_fix_tsmoduledeclaration.global_ to graphite-base/9907 March 21, 2025 06:57
@graphite-app graphite-app bot changed the base branch from graphite-base/9907 to main March 21, 2025 06:57
@overlookmotel overlookmotel changed the base branch from main to graphite-base/9913 March 21, 2025 07:16
@overlookmotel overlookmotel force-pushed the 03-18-fix_ast_estree_fix_function.this_param_ branch from 20f19af to ae3a901 Compare March 21, 2025 07:16
@overlookmotel overlookmotel changed the base branch from graphite-base/9913 to 03-21-fix_ast_extree_fix_tsmoduledeclaration.global_ March 21, 2025 07:16
Base automatically changed from 03-21-fix_ast_extree_fix_tsmoduledeclaration.global_ to main March 21, 2025 07:18
@graphite-app graphite-app bot force-pushed the 03-18-fix_ast_estree_fix_function.this_param_ branch from ae3a901 to 8228b74 Compare March 21, 2025 07:25
@graphite-app graphite-app bot merged commit 8228b74 into main Mar 21, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 03-18-fix_ast_estree_fix_function.this_param_ branch March 21, 2025 07:31
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 21, 2025
graphite-app bot pushed a commit that referenced this pull request Mar 21, 2025
Follow-on after #9913.

`TSThisParameter` is a TS-only type, so its fields aren't optional the way the TS fields of JS types are.

Fix the type def by using JS versions of added fields (`False` instead of `TsFalse` etc).

Also re-order the fields, so that `name` is first. We want the object shape to be the same (same field order) for all types which are `Identifier`s in the ESTree AST.
graphite-app bot pushed a commit that referenced this pull request Mar 21, 2025
…zer` (#9943)

Remove the `serialize_ts_element` method added in #9913, and instead expose an `INCLUDE_TS_FIELDS` constant on `Serializer` trait.

Before:

```rs
if let Some(this_param) = &self.0.this_param {
    seq.serialize_ts_element(this_param);
}
```

After:

```rs
if S::INCLUDE_TS_FIELDS {
    if let Some(this_param) = &self.0.this_param {
        seq.serialize_element(this_param);
    }
}
```

This has one slight advantage. Because `INCLUDE_TS_FIELDS` is a constant, compiler will easily be able to prove that the code inside `if S::INCLUDE_TS_FIELDS { ... }` is dead code in the JS-only AST serializer, and remove it.

In this specific case, the TS-only logic is trivial, so compiler would probably see it could be optimized out anyway. But we may encounter other cases where more complex TS-only code is required, and compiler might not be able to prove that it's dead code in those cases.
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.

3 participants