Skip to content

Components: Deprecate FormToggle - #85517

Draft
mirka wants to merge 4 commits into
trunkfrom
deprecate-form-toggle
Draft

mirka wants to merge 4 commits into
trunkfrom
deprecate-form-toggle

Conversation

@mirka

@mirka mirka commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

What?

Deprecate the public FormToggle component since WordPress 7.3, with removal planned for WordPress 7.5. Direct consumers to Switch from @wordpress/ui.

Why?

Switch is the recommended replacement, and FormToggle is already marked as not recommended. ToggleControl still relies on the internal component, so warning there would add deprecation messages throughout the editor.

How?

Follow the adapter approach in #83040: export a warning adapter from the package barrel and keep the existing internal FormToggle silent for ToggleControl. Mark the public API and README as deprecated, and move the story under Components/@wordpress-components/Deprecated while preserving its permalink.

Testing Instructions

  1. Open the FormToggle story (components-formtoggle--default) under Components/@wordpress-components/Deprecated. Confirm that the browser console logs wp.components.FormToggle is deprecated since version 7.3 and will be removed in version 7.5. Please use Switch from @wordpress/ui instead.
  2. Reload Storybook into a ToggleControl story. Confirm that no FormToggle deprecation warning is logged.

@mirka mirka added the [Type] Enhancement A suggestion for improvement. label Oct 25, 2026
@mirka mirka self-assigned this Oct 25, 2026
@github-actions github-actions Bot added the [Package] Components /packages/components label Oct 25, 2026
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

📦 Bundle size

Size Change: +49 B (0%)

Total Size: 9.06 MB

📦 View Changed
Filename Size Change
build/scripts/components/index.min.js 372 kB +49 B (+0.01%)

ec7d9a7 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 3a8fb0d trunk % Change
timeToFirstByte 53 ms +10.38% -1.6% 54.1 ms +5.73% -2.13% -2.03%
largestContentfulPaint 92 ms +6.52% -4.35% 96 ms +4.17% -10.42% -4.17%
lcpMinusTtfb 35.35 ms +22.63% -2.4% 39 ms +8.46% -15.64% -9.36%
wpBeforeTemplate 28.95 ms +12.54% -2.04% 29.29 ms +14.65% -3.14% -1.16%
wpTemplate 20.75 ms +6.51% -3.42% 20.94 ms +3.3% -3.58% -0.91%
wpTotal 49.37 ms +10.37% -1.4% 50.48 ms +6.02% -2.3% -2.2%
wpMemoryUsage 7.68 MB +0% -0% 7.65 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 3a8fb0d trunk % Change
timeToFirstByte 46.8 ms +8.97% -2.88% 46.85 ms +6.3% -3.84% -0.11%
largestContentfulPaint 104 ms +3.85% -3.85% 100 ms +4% -2% 4%
lcpMinusTtfb 54.65 ms +3.2% -2.01% 53.7 ms +2.05% -3.91% 1.77%
wpBeforeTemplate 27.39 ms +6.43% -2.99% 27.24 ms +6.72% -3.27% 0.55%
wpTemplate 16.41 ms +6.09% -3.35% 16.02 ms +9.86% -1.06% 2.43%
wpTotal 43.81 ms +8.63% -3.06% 43.85 ms +6.29% -3.65% -0.09%
wpMemoryUsage 6.37 MB +0% -0% 6.34 MB +0% -0% 0.54%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 3a8fb0d trunk % Change
mediaProcessingJpeg 404.43 ms +0.52% -0.91% 402.03 ms +0.1% -1.13% 0.6%
mediaProcessingAvif 6100.9 ms +0.25% -0.08% 6075.66 ms +0.51% -0.33% 0.42%
mediaProcessingJpegToAvif 4227.07 ms +0.05% -0.14% 4181.2 ms +0.28% -0.19% 1.1%

media-upload

Metric 3a8fb0d trunk % Change
jpegUploadProcessing 1428.39 ms +4.3% -1.35% 1430.55 ms +0.74% -1.1% -0.15%
pngUploadProcessing 212.85 ms +3.45% -21.72% 198.44 ms +10.53% -13.03% 7.26%
largeJpegUploadProcessing 1414.98 ms +1.79% -0.78% 1421.49 ms +1.03% -0.73% -0.46%
multipleImageUploadProcessing 1646.04 ms +21.98% -4.61% 2060.96 ms +1.36% -23.09% -20.13%

post-editor

Metric 3a8fb0d trunk % Change
serverResponse 526.41 ms +2.22% -12.55% 515.86 ms +4.05% -1.46% 2.05%
firstPaint 525.18 ms +1.66% -39.4% 277.94 ms +13.35% -5.78% 88.95%
domContentLoaded 1215.29 ms +2.82% -2.18% 1210.35 ms +0.95% -2.85% 0.41%
loaded 1216.53 ms +2.81% -2.18% 1211.4 ms +0.94% -2.85% 0.42%
firstContentfulPaint 532.31 ms +3.83% -1.08% 501.25 ms +4.9% -4.73% 6.2%
firstBlock 3394.23 ms +4.42% -1.27% 3479.08 ms +0.78% -1.44% -2.44%
type 17.7 ms +2.09% -4.29% 18.1 ms +4.7% -3.81% -2.21%
typeWithoutInspector 17.26 ms +5.21% -3.59% 16.62 ms +3.91% -2.35% 3.85%
typeWithTopToolbar 24.11 ms +3.86% -6.01% 23.5 ms +1.7% -2.38% 2.6%
typeContainer 8.53 ms +14.3% -13.25% 8.23 ms +4.37% -12.27% 3.65%
focus 123.09 ms +11.11% -5.91% 117.22 ms +12.86% -6.58% 5.01%
firstFocus 235.28 ms +0% -0% 229.63 ms +0% -0% 2.46%
selectAll 546.51 ms +4.25% -1.39% 537.84 ms +2.83% -1.8% 1.61%
listViewOpen 86.88 ms +5.86% -12.05% 78.76 ms +5.68% -12.91% 10.31%
inserterOpen 41.51 ms +15.63% -5.52% 42.21 ms +13.62% -7.49% -1.66%
inserterHover 12.48 ms +5.93% -10.34% 11.59 ms +7.25% -6.13% 7.68%
inserterSearch 7.97 ms +12.67% -7.65% 8.57 ms +4.43% -12.25% -7%
loadPatterns 649.62 ms +1.97% -2.63% 659.9 ms +1.25% -1.88% -1.56%
wpTotal 516.62 ms +2.12% -12.71% 506.04 ms +3.82% -1.51% 2.09%
wpMemoryUsage 14.71 MB +0% -0% 14.68 MB +0% -0% 0.24%
wpDbQueries 55 +0% -1.82% 55 +0% -1.82% 0%

site-editor

Metric 3a8fb0d trunk % Change
serverResponse 515.65 ms +1.31% -6.21% 508.41 ms +3.48% -4.53% 1.42%
firstPaint 280.17 ms +7.52% -17.12% 297.3 ms +6.28% -12.4% -5.76%
domContentLoaded 1305.31 ms +0.66% -0.51% 1299.15 ms +1.15% -0.56% 0.47%
loaded 1306.59 ms +0.64% -0.5% 1300.3 ms +1.14% -0.55% 0.48%
firstContentfulPaint 509.33 ms +6.27% -19.26% 527.96 ms +2.82% -1.83% -3.53%
firstBlock 4660.45 ms +0.3% -1.62% 4669.04 ms +1.02% -0.51% -0.18%
type 19.17 ms +5.84% -6.42% 19.29 ms +3.68% -5.91% -0.62%
navigate 122.23 ms +9.43% -4.16% 121.88 ms +3.81% -11.66% 0.29%
loadPatterns 1306.53 ms +1.72% -4.06% 1245.32 ms +11.74% -0.36% 4.92%
loadPages 992.34 ms +5.31% -0.85% 962.56 ms +2.86% -2.88% 3.09%
wpTotal 505.67 ms +1.37% -6.13% 498.72 ms +3.58% -4.62% 1.39%
wpMemoryUsage 12.73 MB +0% -0% 12.70 MB +0% -0% 0.24%
wpDbQueries 44 +2.27% -0% 44 +2.27% -0% 0%

ec7d9a7 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.

Backspace in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  -  5
+ Received  + 11

@@ -1,25 +1,31 @@
  Array [
    Object {
      "innerBlocks": Array [
        Object {
          "attributes": Object {
-           "content": "1",
+           "content": "1‸a",
          },
-         "innerBlocks": Array [
+         "innerBlocks": Array [],
+         "name": "core/list-item",
+       },
        Object {
+         "attributes": Object {
+           "content": "2",
+         },
          "innerBlocks": Array [
            Object {
              "attributes": Object {
-                   "content": "a‸2",
+               "ordered": false,
+               "values": "",
              },
-                 "name": "core/list-item",
-               },
+             "innerBlocks": Array [
                Object {
                  "attributes": Object {
                    "content": "b",
                  },
+                 "innerBlocks": Array [],
                  "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:2041:42
Custom Completer: should allow newlines after multiple option completions in /test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

@@ -5,11 +5,11 @@
  <!-- wp:paragraph -->
  <p>🫐 test</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
- <p>🫐 test</p>
+ <p>🍎 test</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
  <p>🫐 test</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js:466:6
Delete (forward) in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  -  2
+ Received  + 25

@@ -1,25 +1,48 @@
  Array [
    Object {
      "innerBlocks": Array [
        Object {
          "attributes": Object {
-           "content": "1",
+           "content": "‸",
          },
          "innerBlocks": Array [
            Object {
+             "attributes": Object {
+               "ordered": false,
+               "values": "",
+             },
              "innerBlocks": Array [
                Object {
                  "attributes": Object {
-                   "content": "a‸2",
+                   "content": "a",
                  },
+                 "innerBlocks": Array [],
                  "name": "core/list-item",
+               },
+             ],
+             "name": "core/list",
            },
+         ],
+         "name": "core/list-item",
+       },
+       Object {
+         "attributes": Object {
+           "content": "2",
+         },
+         "innerBlocks": Array [
            Object {
              "attributes": Object {
+               "ordered": false,
+               "values": "",
+             },
+             "innerBlocks": Array [
+               Object {
+                 "attributes": Object {
                    "content": "b",
                  },
+                 "innerBlocks": Array [],
                  "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:2056:42
List in /test/e2e/specs/editor/blocks/query.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 22
+ Received  +  1

  Array [
    Object {
-     "innerBlocks": Array [
-       Object {
-         "innerBlocks": Array [
-           Object {
-             "name": "core/post-title",
-           },
-           Object {
-             "name": "core/post-featured-image",
-           },
-           Object {
-             "name": "core/post-excerpt",
-           },
-           Object {
-             "name": "core/separator",
-           },
-           Object {
-             "name": "core/post-date",
-           },
-         ],
-         "name": "core/post-template",
-       },
-     ],
+     "innerBlocks": Array [],
      "name": "core/query",
    },
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/query.spec.js:88:42
should create a paragraph block above when pressing enter at the start in /test/e2e/specs/editor/blocks/heading.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 15
+ Received  +  1

- Array [
-   Object {
-     "attributes": Object {
-       "content": "",
-     },
-     "name": "core/paragraph",
-   },
-   Object {
-     "attributes": Object {
-       "content": "a",
-       "level": 2,
-     },
-     "name": "core/heading",
-   },
- ]
+ Array []

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/heading.spec.js:87:41
should cut and paste individual blocks with collapsed selection in /test/e2e/specs/editor/various/copy-cut-paste.spec.js, passed after 1 failed attempt.
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:2170:41
should keep a full selection when outdenting nested items with Shift+Tab in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('role=toolbar[name="Block tools"i]').locator('role=button[name="Indent"]')

    at Editor.clickBlockToolbarButton (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/editor/click-block-toolbar-button.ts:17:15)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:1166:3
should merge a following sibling list into the outermost list with Delete from a nested item (#77245) in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

@@ -8,11 +8,11 @@
          "innerBlocks": Array [
            Object {
              "innerBlocks": Array [
                Object {
                  "attributes": Object {
-                   "content": "b‸",
+                   "content": "b",
                  },
                  "name": "core/list-item",
                },
              ],
              "name": "core/list",
@@ -25,11 +25,11 @@
    },
    Object {
      "innerBlocks": Array [
        Object {
          "attributes": Object {
-           "content": "1",
+           "content": "‸1",
          },
          "innerBlocks": Array [
            Object {
              "innerBlocks": Array [
                Object {

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:2854:41
should multi-select in the ListView component with shift + click in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('treegrid', { name: 'Block navigation structure' }).getByRole('link', { name: 'Paragraph' }).nth(3)

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:1269:29
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
should replace the selection across blocks with an inline image 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": "",
      },
      "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:2372:41
should select by dragging into nested block in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 0

  Array [
    1,
-   2,
  ]

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:568:5
should update the URL from the last navigation if only varies in the URL fragment in /test/e2e/specs/interactivity/router-navigate.spec.ts, passed after 1 failed attempt.
Error: expect(locator).toHaveText(expected) failed

Locator:  getByTestId('title')
Expected: "Link 1"
Received: "Main"
Timeout:  5000ms

Call log:
  - Expect "toHaveText" getByTestId('title') with timeout 5000ms
  - waiting for getByTestId('title')
    14 × locator resolved to <h2 data-testid="title">Main</h2>
       - unexpected value "Main"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigate.spec.ts:160:25
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
shows title and sync status while creating a new synced pattern in the post editor in /test/e2e/specs/editor/various/post-summary/post-summary.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeVisible() failed

Locator: getByRole('dialog', { name: 'Create pattern' })
Expected: visible
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeVisible" getByRole('dialog', { name: 'Create pattern' }) with timeout 5000ms
  - waiting for getByRole('dialog', { name: 'Create pattern' })

    at createPatternFromModal (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/post-summary/post-summary.spec.js:179:26)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/post-summary/post-summary.spec.js:101:4

ec7d9a7 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] Components /packages/components [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant