Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zurfyx
requested review from
acywatson,
etrepum,
ivailop7 and
potatowagon
as code owners
October 29, 2026 23:35
lexical
@lexical/a11y
@lexical/clipboard
@lexical/code
@lexical/code-core
@lexical/code-prism
@lexical/code-shiki
@lexical/compiler
@lexical/devtools-core
@lexical/dragon
@lexical/eslint-plugin
@lexical/extension
@lexical/fast-check
@lexical/file
@lexical/hashtag
@lexical/headless
@lexical/history
@lexical/html
@lexical/internal
@lexical/link
@lexical/list
@lexical/mark
@lexical/markdown
@lexical/mdast
@lexical/offset
@lexical/overflow
@lexical/plain-text
@lexical/react
@lexical/rich-text
@lexical/selection
@lexical/table
@lexical/tailwind
@lexical/text
@lexical/utils
@lexical/y
@lexical/yjs
commit: |
…group's fields
## Description
Where an item is new to its group (or this write made its marker anew), the writer copies the group's fields it does not own from another item of the group, so that a field a newer client stored is not lost. Finding that source was split over `$markerAsStored` (the nearest item that kept its stored marker, inline) and `$priorGroupItem` (the three fallbacks: the line itself as it was before this write, the nearest item as it was, any item the group had), each documented in a different place.
This makes it one method, `$groupSource`, that tries the four sources in order and documents the order and why it matters: a single nearest-item rule takes another source where a group moves or its items are replaced, and stores other values of the fields (seen with probes: moving a whole group would store `[B,A,B]` instead of `[A,B,C]`, and replacing all its items would drop them). The code of each step is unchanged.
## Changeset
None: internal refactor, no behavior change.
## Test plan
Every gate compares this branch with `main` (`0823b74e`) on the same machine.
### Before
`main`: golden corpus and Doc-bytes capture recorded (twice for the capture, to find tests whose bytes vary between runs), full unit suite and extended fuzz as listed under After.
### After
Stored bytes over fuzz seeds: a scratch recorder (not committed) runs fuzz scripts and hashes, per seed and peer, the Yjs state bytes, the editor JSON, the warnings, the selection and the node map.
```
bid: 1000 seeds, 0 differ
bidmoves: 600 seeds, 0 differ
gc: 1000 seeds, 0 differ
keys: 600 seeds, 0 differ
long: 400 seeds, 0 differ
moves: 1500 seeds, 0 differ
nomove: 3000 seeds, 0 differ
GOLD IDENTICAL
```
Stored bytes over the test corpus: every `@lexical/y` unit test (the saved fuzz scripts in `__tests__/fuzz/` included) run with a setup file that gives each `Y.Doc` a deterministic client id and hashes its state bytes after the test.
```
tests: 7286; stable across base runs: 7047 (7024 with docs, 67564 docs); unstable: 239
new run: 7286 tests; missing from new: 0; stable tests whose bytes differ: 0
CAP IDENTICAL
```
`pnpm run ci-check`:
```
Found 0 errors
```
`vitest --project unit --project scripts-unit` (36 workers), per test against `main`:
```
base {'passed': 18179, 'skipped': 6, 'failed': 1}
new {'passed': 18177, 'skipped': 7, 'failed': 3}
missing 0, added 1, status changed 2
CHANGED passed -> failed FollowUpCheckCost.test.ts, ServerScale.test.ts (timing thresholds)
```
(The added skipped test is the scratch recorder.) The failures are timing or heap thresholds under 36 parallel workers (`DisposeMemory` on both sides, `FollowUpCheckCost` and `ServerScale` here); run alone, they pass:
```
npx vitest run --project unit ServerScale.test.ts DisposeMemory.test.ts FollowUpCheckCost.test.ts
Tests 5 passed (5)
```
Extended fuzz, same results as `main`: `Fuzz.test.ts` seeds 1 to 3000 (gc 1000) and 1 to 1000 with block ids, `ConcurrentShapesFuzz` 600 seeds, `FollowUpFuzz` 1000 seeds, `NestedFuzz`, `SlotsFuzz`, `BlockIdFuzzSeeds` and `FuzzReplay` pass. Seed 2277 fails with `dup` on `main` and on this branch alike (outside the default 300 seeds; not caused by this change).
Browser and e2e tests were not run locally (GitHub CI runs them).
zurfyx
force-pushed
the
zurfyx/y-group-field-source
branch
from
October 29, 2026 23:51
6105bfb to
aac803b
Compare
This branch was successfully deployed
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.
Description
Where an item is new to its group (or this write made its marker anew), the writer copies the group's fields it does not own from another item of the group, so that a field a newer client stored is not lost. Finding that source was split over
$markerAsStored(the nearest item that kept its stored marker, inline) and$priorGroupItem(the three fallbacks: the line itself as it was before this write, the nearest item as it was, any item the group had), each documented in a different place.This makes it one method,
$groupSource, that tries the four sources in order and documents the order and why it matters: a single nearest-item rule takes another source where a group moves or its items are replaced, and stores other values of the fields (seen with probes: moving a whole group would store[B,A,B]instead of[A,B,C], and replacing all its items would drop them). The code of each step is unchanged.Changeset
None: internal refactor, no behavior change.
Test plan
Every gate compares this branch with
main(0823b74e) on the same machine.Before
main: golden corpus and Doc-bytes capture recorded (twice for the capture, to find tests whose bytes vary between runs), full unit suite and extended fuzz as listed under After.After
Stored bytes over fuzz seeds: a scratch recorder (not committed) runs fuzz scripts and hashes, per seed and peer, the Yjs state bytes, the editor JSON, the warnings, the selection and the node map.
Stored bytes over the test corpus: every
@lexical/yunit test (the saved fuzz scripts in__tests__/fuzz/included) run with a setup file that gives eachY.Doca deterministic client id and hashes its state bytes after the test.pnpm run ci-check:vitest --project unit --project scripts-unit(36 workers), per test againstmain:(The added skipped test is the scratch recorder.) The failures are timing or heap thresholds under 36 parallel workers (
DisposeMemoryon both sides,FollowUpCheckCostandServerScalehere); run alone, they pass:Extended fuzz, same results as
main:Fuzz.test.tsseeds 1 to 3000 (gc 1000) and 1 to 1000 with block ids,ConcurrentShapesFuzz600 seeds,FollowUpFuzz1000 seeds,NestedFuzz,SlotsFuzz,BlockIdFuzzSeedsandFuzzReplaypass. Seed 2277 fails withduponmainand on this branch alike (outside the default 300 seeds; not caused by this change).Browser and e2e tests were not run locally (GitHub CI runs them).