@farm.js/react 0.1.0-beta.10 → 0.1.0-beta.12
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/README.md +20 -8
- package/dist/compiler-runtime.cjs +230 -116
- package/dist/compiler-runtime.cjs.map +1 -1
- package/dist/compiler-runtime.mjs +230 -116
- package/dist/compiler-runtime.mjs.map +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/dist/vite.cjs +19 -8
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +19 -8
- package/dist/vite.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -496,7 +496,11 @@ through one document fragment. It then removes only the replaced window. When th
|
|
|
496
496
|
has the same length and the same keys in the same order, Farm prepares every binding read and
|
|
497
497
|
changed DOM target across the complete window first, patches the existing rows in place, and
|
|
498
498
|
updates the stored row objects used by later events. That path creates no descriptors or DOM rows,
|
|
499
|
-
and preserves row identity, focus, and selection.
|
|
499
|
+
and preserves row identity, focus, and selection. Validated same-key row and window refreshes also
|
|
500
|
+
keep the existing row map and element lookup, and skip redundant cache cleanup instead of
|
|
501
|
+
rebuilding whole-list bookkeeping. Source and key validation still run, and each flush commits the
|
|
502
|
+
new collection token for subsequent updates. Structural changes retain index rebuilding and cache
|
|
503
|
+
cleanup. A window may instead grow or shrink while it
|
|
500
504
|
reorders keys from inside its own removed interval and mixes them with globally fresh keys. Farm
|
|
501
505
|
prepares all reused binding updates, new descriptors, binding snapshots, and detached rows before
|
|
502
506
|
the first DOM write. It removes only retired rows, preserves each reused row, batches adjacent new
|
|
@@ -562,12 +566,15 @@ subclassed behavior, structural calls after reordering, an unhinted intermediate
|
|
|
562
566
|
React-owned rows, and failed checks keep complete keyed reconciliation.
|
|
563
567
|
|
|
564
568
|
A compiler-safe `filter()` or bounded `slice()` prefix may precede the native reorder suffix in a
|
|
565
|
-
concise updater or exact one-return block
|
|
569
|
+
concise updater or exact one-return block. A filter predicate may be concise or contain exactly one
|
|
570
|
+
direct value-returning `return`:
|
|
566
571
|
|
|
567
572
|
```tsx
|
|
568
573
|
setItems((current) =>
|
|
569
574
|
current
|
|
570
|
-
.filter((item) =>
|
|
575
|
+
.filter((item) => {
|
|
576
|
+
return item.visible;
|
|
577
|
+
})
|
|
571
578
|
.toSorted((left, right) => left.rank - right.rank)
|
|
572
579
|
.toReversed(),
|
|
573
580
|
);
|
|
@@ -809,17 +816,22 @@ setItems((current) => current.filter((item) => item.id !== removedId));
|
|
|
809
816
|
setItems((current) => {
|
|
810
817
|
return current.filter((item) => item.id !== removedId);
|
|
811
818
|
});
|
|
819
|
+
setItems((current) =>
|
|
820
|
+
current.filter((item) => {
|
|
821
|
+
return item.id !== removedId;
|
|
822
|
+
}),
|
|
823
|
+
);
|
|
812
824
|
```
|
|
813
825
|
|
|
814
826
|
For compiler-owned host rows whose render and key do not observe the row index, Farm validates the
|
|
815
827
|
native filter chain, every surviving item identity, and every surviving key before removing only
|
|
816
828
|
the rejected DOM rows. It does not recreate descriptors or reread bindings for unchanged rows,
|
|
817
829
|
and queued filters compose before one compiler flush. Index-aware rows or predicates, updater blocks
|
|
818
|
-
with extra statements, directives, conditional returns, or no value-returning `return`,
|
|
819
|
-
|
|
820
|
-
React-owned row structures, mixed dirty dependencies, and
|
|
821
|
-
reconciliation. No option or new component is required. The
|
|
822
|
-
count as `keyedArrayFilterHints`.
|
|
830
|
+
with extra statements, directives, conditional returns, or no value-returning `return`, predicate
|
|
831
|
+
blocks with those unsupported shapes, custom filter methods, sparse or subclassed arrays,
|
|
832
|
+
collection-reading bindings or keys, React-owned row structures, mixed dirty dependencies, and
|
|
833
|
+
failed validation use complete keyed reconciliation. No option or new component is required. The
|
|
834
|
+
compiler report exposes the emitted-site count as `keyedArrayFilterHints`.
|
|
823
835
|
|
|
824
836
|
An otherwise eligible host row may also contain an inline synchronous React event:
|
|
825
837
|
|