Skip to content

Storybook: Drop unused support for js-as-jsx - #82192

Merged
aduth merged 2 commits into
trunkfrom
remove/storybook-js-as-jsx
Aug 31, 2026
Merged

Storybook: Drop unused support for js-as-jsx#82192
aduth merged 2 commits into
trunkfrom
remove/storybook-js-as-jsx

Conversation

@aduth

@aduth aduth commented Aug 28, 2026

Copy link
Copy Markdown
Member

What?

Removes Storybook configuration that exists to support stories being written as .js files.

Related: #80855, #80990, #74396

Why?

This was originally added as part of the Storybook v10 upgrade in #74396, where Vite requires .jsx extension, but many of our stories were written as .js. Since this is no longer the case after #80990 and we expect all stories to have .jsx or .tsx file extensions, we don't need this additional support or detection for .js files. This is further guaranteed by linting added in #80123 that requires all new files with JSX syntax to use the .tsx file extension.

Testing Instructions

Storybook should build and run as normal:

npm run storybook:build
npm run storybook:dev

Use of AI Tools

Used Claude Code + Opus 5 to understand what was or wasn't required here and implement updates, which were then reviewed by myself.

@aduth
aduth requested a review from ciampo August 28, 2026 18:24
@github-actions

github-actions Bot commented Aug 28, 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: aduth <aduth@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

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

@aduth
aduth requested a review from manzoorwanijk August 28, 2026 18:25
@aduth aduth added [Type] Build Tooling Issues or PRs related to build tooling Storybook Storybook and its stories for components labels Aug 28, 2026
@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 7.91 MB

compressed-size-action

@ciampo ciampo 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.

LGTM 🚀

Looks like we could also remove js from the components E2E story glob in test/storybook-playwright/storybook/main.ts?

@aduth

aduth commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

Looks like we could also remove js from the components E2E story glob in test/storybook-playwright/storybook/main.ts?

Yep, good catch. Updated in b1ce81c and confirmed there were no existing .jsx or .js files (would have been broken already anyways).

@github-actions

Copy link
Copy Markdown

Flaky tests detected in b1ce81c.
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/33390690614
📝 Reported tests:

As a user I want to be able to create a navigation overlay for a specific navigation block in /test/e2e/specs/site-editor/navigation-overlay-template-part.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('region', { name: /(Editor publish|Save panel)/ }).getByRole('button', { name: 'Save', exact: true })

    at Editor.saveSiteEditorEntities (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/editor/site-editor.ts:42:5)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-overlay-template-part.spec.js:90:4
should work as expected in /test/e2e/specs/site-editor/save-entity-record-template-compat.spec.js, passed after 1 failed attempt.
Error: apiRequestContext.fetch: socket hang up
Call log:
  - → GET http://localhost:8889/wp-json/wp/v2/templates
    - user-agent: Playwright/1.62.1 (x64; ubuntu 24.04) node/20.20 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - X-WP-Nonce: 1a245e3306
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_23778236db82f19306f247e20a353a99=admin%7C1788351549%7C2LZsQUsh1yCovmrG9Sspfl38yBjXzrqsLiEKqjPkIZD%7C209f1ea8db95805a980d4d5f46953ac33a000904fca613021adfddc7681a59ea; wp-settings-time-1=1788179524

    at RequestUtils.rest (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/rest.ts:112:39)
    at RequestUtils.deleteAllTemplates (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/templates.ts:35:31)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/save-entity-record-template-compat.spec.js:16:22

@aduth
aduth merged commit 0842bfb into trunk Aug 31, 2026
51 checks passed
@aduth
aduth deleted the remove/storybook-js-as-jsx branch August 31, 2026 13:14
@github-actions github-actions Bot added this to the Gutenberg 24.0 milestone Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storybook Storybook and its stories for components [Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants