Skip to content

Build: Normalize JSX file extensions - #80990

Merged
ciampo merged 11 commits into
trunkfrom
codex/vitest-consolidated-02-jsx-extensions
Aug 27, 2026
Merged

Build: Normalize JSX file extensions#80990
ciampo merged 11 commits into
trunkfrom
codex/vitest-consolidated-02-jsx-extensions

Conversation

@ciampo

@ciampo ciampo commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Part of #80855. Follows #81040 and preserves #80123.

What?

Rename tracked JavaScript files that contain JSX to .jsx, including related snapshots, references, and changelogs.

Why?

Make JSX-bearing files explicit to Vite and other tooling as a foundation for the test migration.

How?

  • Of 1,506 changed paths, 1,306 are exact renames and 13 are renames with related edits. The remaining 187 update references, tooling, and changelogs.
  • Keep wp-build compatibility for JSX in .js, while ESLint continues to require new unsuppressed JSX files to use .tsx.
  • Update import resolution so built JavaScript exports map to source without hiding unresolved non-build exports.

Supported package exports and build output are unchanged. Unsupported internal src paths now use .jsx.

Testing Instructions

  1. Run npm run lint:js.
  2. Run npm run typecheck.
  3. Run npm run test:unit.
  4. Run npm run test:unit:vitest.
  5. Run npm run test:unit:routing.
  6. Run npm run build.

Testing Instructions for Keyboard

Not applicable. This PR does not change UI behavior.

Use of AI Tools

Codex assisted with the mechanical rename, rebase, review fixes, and verification. The author reviewed the changes and test output.

@github-actions github-actions Bot added [Package] Element /packages/element [Package] Data /packages/data [Package] Compose /packages/compose [Package] Core data /packages/core-data [Package] Viewport /packages/viewport [Package] Plugins /packages/plugins [Package] Components /packages/components [Package] Blocks /packages/blocks [Package] Editor /packages/editor [Package] Block library /packages/block-library [Package] Format library /packages/format-library [Package] Block editor /packages/block-editor [Package] Edit Post /packages/edit-post [Package] Edit Widgets /packages/edit-widgets [Package] Interface /packages/interface [Package] Primitives /packages/primitives [Package] Edit Site /packages/edit-site [Package] Private APIs /packages/private-apis [Package] Commands /packages/commands [Package] Core commands /packages/core-commands [Package] Patterns /packages/patterns [Package] Fields /packages/fields labels Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 7.91 MB

compressed-size-action

@ciampo
ciampo force-pushed the codex/vitest-consolidated-01-foundation branch from 96397cb to 3e1cab1 Compare July 30, 2026 23:46
@ciampo
ciampo force-pushed the codex/vitest-consolidated-02-jsx-extensions branch 3 times, most recently from 83736a6 to 2216a5f Compare July 31, 2026 01:12
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

Flaky tests detected in 0bddaab.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/33074831205
📝 Reported tests:

Should navigate inner blocks with arrow keys in /test/e2e/specs/editor/various/writing-flow.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('listbox', { name: 'Blocks' }).getByRole('option', { name: 'Paragraph' })

    at WritingFlowUtils.addDemoContent (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/writing-flow.spec.js:1482:5)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/writing-flow.spec.js:30:3

@ciampo
ciampo marked this pull request as ready for review August 27, 2026 13:03
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@manzoorwanijk manzoorwanijk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks fine to me

@aduth

aduth commented Aug 27, 2026

Copy link
Copy Markdown
Member
  • Keep wp-build compatibility for JSX in .js, while ESLint continues to require new unsuppressed JSX files to use .tsx.

Would we ever remove this? I feel like we added a bunch of hacks about supporting JSX in .js files just because we didn't have this normalization but that we'd be better off without them. Understanding that this potentially has a downstream impact, but I think we're in a strong position to be opinionated about this (following the ecosystem's lead) as a documented breaking change.

@aduth

aduth commented Aug 28, 2026

Copy link
Copy Markdown
Member

This should let us remove some of the artificial supports we added to Storybook as well: #82192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Package] Block library /packages/block-library [Package] Blocks /packages/blocks [Package] Commands /packages/commands [Package] Components /packages/components [Package] Compose /packages/compose [Package] Core commands /packages/core-commands [Package] Core data /packages/core-data [Package] Data /packages/data [Package] Edit Post /packages/edit-post [Package] Edit Site /packages/edit-site [Package] Edit Widgets /packages/edit-widgets [Package] Editor /packages/editor [Package] Element /packages/element [Package] Fields /packages/fields [Package] Format library /packages/format-library [Package] Interface /packages/interface [Package] Patterns /packages/patterns [Package] Plugins /packages/plugins [Package] Primitives /packages/primitives [Package] Private APIs /packages/private-apis [Package] Viewport /packages/viewport [Package] wp-build /packages/wp-build [Tool] Docgen /packages/docgen [Tool] ESLint plugin /packages/eslint-plugin [Tool] WP Scripts /packages/scripts [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants