Skip to content

fix(isolated-declarations): omit public accessor modifier#22880

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-public-accessor-declaration
Jun 1, 2026
Merged

fix(isolated-declarations): omit public accessor modifier#22880
graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-public-accessor-declaration

Conversation

@camc314

@camc314 camc314 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Accessor property declaration emit preserved an explicit public modifier because it passed property.accessibility through unchanged. Property and method declarations already normalize public accessibility away with transform_accessibility, so accessors should use the same path.

This applies Self::transform_accessibility when emitting accessor properties and adds a fixture case for public accessor i!: string, which now snapshots as accessor i: string;.

Stacked on #22878.

@github-actions github-actions Bot added the A-isolated-declarations Isolated Declarations label Jun 1, 2026
@camc314 camc314 added the run-monitor-oxc Add to a PR to dispatch oxc-project/monitor-oxc CI against it label Jun 1, 2026
@oxc-guard

oxc-guard Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@camc314 camc314 marked this pull request as ready for review June 1, 2026 10:29
@camc314 camc314 requested a review from Dunqing as a code owner June 1, 2026 10:29
Copilot AI review requested due to automatic review settings June 1, 2026 10:29
@codspeed-hq

codspeed-hq Bot commented Jun 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 52 untouched benchmarks
⏩ 5 skipped benchmarks1


Comparing codex/fix-public-accessor-declaration (5cd031c) with codex/fix-private-definite-declaration (1a46116)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns accessor property .d.ts emission with existing property/method emission by normalizing away an explicit public accessibility modifier (so public is omitted in output, matching TypeScript’s emit behavior).

Changes:

  • Apply Self::transform_accessibility when emitting ClassElement::AccessorProperty, ensuring public is normalized to None.
  • Add a fixture case (public accessor i!: string) and update the snapshot to expect accessor i: string;.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
crates/oxc_isolated_declarations/src/class.rs Normalizes accessor property accessibility via transform_accessibility so public is omitted in emitted declarations.
crates/oxc_isolated_declarations/tests/fixtures/set-get-accessor.ts Adds a public accessor fixture input to cover the behavior change.
crates/oxc_isolated_declarations/tests/snapshots/set-get-accessor.snap Updates expected .d.ts snapshot output to omit public for accessor properties.

@camc314 camc314 removed the run-monitor-oxc Add to a PR to dispatch oxc-project/monitor-oxc CI against it label Jun 1, 2026
@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Jun 1, 2026
@graphite-app graphite-app Bot force-pushed the codex/fix-private-definite-declaration branch from 1a46116 to a3ae099 Compare June 1, 2026 13:57
Base automatically changed from codex/fix-private-definite-declaration to main June 1, 2026 14:01

Dunqing commented Jun 1, 2026

Copy link
Copy Markdown
Member

Merge activity

  • Jun 1, 2:01 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jun 1, 2:02 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Jun 1, 2:06 PM UTC: Dunqing added this pull request to the Graphite merge queue.
  • Jun 1, 2:11 PM UTC: Merged by the Graphite merge queue.

@Dunqing Dunqing force-pushed the codex/fix-public-accessor-declaration branch from 5cd031c to 97820a1 Compare June 1, 2026 14:01
Accessor property declaration emit preserved an explicit `public` modifier because it passed `property.accessibility` through unchanged. Property and method declarations already normalize public accessibility away with `transform_accessibility`, so accessors should use the same path.

This applies `Self::transform_accessibility` when emitting accessor properties and adds a fixture case for `public accessor i!: string`, which now snapshots as `accessor i: string;`.

Stacked on #22878.
@graphite-app graphite-app Bot force-pushed the codex/fix-public-accessor-declaration branch from 97820a1 to 070eb9e Compare June 1, 2026 14:07
@graphite-app graphite-app Bot merged commit 070eb9e into main Jun 1, 2026
29 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jun 1, 2026
@graphite-app graphite-app Bot deleted the codex/fix-public-accessor-declaration branch June 1, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-isolated-declarations Isolated Declarations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants