Skip to content

RichText: Remove dead exports and consolidate deprecations - #83461

Merged
Mamaduka merged 1 commit into
trunkfrom
remove/block-editor-private-rich-text
Sep 24, 2026
Merged

Mamaduka merged 1 commit into
trunkfrom
remove/block-editor-private-rich-text

Conversation

@Mamaduka

Copy link
Copy Markdown
Member

What?

Removes the unused PrivateRichText private API and the dead createLinkInParagraph util, moves the onSplit deprecation into withDeprecations, and breaks the content.jsx / index.jsx import cycle. No user-visible change.

Why?

PrivateRichText existed so Caption could pass readOnly (#58916); its last consumer was dropped in #74771. createLinkInParagraph was React Native only (#35204) and lost its caller in #78747.

How?

All deprecated prop handling (array value, multiline, onSplit) now sits in withDeprecations. isEmpty moves to utils.jsx, so content.jsx no longer imports the component from ./. withDeprecations keeps its forwardRef since @wordpress/element still supports React 18.

Testing Instructions

  1. Open a post or page.
  2. Insert a Paragraph block, type text, and press Enter. A new paragraph is created.
  3. Insert an Image block, add a caption, and press Enter at its end. A paragraph is inserted after the image.

@Mamaduka Mamaduka self-assigned this Sep 23, 2026
@Mamaduka Mamaduka added the [Type] Code Quality Issues or PRs that relate to code quality label Sep 23, 2026
@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label Sep 23, 2026
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

📦 Bundle size

Size Change: -57 B (0%)

Total Size: 8.22 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 505 kB -57 B (-0.01%)

059728e Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 09d9ca9 trunk % Change
timeToFirstByte 58.1 ms +9.38% -5.59% 55.7 ms +3.05% -2.6% 4.31%
largestContentfulPaint 94 ms +8.51% -6.38% 92 ms +4.35% -4.35% 2.17%
lcpMinusTtfb 34.4 ms +6.98% -3.05% 34.6 ms +20.09% -3.9% -0.58%
wpBeforeTemplate 28.16 ms +18.11% -2.84% 27.05 ms +6.54% -0.81% 4.1%
wpTemplate 24.49 ms +2.9% -3.92% 23.62 ms +5.5% -3.73% 3.68%
wpTotal 54.3 ms +8.08% -6.1% 51.74 ms +3.03% -2.57% 4.95%
wpMemoryUsage 7.61 MB +0% -0% 7.57 MB +0% -0% 0.51%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric 09d9ca9 trunk % Change
timeToFirstByte 40.55 ms +5.92% -1.97% 45.05 ms +9.43% -1% -9.99%
largestContentfulPaint 88 ms +6.82% -0% 100 ms +4% -0% -12%
lcpMinusTtfb 48.1 ms +1.35% -1.35% 54.8 ms +1.09% -1% -12.23%
wpBeforeTemplate 24.11 ms +1.91% -2.41% 23.72 ms +5.94% -0.97% 1.64%
wpTemplate 13.43 ms +3.13% -0.74% 18.13 ms +2.7% -1.54% -25.92%
wpTotal 37.72 ms +6.1% -2.6% 41.9 ms +9.47% -1.07% -9.98%
wpMemoryUsage 6.09 MB +0% -0% 6.19 MB +0% -0% -1.64%
wpDbQueries 10 +0% -0% 14 +0% -0% -28.57%

media-processing

Metric 09d9ca9 trunk % Change
mediaProcessingJpeg 413.09 ms +0.71% -0.63% 409.09 ms +0.73% -0.94% 0.98%
mediaProcessingAvif 6206 ms +0.22% -0.13% 6135.38 ms +0.36% -0.17% 1.15%
mediaProcessingJpegToAvif 4310.67 ms +0.07% -0.25% 4304.01 ms +0.07% -0.23% 0.15%

media-upload

Metric 09d9ca9 trunk % Change
jpegUploadProcessing 1686.18 ms +15.38% -14.9% 1412.45 ms +0.73% -0.5% 19.38%
pngUploadProcessing 200.31 ms +7.02% -13.97% 190.03 ms +7.8% -9.71% 5.41%
largeJpegUploadProcessing 1407.33 ms +1.33% -0.75% 1410.53 ms +0.27% -0.68% -0.23%
multipleImageUploadProcessing 1555.93 ms +0.67% -0.12% 1549.85 ms +1.42% -0.21% 0.39%

post-editor

Metric 09d9ca9 trunk % Change
serverResponse 393.19 ms +7.39% -5.05% 416.79 ms +4.71% -6.61% -5.66%
firstPaint 202.6 ms +18.27% -18.27% 194.12 ms +23% -6.4% 4.37%
domContentLoaded 1089.38 ms +1.36% -2.14% 1077.11 ms +2.47% -0.56% 1.14%
loaded 1090.59 ms +1.35% -2.15% 1078.42 ms +2.46% -0.57% 1.13%
firstContentfulPaint 457.44 ms +7.89% -3.93% 452.27 ms +5.03% -2.9% 1.14%
firstBlock 3143.81 ms +4.69% -1.63% 3128.65 ms +1.11% -0.68% 0.48%
type 18.12 ms +1.71% -7.23% 18.56 ms +3.5% -3.72% -2.37%
typeWithoutInspector 17.19 ms +8.67% -2.09% 17.55 ms +3.87% -3.53% -2.05%
typeWithTopToolbar 22.87 ms +3.19% -3.98% 23.42 ms +2.05% -6.92% -2.35%
typeContainer 8.68 ms +3.69% -8.53% 8.73 ms +6.3% -11% -0.57%
focus 67.86 ms +1.34% -6.97% 70.28 ms +3.69% -4.68% -3.44%
firstFocus 198.73 ms +0% -0% 204.29 ms +0% -0% -2.72%
selectAll 489.91 ms +5.48% -0.94% 487.22 ms +2.33% -2.61% 0.55%
listViewOpen 60.31 ms +4.08% -10.18% 56.44 ms +12.24% -3.63% 6.86%
inserterOpen 23.03 ms +16.76% -3.78% 23.06 ms +4.25% -1.52% -0.13%
inserterHover 2.01 ms +14.43% -3.98% 2.3 ms +6.96% -9.13% -12.61%
inserterSearch 8 ms +5.5% -3.37% 8.37 ms +11.95% -4.54% -4.42%
loadPatterns 617.97 ms +4.39% -2.06% 654.94 ms +3.35% -3.68% -5.64%
wpTotal 382.4 ms +7.55% -5.27% 405.45 ms +4.77% -6.82% -5.69%
wpMemoryUsage 13.14 MB +0% -0% 13.11 MB +0% -0% 0.28%
wpDbQueries 54 +0% -1.85% 54 +0% -1.85% 0%

site-editor

Metric 09d9ca9 trunk % Change
serverResponse 489.59 ms +5.09% -3.11% 466.84 ms +6.44% -3.21% 4.87%
firstPaint 250.85 ms +16.1% -4.62% 236.35 ms +14.45% -11.05% 6.13%
domContentLoaded 1145.92 ms +1.22% -1.51% 1128.63 ms +1.27% -0.67% 1.53%
loaded 1147.2 ms +1.19% -1.52% 1129.83 ms +1.27% -0.69% 1.54%
firstContentfulPaint 456.55 ms +3.04% -1.84% 445.96 ms +2.37% -3.08% 2.37%
firstBlock 4165.13 ms +0.66% -0.7% 4097.26 ms +0.84% -0.62% 1.66%
type 18.67 ms +3.16% -5.52% 18.55 ms +4.42% -4.8% 0.65%
navigate 119.07 ms +8.08% -8.54% 110.4 ms +7.47% -3.53% 7.85%
loadPatterns 1356.11 ms +12.21% -5.46% 1279.05 ms +10.31% -4.37% 6.02%
loadPages 1061.01 ms +1.08% -1.4% 1061.05 ms +2.87% -1.04% 0%
wpTotal 479.7 ms +5.22% -3.05% 457.32 ms +6.44% -3.39% 4.89%
wpMemoryUsage 12.11 MB +0% -0% 12.09 MB +0% -0% 0.13%
wpDbQueries 43 +2.33% -0% 43 +2.33% -0% 0%

059728e Run

🏁 Flaky tests

Show the failures

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 button allows the block to switch from legacy mode to editable mode in /test/e2e/specs/editor/blocks/comments.spec.js, passed after 1 failed attempt.
Error: apiRequestContext.fetch: socket hang up
Call log:
  - → GET http://localhost:8889/wp-json/wp/v2/comments?per_page=100&status=all&type=comment
    - user-agent: Playwright/1.63.0 (x64; ubuntu 24.04) node/24.18 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - X-WP-Nonce: 338096c077
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_23778236db82f19306f247e20a353a99=admin%7C1790362231%7CcrfQGyQS1EreFN67HNZaK7ZOS3vIjxNzmndiRq8OtUo%7C08a9c86deb32382842353973091a82aeb90267ec4439c3bef931dcc51956027b; wp-settings-time-1=1790189475

    at RequestUtils.rest (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/rest.ts:112:39)
    at RequestUtils.deleteAllComments (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/comments.ts:54:30)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/comments.spec.js:35:22
does not show the notice when the autosave content is already in the shared document in /test/e2e/specs/editor/collaboration/collaboration-autosave-notice-suppression.spec.ts, passed after 1 failed attempt.
Error: apiRequestContext.fetch: socket hang up
Call log:
  - → GET http://localhost:8889/wp-json/wp/v2/posts/34/autosaves?context=edit
    - user-agent: Playwright/1.63.0 (x64; ubuntu 24.04) node/24.18 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - X-WP-Nonce: 338096c077
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_23778236db82f19306f247e20a353a99=admin%7C1790362231%7CcrfQGyQS1EreFN67HNZaK7ZOS3vIjxNzmndiRq8OtUo%7C08a9c86deb32382842353973091a82aeb90267ec4439c3bef931dcc51956027b; wp-settings-time-1=1790189517

    at RequestUtils.rest (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/rest.ts:112:39)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-autosave-notice-suppression.spec.ts:102:40

059728e Run

@Mamaduka
Mamaduka merged commit d1969ff into trunk Sep 24, 2026
84 of 85 checks passed
@Mamaduka
Mamaduka deleted the remove/block-editor-private-rich-text branch September 24, 2026 03:53
@github-actions github-actions Bot added this to the Gutenberg 24.2 milestone Sep 24, 2026

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.

Minor: This pull request removed the last bit of JSX syntax from this file and we could have renamed it to .js. As part of #80123, I considered future expansion to the rule to help detect this. Though in this case, it likely would not have surfaced as a distinct error since the rule was already being suppressed in suppressions.json.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, @aduth!

Here's the follow-up PR - #83758.

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 [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants