Skip to content

Storybook: Use experimental docgen server - #80697

Draft
aduth wants to merge 1 commit into
trunkfrom
add/ds-mcp-dual-manifest
Draft

aduth wants to merge 1 commit into
trunkfrom
add/ds-mcp-dual-manifest

Conversation

@aduth

@aduth aduth commented Jul 24, 2026 •

Copy link
Copy Markdown
Member

What?

Updates Storybook to use the new React meta docgen service through its new experimentalDocgenServer option in Storybook 10.5.0.

Note: The pull request in its current shape is heavily AI-coded and I haven't fully reviewed the code changes. It's unlikely that this would land in its current shape, but is useful to understand for context to the chain of pull requests in the stack (#80692, #80655) that it influences.

Why?

The new docgen service is meant to be more performant and accurate, and it's something we already use for the components manifest, so enabling it everywhere also brings consistency between the manifest and live Storybook site.

How?

  • Replaces experimentalReactComponentMeta with experimentalDocgenServer.
  • Removes react-docgen-typescript, including its settings and related dependencies. The new docgen service is meant to replace react-docgen-typescript.

Unfortunately, this update brings some issues which either block this or will need to be worked through.

  • @ignore does not currently seem to be respected, causing ignored props to be shown on the live Storybook site.
  • The shape of the manifest has changed yet again, and the new "v": 1 is not compatible in affected clients like the design system MCP server.

The latter is a pretty substantial issue, and what we'll likely want to do is extract the pieces here for the "dual client" to make it so that the published @wordpress/design-system-mcp is capable of handling the new manifest shape before we make that the default in the live Storybook site. We can remove the dual handling later once clients are updated.

This is also a reminder of why it's hazardous to try to leverage experimental features, and this is something we "signed up for" by choosing to do so. It may also be prudent to wait for the manifest shape to fully stabilize before committing to this upgrade.

Testing Instructions

TBD

Use of AI Tools

Used Cursor IDE + Auto (likely Composer) model for the sequence of pull requests in this stack of pull requests, reviewed and iterated manually prompted by myself.

@aduth aduth added [Type] Developer Documentation Documentation for developers Storybook Storybook and its stories for components [Package] Design System MCP /packages/design-system-mcp labels Jul 24, 2026
@aduth

aduth commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

Likely next steps here:

  1. Extract the changes around dependency on the path ➡️ package handling in design-system-mcp that will become incompatible with the new docgen server. This can happen today on trunk and will make this future work simpler.
  2. Then, the rest of the "dual client" approach can also be migrated to land on trunk, independent of pull requests in the chain. The idea is that the client would be able to support both Storybook 10.4 (legacy-enhanced) manifests produced under experimentalReactComponentMeta, as well as Storybook 10.5 $ref-referenced manifests produced under experimentalDocgenServer.

@aduth
aduth force-pushed the add/ds-mcp-dual-manifest branch from 7d5831f to cb6b778 Compare October 27, 2026 14:28
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

📦 Bundle size

Size Change: 0 B

Total Size: 8.55 MB

cb6b778 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 41b3dfd trunk % Change
timeToFirstByte 57.1 ms +13.22% -2.54% 59.45 ms +9.59% -7.49% -3.95%
largestContentfulPaint 94 ms +10.64% -2.13% 100 ms +8% -6% -6%
lcpMinusTtfb 36.75 ms +10.07% -2.72% 41 ms +11.95% -11.1% -10.37%
wpBeforeTemplate 30.43 ms +16.14% -2.5% 30.7 ms +15.73% -3.22% -0.88%
wpTemplate 22.4 ms +4.46% -3.08% 23.11 ms +9.52% -7.96% -3.07%
wpTotal 53.27 ms +10.47% -2.74% 55.52 ms +9.4% -7.84% -4.05%
wpMemoryUsage 7.70 MB +0% -0% 7.67 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 41b3dfd trunk % Change
timeToFirstByte 43.3 ms +6.93% -3% 44.65 ms +7.84% -2.24% -3.02%
largestContentfulPaint 92 ms +6.52% -0% 96 ms +4.17% -4.17% -4.17%
lcpMinusTtfb 50.55 ms +3.26% -1.88% 50.75 ms +3.15% -3.74% -0.39%
wpBeforeTemplate 27.63 ms +2.93% -3.15% 28.38 ms +7.79% -2.04% -2.64%
wpTemplate 12.65 ms +3.16% -3.32% 12.97 ms +3.78% -1.7% -2.47%
wpTotal 40.2 ms +7.24% -2.91% 41.75 ms +7.95% -2.49% -3.71%
wpMemoryUsage 6.28 MB +0% -0% 6.25 MB +0% -0% 0.54%
wpDbQueries 9 +0% -0% 9 +0% -0% 0%

media-processing

Metric 41b3dfd trunk % Change
mediaProcessingJpeg 411.81 ms +6.4% -0.33% 408 ms +0.38% -0.25% 0.93%
mediaProcessingAvif 6142.89 ms +0.11% -0.04% 6105.33 ms +0.26% -0.24% 0.62%
mediaProcessingJpegToAvif 4241.51 ms +0.17% -0.85% 4217.57 ms +0.3% -0.06% 0.57%

media-upload

Metric 41b3dfd trunk % Change
jpegUploadProcessing 1469.12 ms +1.86% -1.76% 1451.3 ms +2.08% -0.33% 1.23%
pngUploadProcessing 258.35 ms +9.14% -26.99% 219.52 ms +17.28% -20.44% 17.69%
largeJpegUploadProcessing 1449.23 ms +0.71% -1% 1430.17 ms +1.24% -0.33% 1.33%
multipleImageUploadProcessing 1562.66 ms +2.04% -1.37% 1554.9 ms +2.6% -2.25% 0.5%

post-editor

Metric 41b3dfd trunk % Change
serverResponse 496.81 ms +6.87% -10.31% 489.67 ms +6.81% -7.38% 1.46%
firstPaint 466.79 ms +9.93% -40.11% 499.53 ms +1.87% -39.79% -6.55%
domContentLoaded 877.82 ms +2.44% -4.87% 862.16 ms +0.43% -2.28% 1.82%
loaded 879.05 ms +2.41% -4.89% 863.3 ms +0.42% -2.28% 1.82%
firstContentfulPaint 510.82 ms +0.99% -14.65% 508.07 ms +2.02% -2.72% 0.54%
firstBlock 2952.86 ms +2.97% -0.89% 2979.16 ms +1.84% -2.31% -0.88%
type 17 ms +1.65% -1.94% 17.53 ms +1.83% -7.13% -3.02%
typeWithoutInspector 16.68 ms +2.88% -4.8% 17.13 ms +1.75% -6.07% -2.63%
typeWithTopToolbar 21.95 ms +5.1% -6.88% 25.51 ms +2.43% -6.23% -13.96%
typeContainer 8.14 ms +18.06% -11.92% 8.08 ms +5.94% -5.82% 0.74%
focus 121.44 ms +3.41% -12.72% 124.23 ms +10.11% -4.72% -2.25%
firstFocus 237.5 ms +0% -0% 257.44 ms +0% -0% -7.75%
selectAll 484.07 ms +2.06% -1.78% 523.37 ms +2.41% -3.92% -7.51%
listViewOpen 81.25 ms +5.83% -5.91% 74.7 ms +12.46% -7.64% 8.77%
inserterOpen 41.89 ms +3.49% -12.06% 41.83 ms +7.77% -12.46% 0.14%
inserterHover 11.22 ms +11.41% -9.71% 11.71 ms +15.88% -14.09% -4.18%
inserterSearch 8.46 ms +6.86% -11.58% 7.55 ms +17.09% -5.03% 12.05%
loadPatterns 625.71 ms +8.3% -3.9% 633.02 ms +2.67% -4.29% -1.15%
wpTotal 487.63 ms +6.64% -10.48% 480 ms +7.06% -7.55% 1.59%
wpMemoryUsage 14.75 MB +0% -0% 14.72 MB +0% -0% 0.24%
wpDbQueries 55 +0% -1.82% 55 +0% -1.82% 0%

site-editor

Metric 41b3dfd trunk % Change
serverResponse 515.52 ms +1.74% -2.48% 530.3 ms +3.09% -2.57% -2.79%
firstPaint 283.65 ms +15.32% -11.61% 282.3 ms +74.41% -9.56% 0.48%
domContentLoaded 931.86 ms +1.24% -1.21% 917.02 ms +1.37% -1.89% 1.62%
loaded 933.31 ms +1.19% -1.22% 918.21 ms +1.37% -1.89% 1.64%
firstContentfulPaint 525.22 ms +4.76% -4.52% 502.28 ms +3.53% -3.13% 4.57%
firstBlock 4128.07 ms +0.92% -1.3% 3982.51 ms +1.79% -2.84% 3.65%
type 20.25 ms +9.63% -9.83% 20.95 ms +5.2% -11.98% -3.34%
navigate 133.89 ms +6.08% -2.66% 132.49 ms +6.81% -2.95% 1.06%
loadPatterns 1261 ms +3.34% -4.57% 1190.63 ms +6.69% -4.86% 5.91%
loadPages 1006.92 ms +2.93% -1.87% 959.98 ms +2.56% -3.02% 4.89%
wpTotal 506.1 ms +1.74% -2.5% 520.66 ms +3.15% -2.74% -2.8%
wpMemoryUsage 12.77 MB +0% -0% 12.74 MB +0% -0% 0.24%
wpDbQueries 44 +2.27% -0% 44 +2.27% -0% 0%

cb6b778 Run

🏁 Flaky tests

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.

a navigation superseded by the traversal discharges to idle in /test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts, passed after 1 failed attempt.
SyntaxError: Unexpected token 'o', "not hydrated" is not valid JSON
    at readLog (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:28:14)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:47:24
    at waitForLogLength (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:46:2)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:693:5

realigns threads after a tall thread collapses in /test/e2e/specs/editor/various/block-notes-floating.spec.js, passed after 1 failed attempt.

should cut and paste individual blocks with collapsed selection in /test/e2e/specs/editor/various/copy-cut-paste.spec.js, passed after 2 failed attempts.
Error: expect(string).toMatchSnapshot(expected) failed

  @@ -1,3 +1,3 @@
   <!-- wp:paragraph -->
  -<p>2Cut - collapsed selection</p>
  +<p>2</p>
   <!-- /wp:paragraph -->


    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/copy-cut-paste.spec.js:45:49
Error: expect(string).toMatchSnapshot(expected) failed

  @@ -1,3 +1,3 @@
   <!-- wp:paragraph -->
  -<p>2Cut - collapsed selection</p>
  +<p>2</p>
   <!-- /wp:paragraph -->


    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/copy-cut-paste.spec.js:45:49
should format text across blocks in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

@@ -1,9 +1,9 @@
  Array [
    Object {
      "attributes": Object {
-       "content": "ab",
+       "content": "b",
      },
      "name": "core/paragraph",
    },
    Object {
      "attributes": Object {

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:2219:41
should indent and outdent multi-selected items with Tab in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

@@ -1,8 +1,8 @@
  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>one<!-- wp:list -->
+ <li>ne<!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
  <li>two</li>
  <!-- /wp:list-item -->

  <!-- wp:list-item -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:1118:52
should keep the list type when indenting an ordered list item in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

@@ -1,8 +1,8 @@
  <!-- wp:list {"ordered":true} -->
  <ol class="wp-block-list"><!-- wp:list-item -->
- <li>one<!-- wp:list {"ordered":true} -->
+ <li>ne<!-- wp:list {"ordered":true} -->
  <ol class="wp-block-list"><!-- wp:list-item -->
  <li>two</li>
  <!-- /wp:list-item --></ol>
  <!-- /wp:list --></li>
  <!-- /wp:list-item --></ol>

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:916:52
should not have a dead zone above an aligned block in /test/e2e/specs/editor/various/writing-flow.spec.js, passed after 1 failed attempt.
TypeError: Cannot read properties of null (reading 'y')
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/writing-flow.spec.js:1053:39
should not undo asterisk transform with backspace after selection change in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeVisible() failed

Locator: locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/list"]')
Expected: visible
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeVisible" locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/list"]') with timeout 5000ms
  - waiting for locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/list"]')

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:243:5
should remove an anchored list when deleting its last item in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

@@ -5,11 +5,11 @@
      },
      "innerBlocks": Array [
        Object {
          "attributes": Object {
            "anchor": "item",
-           "content": "x",
+           "content": "",
          },
          "name": "core/list-item",
        },
      ],
      "name": "core/list",

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:2961:41
should replace selected non-breaking spaces from the toolbar in /test/e2e/specs/editor/various/rich-text.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

  Array [
    Object {
      "attributes": Object {
-       "content": "one two three",
+       "content": "ne two three",
      },
      "name": "core/paragraph",
    },
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/rich-text.spec.js:1050:41
shows block preview when hovering over block in inserter in /test/e2e/specs/editor/various/inserting-blocks.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeInViewport() failed

Locator: locator('.block-editor-inserter__preview')
Expected: in viewport
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeInViewport" locator('.block-editor-inserter__preview') with timeout 5000ms
  - waiting for locator('.block-editor-inserter__preview')

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/inserting-blocks.spec.js:819:5

cb6b778 Run

This branch has not been deployed

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

Labels

[Package] Design System MCP /packages/design-system-mcp Storybook Storybook and its stories for components [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant