Skip to content

Build: Deduplicate npm dependencies - #82698

Merged
ciampo merged 1 commit into
trunkfrom
codex/dedupe-all-dependencies
Sep 14, 2026
Merged

ciampo merged 1 commit into
trunkfrom
codex/dedupe-all-dependencies

Conversation

@ciampo

@ciampo ciampo commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

What?

Follow-up to #81017.

Deduplicates the full workspace dependency tree, removing 34 package entries and refreshing compatible transitive versions. Updates webpack to ^5.111.0 and removes the temporary exact pin.

Why?

This keeps the full-tree cleanup separate from narrower dependency PRs. Webpack 5.111.0 includes the fix for the production-bundle regression that required the pin.

How?

Regenerates the lockfile from current trunk with npm dedupe. The three direct webpack declarations require the fixed release, including the published @wordpress/scripts dependency. Its changelog records the update.

Also refreshes webpack asset-hash snapshots, removes an obsolete Stylelint suppression, and makes the ConfirmDialog Enter-activation test independent of a brittle Tab sequence.

Testing Instructions

  1. Run npm ci, then npm run build and npm run storybook:build.
  2. Run npm run test:unit:vitest to exercise the deduped dependencies and webpack fixtures. Asset dependencies should remain unchanged; only generated hashes differ.
  3. In a project using the local @wordpress/scripts, run wp-scripts build --experimental-modules with both editorScript and viewScriptModule entries. Both builds should succeed and emit the expected .asset.php dependencies.
Release-age guard

The dedupe command used temporary --min-release-age-exclude=webpack --min-release-age-exclude=schema-utils flags for the newly released packages. The repository's one-day guard is unchanged. Neither exception is needed after September 15 at 06:18:28 UTC.

Testing Instructions for Keyboard

No UI changes. ConfirmDialog tests still verify Enter activation for both actions.

Use of AI Tools

Codex assisted with dependency auditing, implementation, verification, independent self-review, and PR text.

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

📦 Bundle size

Size Change: +2.11 kB (+0.03%)

Total Size: 8.1 MB

📦 View Changed
Filename Size Change
build/modules/block-library/playlist/view.min.js 18.5 kB +91 B (+0.5%)
build/modules/lazy-editor/index.min.js 15.2 kB +96 B (+0.64%)
build/scripts/block-editor/index.min.js 473 kB +71 B (+0.02%)
build/scripts/block-library/index.min.js 364 kB +139 B (+0.04%)
build/scripts/blocks/index.min.js 46.3 kB +840 B (+1.85%)
build/scripts/components/index.min.js 270 kB +518 B (+0.19%)
build/scripts/edit-site/index.min.js 378 kB +87 B (+0.02%)
build/scripts/editor/index.min.js 606 kB +80 B (+0.01%)
build/scripts/media-utils/index.min.js 202 kB +82 B (+0.04%)
build/scripts/rich-text/index.min.js 15.1 kB +104 B (+0.69%)

559f2d3 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric ad784fe trunk % Change
timeToFirstByte 56.25 ms +8.98% -3.82% 59.45 ms +9% -2.52% -5.38%
largestContentfulPaint 96 ms +4.17% -6.25% 98 ms +8.16% -6.12% -2.04%
lcpMinusTtfb 35.7 ms +16.53% -5.88% 35.95 ms +24.76% -7.23% -0.7%
wpBeforeTemplate 28.2 ms +9.11% -3.16% 29.55 ms +12.08% -3.28% -4.57%
wpTemplate 24.32 ms +3.74% -5.06% 25.69 ms +4.32% -3.89% -5.33%
wpTotal 52.57 ms +8.62% -4.07% 55.46 ms +8.85% -1.97% -5.21%
wpMemoryUsage 7.53 MB +0% -0% 7.49 MB +0% -0% 0.46%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric ad784fe trunk % Change
timeToFirstByte 47 ms +6.49% -1.6% 48 ms +4.48% -3.54% -2.08%
largestContentfulPaint 104 ms +0% -3.85% 100 ms +4% -0% 4%
lcpMinusTtfb 54.1 ms +4.62% -0.65% 53.9 ms +2.32% -1.95% 0.37%
wpBeforeTemplate 26.28 ms +5.52% -3.01% 26.19 ms +5.73% -2.41% 0.34%
wpTemplate 17.85 ms +1.74% -1.51% 18.36 ms +2.02% -4.47% -2.78%
wpTotal 43.98 ms +7.09% -1.77% 44.96 ms +4.58% -3.69% -2.18%
wpMemoryUsage 6.15 MB +0% -0% 6.11 MB +0% -0% 0.58%
wpDbQueries 14 +0% -0% 14 +0% -0% 0%

media-processing

Metric ad784fe trunk % Change
mediaProcessingJpeg 394.7 ms +1.14% -0.14% 398.4 ms +0.52% -0.27% -0.93%
mediaProcessingAvif 6038.62 ms +0.13% -0.06% 6070.64 ms +0.26% -0.15% -0.53%
mediaProcessingJpegToAvif 4161.79 ms +0.18% -0.34% 4193.95 ms +0.29% -0.14% -0.77%

media-upload

Metric ad784fe trunk % Change
jpegUploadProcessing 1424.67 ms +6.01% -0.86% 1422.82 ms +0.97% -0.61% 0.13%
pngUploadProcessing 216.48 ms +8.59% -4.54% 213.2 ms +12.87% -2.51% 1.54%
largeJpegUploadProcessing 1412.67 ms +0.75% -0.64% 1408.33 ms +0.66% -0.56% 0.31%
multipleImageUploadProcessing 1590.66 ms +30.31% -2.3% 1592.14 ms +7.55% -1.23% -0.09%

post-editor

Metric ad784fe trunk % Change
serverResponse 471.23 ms +6.33% -5% 509.08 ms +3.79% -4.36% -7.43%
firstPaint 227.68 ms +2.71% -4.88% 255.94 ms +14.07% -5.72% -11.04%
domContentLoaded 1097.19 ms +0.75% -1.78% 1091.05 ms +2.24% -1.78% 0.56%
loaded 1098.35 ms +0.77% -1.79% 1092.44 ms +2.23% -1.8% 0.54%
firstContentfulPaint 441.58 ms +3.33% -6.59% 452.33 ms +4.74% -3.88% -2.38%
firstBlock 3307.27 ms +0.49% -0.96% 3375.91 ms +0.49% -1.8% -2.03%
type 19.51 ms +3.02% -5.23% 23.46 ms +4.18% -6.1% -16.84%
typeWithoutInspector 18.68 ms +8.94% -3.21% 22.68 ms +4.32% -2.78% -17.64%
typeWithTopToolbar 23.64 ms +7.11% -0.85% 25.38 ms +5.24% -4.1% -6.86%
typeContainer 8.96 ms +10.94% -1.56% 9.75 ms +5.74% -5.13% -8.1%
focus 76.8 ms +1.8% -10.18% 82.13 ms +4.58% -2.91% -6.49%
firstFocus 209.83 ms +0% -0% 226.93 ms +0% -0% -7.54%
selectAll 574.88 ms +0.59% -5.29% 547.44 ms +0.49% -3.76% 5.01%
listViewOpen 76.42 ms +4.38% -14.73% 81.81 ms +10.9% -11.54% -6.59%
inserterOpen 25.99 ms +2.81% -12.43% 23.31 ms +16.86% -5.23% 11.5%
inserterHover 4.22 ms +5.69% -6.64% 4.33 ms +5.08% -19.86% -2.54%
inserterSearch 8.23 ms +12.03% -8.75% 8.73 ms +14.78% -7.1% -5.73%
loadPatterns 688.68 ms +4.96% -4.51% 649.36 ms +2.78% -1.43% 6.06%
wpTotal 460.97 ms +6.38% -5.1% 497.45 ms +4.14% -4.15% -7.33%
wpMemoryUsage 13.06 MB +0% -0% 13.03 MB +0% -0% 0.25%
wpDbQueries 54 +0% -1.85% 53.5 +0.93% -0.93% 0.93%

site-editor

Metric ad784fe trunk % Change
serverResponse 308.81 ms +2.6% -9% 281.74 ms +8.69% -2.9% 9.61%
firstPaint 182.77 ms +86.12% -19.02% 181.26 ms +82.62% -15.02% 0.83%
domContentLoaded 835.08 ms +1.45% -2.04% 827.3 ms +1.82% -1.79% 0.94%
loaded 836.01 ms +1.45% -2.04% 828.26 ms +1.8% -1.79% 0.94%
firstContentfulPaint 344.06 ms +2.79% -1.31% 336.74 ms +2.36% -3.06% 2.17%
firstBlock 3056.78 ms +3.28% -0.32% 3050.38 ms +0.39% -1.66% 0.21%
type 16.38 ms +4.21% -2.93% 16.29 ms +1.6% -5.34% 0.55%
navigate 108.09 ms +1.6% -14% 113.02 ms +0.32% -11.52% -4.36%
loadPatterns 991.66 ms +9.46% -7.18% 1001.39 ms +7.21% -7.45% -0.97%
loadPages 1023.16 ms +0.36% -1.87% 1021.51 ms +2.96% -1.22% 0.16%
wpTotal 300.61 ms +2.59% -9.29% 273.23 ms +9.1% -2.9% 10.02%
wpMemoryUsage 12.02 MB +0% -0% 11.98 MB +0% -0% 0.31%
wpDbQueries 44 +0% -2.27% 44 +0% -2.27% 0%

559f2d3 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.

Navigates the items list via UP/DOWN arrow keys in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByLabel('Page Two')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByLabel('Page Two') with timeout 5000ms
  - waiting for getByLabel('Page Two')
    14 × locator resolved to <button type="button" tabindex="-1" aria-pressed="false" id="view-list-0-310-item-wrapper" class="dataviews-view-list__item" aria-labelledby="view-list-0-310-label" aria-describedby="view-list-0-310-description"></button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:146:49
passes the search value in the main inserter when clicking `Browse all` in /test/e2e/specs/editor/various/inserting-blocks.spec.js, passed after 1 failed attempt.
TimeoutError: locator.fill: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('searchbox', { name: 'Search' }).first()

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

559f2d3 Run

@github-actions github-actions Bot added [Package] Components /packages/components [Tool] Dependency Extraction Webpack Plugin /packages/dependency-extraction-webpack-plugin labels Sep 9, 2026
@ciampo ciampo self-assigned this Sep 9, 2026
@ciampo ciampo added the [Type] Code Quality Issues or PRs that relate to code quality label Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made this test more robust to reduce flakiness while testing deduped deps

@ciampo
ciampo marked this pull request as ready for review September 9, 2026 20:28
@ciampo
ciampo requested a review from a team as a code owner September 9, 2026 20:28
@github-actions

github-actions Bot commented Sep 9, 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.

@ciampo
ciampo force-pushed the codex/dedupe-all-dependencies branch from 18e9ddc to f6d9eb3 Compare September 9, 2026 23:22
@github-actions github-actions Bot added [Tool] WP Scripts /packages/scripts [Tool] Readable JS Assets Webpack Plugin /packages/readable-js-assets-webpack-plugin labels Sep 9, 2026
Comment thread syncpack.config.mjs Outdated
Comment thread packages/scripts/package.json Outdated
@ciampo
ciampo force-pushed the codex/dedupe-all-dependencies branch from f6d9eb3 to ce3616e Compare September 10, 2026 08:49
@aduth

aduth commented Sep 10, 2026

Copy link
Copy Markdown
Member

For making deduplication an enforceable, automated task, would it be as simple as adding the dedupe commands somewhere in the static checks steps and trusting the "Check local changes" step to flag the drift?

@manzoorwanijk

Copy link
Copy Markdown
Member

For making deduplication an enforceable, automated task, would it be as simple as adding the dedupe commands

Deduping often results in version drifts which is difficult to handle when those drifts are more engaging - require test updates, type fixes etc.

@aduth

aduth commented Sep 10, 2026

Copy link
Copy Markdown
Member

For making deduplication an enforceable, automated task, would it be as simple as adding the dedupe commands

Deduping often results in version drifts which is difficult to handle when those drifts are more engaging - require test updates, type fixes etc.

But the situations where deduplication would flag something would be one where someone is adding / updating a dependency and may be in the best position to address it at that point?

@manzoorwanijk

Copy link
Copy Markdown
Member

But the situations where deduplication would flag something would be one where someone is adding / updating a dependency and may be in the best position to address it at that point?

Not always. Sometimes a totally unrelated transitive dependency gets drifted, and fixing its effects may be beyond the scope of the current PR.

@manzoorwanijk

Copy link
Copy Markdown
Member

A better solution might be to run dedupe on a schedule and then create a PR from it, and the CI should catch any problematic drifts.

@ciampo
ciampo force-pushed the codex/dedupe-all-dependencies branch from ce3616e to 9737096 Compare September 14, 2026 09:45
@ciampo
ciampo force-pushed the codex/dedupe-all-dependencies branch from 9737096 to 559f2d3 Compare September 14, 2026 09:46
@ciampo

ciampo commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@manzoorwanijk @aduth I updated / rebased the PR to include the latest webpack release, which includes the bugfix we were waiting for.

This PR is now ready for another round of review.

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

This looks good now.

Thank you for waiting for the release.

@ciampo
ciampo enabled auto-merge (squash) September 14, 2026 09:56
@ciampo
ciampo merged commit 0b70e0c into trunk Sep 14, 2026
78 of 79 checks passed
@ciampo
ciampo deleted the codex/dedupe-all-dependencies branch September 14, 2026 10:13
@github-actions github-actions Bot added this to the Gutenberg 24.1 milestone Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Tool] Dependency Extraction Webpack Plugin /packages/dependency-extraction-webpack-plugin [Tool] Readable JS Assets Webpack Plugin /packages/readable-js-assets-webpack-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