Align dependency versions across workspaces with Syncpack#77954
Draft
manzoorwanijk wants to merge 2 commits into
Draft
Align dependency versions across workspaces with Syncpack#77954manzoorwanijk wants to merge 2 commits into
manzoorwanijk wants to merge 2 commits into
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: +1.36 kB (+0.02%) Total Size: 7.95 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.
94d444a to
5fb149a
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.
This was referenced May 6, 2026
ciampo
reviewed
May 8, 2026
348da34 to
d1d7b63
Compare
576a4f1 to
bd5efa9
Compare
Member
Author
|
We still need to ship #77992 to unblock this. |
manzoorwanijk
added a commit
that referenced
this pull request
May 8, 2026
Aligns `packages/editor` and `packages/block-editor` with `packages/sync` on `diff@^8.0.3` (needed for the Syncpack alignment work in #77950 / #77954). The bump exposes two unrelated upstream changes that would regress the post-revisions UI: 1. v6+ adds a "deletions before insertions" tie-breaker, so for inputs with multiple equal-length LCSes (whitespace-block pivots, paragraph swaps), `diffArrays` selects a different match than v4 did. The downstream `pairSimilarBlocks` step then mis-pairs blocks and shows two confusing inline diffs instead of a clean modified+unchanged pair. 2. v6+ stops treating whitespace as a token in `diffWords`, coalescing adjacent word changes into one removed/added pair and losing per-word precision in inline rich-text diffs. Fix on the consumer side so existing tests pass without touching any assertion: - Replace the imported `diffArrays` in `block-diff.js` with a local v4-compatible port of `Diff.prototype.diff` (Myers, array+strict-eq), including v4's `(added, removed)` -> `(removed, added)` swap in `buildValues` so condensed sections still render in the right order. - Switch `diffWords` -> `diffWordsWithSpace` for the inline rich-text diff, the `changedAttributes` panel diff, and the `Meta` field diff in `revision-fields-diff`. `preserve-client-ids.js` and `block-compare` (uses `diffChars`) need no changes -- neither hits the affected v6+ behaviours and their tests pass unmodified under v8. 41/41 revision-related unit tests pass; full `npm run test:unit` is green. Closes #77976
d1d7b63 to
b94c172
Compare
`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)"`.
bd5efa9 to
00b8167
Compare
manzoorwanijk
added a commit
that referenced
this pull request
May 21, 2026
Aligns `packages/editor` and `packages/block-editor` with `packages/sync` on `diff@^8.0.3` (needed for the Syncpack alignment work in #77950 / #77954). The bump exposes two unrelated upstream changes that would regress the post-revisions UI: 1. v6+ adds a "deletions before insertions" tie-breaker, so for inputs with multiple equal-length LCSes (whitespace-block pivots, paragraph swaps), `diffArrays` selects a different match than v4 did. The downstream `pairSimilarBlocks` step then mis-pairs blocks and shows two confusing inline diffs instead of a clean modified+unchanged pair. 2. v6+ stops treating whitespace as a token in `diffWords`, coalescing adjacent word changes into one removed/added pair and losing per-word precision in inline rich-text diffs. Fix on the consumer side so existing tests pass without touching any assertion: - Replace the imported `diffArrays` in `block-diff.js` with a local v4-compatible port of `Diff.prototype.diff` (Myers, array+strict-eq), including v4's `(added, removed)` -> `(removed, added)` swap in `buildValues` so condensed sections still render in the right order. - Switch `diffWords` -> `diffWordsWithSpace` for the inline rich-text diff, the `changedAttributes` panel diff, and the `Meta` field diff in `revision-fields-diff`. `preserve-client-ids.js` and `block-compare` (uses `diffChars`) need no changes -- neither hits the affected v6+ behaviours and their tests pass unmodified under v8. 41/41 revision-related unit tests pass; full `npm run test:unit` is green. Closes #77976
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.