chore: upgrade to react@19 (#9182)

This commit is contained in:
David Luzar
2025-02-25 19:18:42 +01:00
committed by GitHub
parent 9ee0b8ffcb
commit 31e8476c78
58 changed files with 2773 additions and 2827 deletions
@@ -80,9 +80,12 @@ const test = <U extends `${string}:${"L" | "R"}`>(
const reconciledIds = reconciled.map((x) => x.id);
const reconciledIndices = reconciled.map((x) => x.index);
expect(target.length).equal(reconciled.length);
expect(reconciledIndices.length).equal(new Set([...reconciledIndices]).size); // expect no duplicated indices
expect(reconciledIds).deep.equal(
expect(target.length).toEqual(reconciled.length);
expect(reconciledIndices.length).toEqual(
new Set([...reconciledIndices]).size,
); // expect no duplicated indices
assert.deepEqual(
reconciledIds,
target.map((uid) => {
const [, id, source] = uid.match(/^(\w+):([LR])$/)!;
const element = (source === "L" ? _local : _remote).find(
@@ -96,13 +99,15 @@ const test = <U extends `${string}:${"L" | "R"}`>(
// convergent reconciliation on the remote client
try {
expect(
assert.deepEqual(
reconcileElements(
cloneJSON(_remote),
cloneJSON(_local as RemoteExcalidrawElement[]),
{} as AppState,
).map((x) => x.id),
).deep.equal(reconciledIds, "convergent reconciliation");
reconciledIds,
"convergent reconciliation",
);
} catch (error: any) {
console.error("local original", _remote);
console.error("remote original", _local);
@@ -111,13 +116,15 @@ const test = <U extends `${string}:${"L" | "R"}`>(
// bidirectional re-reconciliation on remote client
try {
expect(
assert.deepEqual(
reconcileElements(
cloneJSON(_remote),
cloneJSON(reconciled as unknown as RemoteExcalidrawElement[]),
{} as AppState,
).map((x) => x.id),
).deep.equal(reconciledIds, "local re-reconciliation");
reconciledIds,
"local re-reconciliation",
);
} catch (error: any) {
console.error("local original", _remote);
console.error("remote reconciled", reconciled);
@@ -309,7 +316,10 @@ describe("elements reconciliation", () => {
throw new Error("reconcileElements: duplicate elements found");
}
expect(ret.map((x) => x.id)).to.deep.equal(expected);
assert.deepEqual(
ret.map((x) => x.id),
expected,
);
};
// identical id/version/versionNonce/index