Skip to content

refactor(formatter): pre-collect parent information#11339

Closed
Dunqing wants to merge 1 commit intomainfrom
05-28-refactor_formatter_pre-collect_parents_information
Closed

refactor(formatter): pre-collect parent information#11339
Dunqing wants to merge 1 commit intomainfrom
05-28-refactor_formatter_pre-collect_parents_information

Conversation

@Dunqing
Copy link
Copy Markdown
Member

@Dunqing Dunqing commented May 28, 2025

POC is used for solving, sometimes parent_stack has lost some parent kinds, because some printing implementations will cause some nodes not to call push/pop.

@github-actions github-actions bot added A-ast-tools Area - AST tools A-formatter Area - Formatter labels May 28, 2025
Copy link
Copy Markdown
Member Author

Dunqing commented May 28, 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 the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label May 28, 2025
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented May 28, 2025

CodSpeed Instrumentation Performance Report

Merging #11339 will degrade performances by 19.61%

Comparing 05-28-refactor_formatter_pre-collect_parents_information (5c8d28a) with main (11d4523)

Summary

❌ 5 regressions
✅ 33 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
formatter[RadixUIAdoptionSection.jsx] 299.2 µs 365 µs -18.01%
formatter[binder.ts] 19.4 ms 23.1 ms -15.92%
formatter[cal.com.tsx] 150.3 ms 187 ms -19.61%
formatter[react.development.js] 9.5 ms 10.7 ms -11%
mangler[RadixUIAdoptionSection.jsx] 13.6 µs 14.3 µs -5.28%

@Dunqing Dunqing force-pushed the 05-26-feat_prettier_fill_printing_callexpression_implementation branch from 697e37c to ec5feb3 Compare May 28, 2025 15:12
@graphite-app graphite-app bot changed the base branch from 05-26-feat_prettier_fill_printing_callexpression_implementation to graphite-base/11339 May 30, 2025 14:33
graphite-app bot pushed a commit that referenced this pull request May 30, 2025
Printing a call expression correctly is mostly done, except for printing comments. Not many tests have passed because there is a problem with `ParentStack`. Some places use `ParentStack` to check the current parent, which may be incorrect. The issue is that some printing implementations do not call `push`/`pop`, meaning the recorded parent node is not accurate—it only reflects the last pushed record. I’ve attempted to solve this problem in #11339.
@Dunqing Dunqing force-pushed the graphite-base/11339 branch from 3eb38cc to 7360bd2 Compare June 3, 2025 03:49
@Dunqing Dunqing force-pushed the 05-28-refactor_formatter_pre-collect_parents_information branch from f4bd8bd to 1d09075 Compare June 3, 2025 03:49
@Dunqing Dunqing changed the base branch from graphite-base/11339 to main June 3, 2025 03:49
@Boshen Boshen changed the title refactor(formatter): pre-collect parental information refactor(formatter): pre-collect parent information Jun 3, 2025
@Dunqing Dunqing force-pushed the 05-28-refactor_formatter_pre-collect_parents_information branch from 1d09075 to 297fba3 Compare June 3, 2025 09:00
@github-actions github-actions bot added the A-ast Area - AST label Jun 3, 2025
@Dunqing Dunqing force-pushed the 05-28-refactor_formatter_pre-collect_parents_information branch from d06068d to 5c8d28a Compare June 3, 2025 10:11
@graphite-app graphite-app bot closed this in cf0b7d5 Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-ast-tools Area - AST tools A-formatter Area - Formatter 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.

1 participant