jotai-state-tree 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jotai-state-tree",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "MobX-State-Tree API compatible library powered by Jotai",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@testing-library/jest-dom": "^6.9.1",
|
|
58
58
|
"@testing-library/react": "^16.3.1",
|
|
59
59
|
"@testing-library/user-event": "^14.6.1",
|
|
60
|
-
"@types/node": "^
|
|
60
|
+
"@types/node": "^22.15.1",
|
|
61
61
|
"@types/react": "^18.2.0",
|
|
62
62
|
"eslint": "^8.55.0",
|
|
63
63
|
"jotai": "^2.6.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"tsup": "^8.0.0",
|
|
69
69
|
"typedoc": "^0.28.15",
|
|
70
70
|
"typescript": "^5.3.0",
|
|
71
|
-
"vitest": "^
|
|
71
|
+
"vitest": "^4.0.16"
|
|
72
72
|
},
|
|
73
73
|
"repository": {
|
|
74
74
|
"type": "git",
|
|
@@ -51,7 +51,7 @@ describe("Performance", () => {
|
|
|
51
51
|
id: `item-${i}`,
|
|
52
52
|
name: `Item ${i}`,
|
|
53
53
|
value: i,
|
|
54
|
-
})
|
|
54
|
+
}),
|
|
55
55
|
);
|
|
56
56
|
|
|
57
57
|
const elapsed = performance.now() - start;
|
|
@@ -192,7 +192,7 @@ describe("Performance", () => {
|
|
|
192
192
|
types.model("Item", {
|
|
193
193
|
id: types.identifier,
|
|
194
194
|
value: types.number,
|
|
195
|
-
})
|
|
195
|
+
}),
|
|
196
196
|
),
|
|
197
197
|
});
|
|
198
198
|
|
|
@@ -280,7 +280,7 @@ describe("Performance", () => {
|
|
|
280
280
|
disposers.push(
|
|
281
281
|
onSnapshot(instance, () => {
|
|
282
282
|
callCount++;
|
|
283
|
-
})
|
|
283
|
+
}),
|
|
284
284
|
);
|
|
285
285
|
}
|
|
286
286
|
|
|
@@ -321,7 +321,7 @@ describe("Performance", () => {
|
|
|
321
321
|
disposers.push(
|
|
322
322
|
onPatch(instance, () => {
|
|
323
323
|
patchCount++;
|
|
324
|
-
})
|
|
324
|
+
}),
|
|
325
325
|
);
|
|
326
326
|
}
|
|
327
327
|
|
|
@@ -395,7 +395,7 @@ describe("Stress Tests", () => {
|
|
|
395
395
|
// Create and destroy many times
|
|
396
396
|
for (let cycle = 0; cycle < 100; cycle++) {
|
|
397
397
|
const instances = Array.from({ length: 100 }, (_, i) =>
|
|
398
|
-
Model.create({ id: `cycle${cycle}-item${i}`, value: i })
|
|
398
|
+
Model.create({ id: `cycle${cycle}-item${i}`, value: i }),
|
|
399
399
|
);
|
|
400
400
|
|
|
401
401
|
instances.forEach((i) => destroy(i));
|
|
@@ -406,7 +406,7 @@ describe("Stress Tests", () => {
|
|
|
406
406
|
// Registry should not have grown
|
|
407
407
|
expect(statsAfter.liveNodeCount).toBe(statsBefore.liveNodeCount);
|
|
408
408
|
expect(statsAfter.identifierRegistrySize).toBe(
|
|
409
|
-
statsBefore.identifierRegistrySize
|
|
409
|
+
statsBefore.identifierRegistrySize,
|
|
410
410
|
);
|
|
411
411
|
});
|
|
412
412
|
|
|
@@ -462,7 +462,7 @@ describe("Stress Tests", () => {
|
|
|
462
462
|
}));
|
|
463
463
|
|
|
464
464
|
const counters = Array.from({ length: 100 }, (_, i) =>
|
|
465
|
-
Counter.create({ id: `counter-${i}`, value: 0 })
|
|
465
|
+
Counter.create({ id: `counter-${i}`, value: 0 }),
|
|
466
466
|
);
|
|
467
467
|
|
|
468
468
|
// Interleaved operations
|
|
@@ -504,7 +504,7 @@ describe("Stress Tests", () => {
|
|
|
504
504
|
disposers.push(
|
|
505
505
|
onSnapshot(instance, () => {
|
|
506
506
|
snapshotCount++;
|
|
507
|
-
})
|
|
507
|
+
}),
|
|
508
508
|
);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
@@ -556,7 +556,7 @@ describe("Stress Tests", () => {
|
|
|
556
556
|
});
|
|
557
557
|
|
|
558
558
|
describe("Identifier Registry Stress", () => {
|
|
559
|
-
it("should handle massive identifier churn", () => {
|
|
559
|
+
it("should handle massive identifier churn", { timeout: 30000 }, () => {
|
|
560
560
|
const Item = types.model("Item", {
|
|
561
561
|
id: types.identifier,
|
|
562
562
|
value: types.number,
|