Releases: Signalium/fetchium
Release list
fetchium@0.5.1
Patch Changes
- e5fc04f: Batch parent saves during live array resets.
addChildRef/removeChildRefeach calledsave(), andLiveArrayInstance.reset()called them once per item — serializing and persisting the full parent once per child reference update instead of once overall. The entity-apply flow now writes the completed parent a single time, preserving add-before-remove retention. - e5fc04f: Add
EntityStore.clear()and call it fromQueryClient.destroy(). Previouslydestroy()cleared query instances, mutation instances, and every other internal registry, but left the entity map fully populated — a full teardown had no supported way to drop cached entities, forcing consumers to reach intoEntityStore's privateinstancesmap directly. - e5fc04f: Reuse a single
ParseContextacrossapplyMutationEvent()calls instead of allocating a fresh one (plus twoMaps) per event. This path runs once for every entity update received over a live subscription (e.g. SSE), often many times per frame on high-frequency streams.
fetchium@0.5.0
Minor Changes
-
98cb4e9: Add
t.variant(value): a variant tag for union members that share a typename.t.typenamekeeps establishing entity identity (the[typename, id]cache key);t.variantselects which shape a payload parses as, so one entity type can have multiple shapes discriminated by a separate tag field. Parsing and live-collection event routing dispatch on the variant wherever members share a typename.Two behavior changes:
- Unions now throw at definition time when two members share a typename without declaring variants, or collide on a
(typename, variant)pair. Previously the last member silently overwrote the first, so payloads of the other shape failed validation and were dropped from arrays and mutation events. - Live collections whose entity defs share a typename without variants (possible via
t.liveValue, which involves no union) previously checked every event against the last def only; events now route to the first def the entity's data satisfies.
- Unions now throw at definition time when two members share a typename without declaring variants, or collide on a
fetchium@0.4.7
Patch Changes
- d22fe02: Route membership events from a query's own
config.subscribeinto unconstrained live collections in its result. Query subscriptions stamped the query key as the event source, but live collections register under their parent entity's key, socreate/updatefor an unseen id never inserted anddeletenever removed. Field updates on rows already present were unaffected, which made the gap silent. Entity__subscriberouting and constrained collections are unchanged.
fetchium@0.4.6
Patch Changes
- 19a2e7f: Handle unknown union variants instead of silently dropping the whole entity update. An optional union field now degrades to
undefined; a non-optional one surfaces anUnknownUnionVariantError(visible, not a swallowed warn) and applies no partial state. Initial load and live updates behave the same.
fetchium@0.4.5
Patch Changes
-
76df9c4: Paused queries no longer schedule garbage collection, so resuming reuses the cached result instead of refetching. Previously a paused query with a low
gcTimewas evicted immediately and recreated on resume, dropping its polling interval. GC still runs on genuine teardown.This relies on the
isPausingflag signalium passes toRelayHooks.deactivate(see Signalium/signalium#242), so thesignaliumpeer requirement is now>=3.0.3(was>=3.0.1).
fetchium@0.4.4
Patch Changes
- 08950ad: Fix the runtime merge so a discriminated union field is replaced when its variant changes. Previously the merge recursed into the union's typename-keyed shape, which matches no real field, so a changed variant left the old variant's fields in place and the new variant's fields never landed. Union fields are now replaced wholesale.
fetchium@0.4.3
Patch Changes
- e395061: Fix
TopicQuerysubscribe/unsubscribe to track consumer-read lifecycle instead of the fetch path. Previously, subscribe never fired whensend()short-circuited (pre-fulfilled topic viafulfillTopic, or cache withinstaleTime), but the consumer's unmount would still call unsubscribe and tear down adapter state that was never registered. - c35eee2: Fix
useQueryto stabilize thunk identity across re-renders. Without it, signalium allocated a new signal per render, which under some React commit orderings (React 18 / React Native) caused a spuriousgetConfig.subscribecleanup while the consumer was still mounted.
fetchium@0.4.2
Patch Changes
- 117531d: Add
getTopic()toTopicQueryfor parity withgetPath()onRESTQuery. The statictopictemplate only supports fixed-shape topics, so consumers with variable-segment-count or conditionally-shaped topics had to hand-author one query class per shape. Subclasses can now overridegetTopic()to compute the topic dynamically at execution time over the resolved params (e.g.'layout:' + this.params.segments.map(encodeURIComponent).join(':')); when defined it takes precedence over thetopicfield. Thetopicfield is now optional, matchingpath?onRESTQuery. Existing queries that definetopicas a static template continue to work unchanged.
fetchium@0.4.1
Patch Changes
- f7aaa5c: Fix reactive
getConfig()not reacting to error responses when the response body fails to parse against the result schema. PreviouslyrunQueryonly calledreconcileSubscriptionafterapplyDatasucceeded, so a 404 (or any other status) whose body did not match the entity shape would throw insideparseEntities, skip the reconcile, and leave the running subscriber installed against stale config. The reconcile call is now in afinallyblock so it fires after every fetch attempt, regardless of whether parsing succeeds.
fetchium@0.4.0
Minor Changes
- 088a23b: Breaking:
getConfig()is now memoized via areactiveSignalinstead of being recomputed on every fetch; it only re-runs when a signal consumed inside notifies. Existing implementations that read mutable execution-context state directly (most commonlythis.response) silently return stale config after first evaluation, because plain field reads track no signals. To react to new responses, wrap the read in areactiveSignalthunk that consumes the newly-exposedthis.responseNotifier(a SignaliumNotifieron the execution context, fired byRESTQueryAdapterafter each request):reactiveSignal(() => { this.responseNotifier.consume(); return this.response?.ok; }).value.getConfig()implementations that don't read mutable ctx state continue to work unchanged.