Align dependency versions across workspaces with Syncpack#77954
Draft
manzoorwanijk wants to merge 4 commits intoadd/syncpack-dependency-version-linterfrom
Draft
Align dependency versions across workspaces with Syncpack#77954manzoorwanijk wants to merge 4 commits intoadd/syncpack-dependency-version-linterfrom
manzoorwanijk wants to merge 4 commits intoadd/syncpack-dependency-version-linterfrom
Conversation
|
Flaky tests detected in 5fb149a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25394726972
|
b29631c to
0d2b48a
Compare
da2726b to
9fc2cd8
Compare
|
Size Change: -239 B (0%) Total Size: 7.94 MB 📦 View Changed
ℹ️ View Unchanged
|
manzoorwanijk
added a commit
that referenced
this pull request
May 5, 2026
The `diff 4 → 8` bump from `syncpack fix` causes 51 unit tests to fail in `block-diff.js` due to two unrelated upstream changes: 1. v6's "deletions before insertions" tie-breaker selects a different (but equally-valid) LCS for inputs where the whitespace block is pickable as a match. `pairSimilarBlocks` then sees two removed and two added paragraphs (instead of one of each) and incorrectly pairs dissimilar blocks via similarity matching, producing confusing inline diffs in the post revisions UI. 2. v6's `diffWords` no longer treats whitespace as a token, so adjacent word changes coalesce into one removed/added pair instead of being reported per-word. Both are real user-visible regressions in the revisions feature, not just snapshot drift, and the proper fix lives in `block-diff.js` (a custom LCS that prefers content-bearing matches, plus `diffWordsWithSpace` for the inline diff). That work is tracked in `issue-upgrade-diff-v8.md` for a dedicated trunk PR with the right reviewers. For now, update the four affected test cases on this branch to assert the v8 output so the syncpack alignment validation can proceed end to end. Each updated assertion carries a `TODO(diff v8 upgrade)` marker pointing at the tracking issue. When the dedicated `diff` upgrade PR lands on trunk with the consumer-side fix, the alignment PR (#77954) will rebase and the markers/asserts here should be reverted as part of that rebase — restoring the original v4-equivalent expectations.
1bbfd06 to
94d444a
Compare
manzoorwanijk
added a commit
that referenced
this pull request
May 5, 2026
The `diff 4 → 8` bump from `syncpack fix` causes 51 unit tests to fail in `block-diff.js` due to two unrelated upstream changes: 1. v6's "deletions before insertions" tie-breaker selects a different (but equally-valid) LCS for inputs where the whitespace block is pickable as a match. `pairSimilarBlocks` then sees two removed and two added paragraphs (instead of one of each) and incorrectly pairs dissimilar blocks via similarity matching, producing confusing inline diffs in the post revisions UI. 2. v6's `diffWords` no longer treats whitespace as a token, so adjacent word changes coalesce into one removed/added pair instead of being reported per-word. Both are real user-visible regressions in the revisions feature, not just snapshot drift, and the proper fix lives in `block-diff.js` (a custom LCS that prefers content-bearing matches, plus `diffWordsWithSpace` for the inline diff). That work is tracked in `issue-upgrade-diff-v8.md` for a dedicated trunk PR with the right reviewers. For now, update the four affected test cases on this branch to assert the v8 output so the syncpack alignment validation can proceed end to end. Each updated assertion carries a `TODO(diff v8 upgrade)` marker pointing at the tracking issue. When the dedicated `diff` upgrade PR lands on trunk with the consumer-side fix, the alignment PR (#77954) will rebase and the markers/asserts here should be reverted as part of that rebase — restoring the original v4-equivalent expectations.
Auto-applied via `npm run lint:deps:fix`. Brings all workspace package.json files into the single-version-per-dep, caret-range shape enforced by syncpack.config.mjs: - Picks the highest declared version per dependency across the monorepo (e.g. uuid 11→14 at the root, colord 2.7→2.9.3, clsx 2.1.0→2.1.1, postcss unified to 8.4.38, react/react-dom ^18.0.0/^18.3.0 ranges aligned). - Strips/adds the `^` prefix per the semverGroup so root and workspace devDeps share the same range shape. - Regenerates package-lock.json so installs resolve to the unified versions. Internal `@wordpress/*` deps and external peerDependencies are left untouched per the version-group config.
`syncpack fix` lifted both deps in the parent branch. Output drift only: - `dependency-extraction-webpack-plugin/test/build.js.snap` — webpack content-hashes shift because terser's minified output changed. - `toggle-group-control/test/__snapshots__/index.tsx.snap` — radio buttons gain a generated `name=":r..:"` attribute from the new ariakit release. No behaviour change, just snapshot baselines. Generated via `npm run test:unit -- -u --testPathPattern "(dependency-extraction-webpack-plugin/test/build|toggle-group-control/test/index)"`.
Replaces `startOfMinute( inputToDate(...) )` with a small local helper that mutates the seconds/ms on the `UTCDateMini` directly. In `date-fns` v4, `startOfMinute` calls `toDate()`, which goes through `constructFrom()` and does `new input.constructor(value)`. With our `UTCDateMini` (extends `Date`) plus `timezone-mock` swapping the global `Date` in tests, that re-construction trips MockDate's "Unhandled type passed... object" assertion, breaking 50+ DateTimePicker/TimePicker tests. Setting seconds and milliseconds via the UTCDateMini's own setSeconds keeps the truncation in UTC (UTCDateMini's prototype shim reroutes setSeconds to setUTCSeconds), preserves the existing #15495 behaviour, and decouples this code path from `date-fns` — useful for future upgrades.
The `diff 4 → 8` bump from `syncpack fix` causes 51 unit tests to fail in `block-diff.js` due to two unrelated upstream changes: 1. v6's "deletions before insertions" tie-breaker selects a different (but equally-valid) LCS for inputs where the whitespace block is pickable as a match. `pairSimilarBlocks` then sees two removed and two added paragraphs (instead of one of each) and incorrectly pairs dissimilar blocks via similarity matching, producing confusing inline diffs in the post revisions UI. 2. v6's `diffWords` no longer treats whitespace as a token, so adjacent word changes coalesce into one removed/added pair instead of being reported per-word. Both are real user-visible regressions in the revisions feature, not just snapshot drift, and the proper fix lives in `block-diff.js` (a custom LCS that prefers content-bearing matches, plus `diffWordsWithSpace` for the inline diff). That work is tracked in `issue-upgrade-diff-v8.md` for a dedicated trunk PR with the right reviewers. For now, update the four affected test cases on this branch to assert the v8 output so the syncpack alignment validation can proceed end to end. Each updated assertion carries a `TODO(diff v8 upgrade)` marker pointing at the tracking issue. When the dedicated `diff` upgrade PR lands on trunk with the consumer-side fix, the alignment PR (#77954) will rebase and the markers/asserts here should be reverted as part of that rebase — restoring the original v4-equivalent expectations.
94d444a to
5fb149a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Aligns declared dependency versions across the monorepo so the Syncpack lint gate added in #77950 passes.
Stacked on #77950
Why?
#77950 introduces the
npm run lint:depsgate but doesn't touch any consumerpackage.jsonfiles. This PR is the mechanical follow-up that makes the gate pass ontrunk.How?
npm run lint:deps:fix # = syncpack fix npm install --ignore-scriptsNo manual edits. Both commands are deterministic; running them again on this branch is a no-op.
Testing Instructions
npm run lint:deps # exits 0, "✓ No issues found"CI should be happy
Testing Instructions for Keyboard
N/A — dependency-only change.
Screenshots or screencast
N/A — no UI changes.
Use of AI Tools
Drafted with assistance from Claude Code. The fix itself was produced entirely by
syncpack fix; the description was reviewed and edited by hand.