Skip to content

Releases: Signalium/fetchium

fetchium@0.5.1

Choose a tag to compare

@github-actions github-actions released this 04 Sep 17:23
Immutable release. Only release title and notes can be modified.
78334ff

Patch Changes

  • e5fc04f: Batch parent saves during live array resets. addChildRef/removeChildRef each called save(), and LiveArrayInstance.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 from QueryClient.destroy(). Previously destroy() 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 into EntityStore's private instances map directly.
  • e5fc04f: Reuse a single ParseContext across applyMutationEvent() calls instead of allocating a fresh one (plus two Maps) 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

Choose a tag to compare

@github-actions github-actions released this 13 Aug 22:09
Immutable release. Only release title and notes can be modified.
f8a2fb0

Minor Changes

  • 98cb4e9: Add t.variant(value): a variant tag for union members that share a typename. t.typename keeps establishing entity identity (the [typename, id] cache key); t.variant selects 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.

fetchium@0.4.7

Choose a tag to compare

@github-actions github-actions released this 05 Aug 18:25
Immutable release. Only release title and notes can be modified.
fd98ff6

Patch Changes

  • d22fe02: Route membership events from a query's own config.subscribe into 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, so create/update for an unseen id never inserted and delete never removed. Field updates on rows already present were unaffected, which made the gap silent. Entity __subscribe routing and constrained collections are unchanged.

fetchium@0.4.6

Choose a tag to compare

@github-actions github-actions released this 15 Jun 22:00
a1d45ef

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 an UnknownUnionVariantError (visible, not a swallowed warn) and applies no partial state. Initial load and live updates behave the same.

fetchium@0.4.5

Choose a tag to compare

@github-actions github-actions released this 12 Jun 15:53
512bf9d

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 gcTime was evicted immediately and recreated on resume, dropping its polling interval. GC still runs on genuine teardown.

    This relies on the isPausing flag signalium passes to RelayHooks.deactivate (see Signalium/signalium#242), so the signalium peer requirement is now >=3.0.3 (was >=3.0.1).

fetchium@0.4.4

Choose a tag to compare

@github-actions github-actions released this 04 Jun 22:08
d27da60

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

Choose a tag to compare

@github-actions github-actions released this 22 May 22:10
a2dd9ac

Patch Changes

  • e395061: Fix TopicQuery subscribe/unsubscribe to track consumer-read lifecycle instead of the fetch path. Previously, subscribe never fired when send() short-circuited (pre-fulfilled topic via fulfillTopic, or cache within staleTime), but the consumer's unmount would still call unsubscribe and tear down adapter state that was never registered.
  • c35eee2: Fix useQuery to 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 spurious getConfig.subscribe cleanup while the consumer was still mounted.

fetchium@0.4.2

Choose a tag to compare

@github-actions github-actions released this 20 May 19:33
18536f8

Patch Changes

  • 117531d: Add getTopic() to TopicQuery for parity with getPath() on RESTQuery. The static topic template 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 override getTopic() 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 the topic field. The topic field is now optional, matching path? on RESTQuery. Existing queries that define topic as a static template continue to work unchanged.

fetchium@0.4.1

Choose a tag to compare

@github-actions github-actions released this 18 May 21:02
f99916c

Patch Changes

  • f7aaa5c: Fix reactive getConfig() not reacting to error responses when the response body fails to parse against the result schema. Previously runQuery only called reconcileSubscription after applyData succeeded, so a 404 (or any other status) whose body did not match the entity shape would throw inside parseEntities, skip the reconcile, and leave the running subscriber installed against stale config. The reconcile call is now in a finally block so it fires after every fetch attempt, regardless of whether parsing succeeds.

fetchium@0.4.0

Choose a tag to compare

@github-actions github-actions released this 18 May 15:30
c74c326

Minor Changes

  • 088a23b: Breaking: getConfig() is now memoized via a reactiveSignal instead 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 commonly this.response) silently return stale config after first evaluation, because plain field reads track no signals. To react to new responses, wrap the read in a reactiveSignal thunk that consumes the newly-exposed this.responseNotifier (a Signalium Notifier on the execution context, fired by RESTQueryAdapter after each request): reactiveSignal(() => { this.responseNotifier.consume(); return this.response?.ok; }).value. getConfig() implementations that don't read mutable ctx state continue to work unchanged.