Skip to content

Releases

finity-solidjs v0.0.13

Choose a tag to compare

@github-actions github-actions released this 21 Nov 19:02
Immutable release. Only release title and notes can be modified.
2b2add2

New

  • FinityError is exported as a type, alongside InvalidTransitionError. It's the base of every error finity creates, with its subclasses in its namespace: FinityError.InvalidTransitionError. For an instanceof check, import the class from @ghostry/finity-core.

Behavior change

  • The error onInvalidTransition receives is named "@ghostry/finity-core:InvalidTransitionError", where it was "Error".

Compatibility

  • Depends on @ghostry/finity-core 0.0.13 exactly. If you also import from finity-core directly, for noop, never, shallowEqual, or an instanceof check, install 0.0.13 so only one copy is installed.
  • package.json declares engines.node >=20.0.0 and sideEffects: false.

Internal

  • Each finity package has its own version and release, tagged finity-solidjs/vX.Y.Z. Releases up to v0.0.12 covered all three packages under one version.
  • Tests run on bun test.

Docs: FinityError, Installation

finity-reactjs v0.0.13

Choose a tag to compare

@github-actions github-actions released this 21 Nov 19:03
Immutable release. Only release title and notes can be modified.
2b2add2

New

  • FinityError is exported as a type, alongside InvalidTransitionError. It's the base of every error finity creates, with its subclasses in its namespace: FinityError.InvalidTransitionError. For an instanceof check, import the class from @ghostry/finity-core.

Behavior change

  • The error onInvalidTransition receives is named "@ghostry/finity-core:InvalidTransitionError", where it was "Error".

Compatibility

  • Depends on @ghostry/finity-core 0.0.13 exactly. If you also import from finity-core directly, for noop, never, shallowEqual, or an instanceof check, install 0.0.13 so only one copy is installed.
  • package.json declares engines.node >=20.0.0 and sideEffects: false.

Internal

  • Each finity package has its own version and release, tagged finity-reactjs/vX.Y.Z. Releases up to v0.0.12 covered all three packages under one version.
  • Tests run on bun test.

Docs: FinityError, Installation

finity-core v0.0.13

Choose a tag to compare

@github-actions github-actions released this 21 Nov 19:00
Immutable release. Only release title and notes can be modified.
2b2add2

New

  • FinityError is the abstract base of every error finity creates, and its subclasses live in its namespace: FinityError.InvalidTransitionError. instanceof FinityError matches any of them.
    import { FinityError } from "@ghostry/finity-core";
    
    if (error instanceof FinityError.InvalidTransitionError) {
      report(error.reason, error.state.to.kind);
    }
    • The top-level InvalidTransitionError export is deprecated. It's the same class as FinityError.InvalidTransitionError, so existing imports and instanceof checks keep working.

Behavior change

  • An InvalidTransitionError's .name is "@ghostry/finity-core:InvalidTransitionError", where it was "Error". The name identifies the error where instanceof can't: across two installed copies of finity-core, or after the error is serialized.

Compatibility

  • onInvalidTransition's parameter is typed FinityError.InvalidTransitionError, the same class as before.
  • package.json declares engines.node >=20.0.0 and sideEffects: false.

Internal

  • Each finity package has its own version and release, tagged finity-core/vX.Y.Z. Releases up to v0.0.12 covered all three packages under one version.

Docs: FinityError, FinityError.InvalidTransitionError, Public API

v0.0.12

Choose a tag to compare

@github-actions github-actions released this 18 Nov 01:52
Immutable release. Only release title and notes can be modified.
3e84872

Fixes

  • Types resolve for consumers on moduleResolution: node16 or nodenext. The published declarations imported their sibling files without an extension, which those modes reject for an ESM package. Under skipLibCheck: true there was no error: every export was silently typed as any. Every relative import in dist/types now names its file.

Internal

  • The build type-checks the emitted declarations, so a broken dist/types fails the build instead of shipping.

v0.0.11

Choose a tag to compare

@github-actions github-actions released this 27 Oct 22:06
Immutable release. Only release title and notes can be modified.
5d08de3

New

  • isEqualState is an option of initialize. A transition to a state of the same kind that it considers equal is skipped: the state isn't set, so effects and renders don't run again, and the transition you called stays valid. It compares the states without their transition property, and defaults to shallowEqual, which is also exported.
  • @ghostry/finity-solidjs: a case can return a function to render reactively, as in (state) => () => state.kind.

Fixes

  • A state's identity changes only when it is set. value() returned a new object on every call, which made memos and effects that depend on the state run again needlessly.
  • A transition from an earlier render is rejected as stale once a later render has changed the state. Transitions are also checked against the latest state, not the snapshot of the render that created them. In React, that snapshot can be out of date.
  • @ghostry/finity-reactjs: useRender uses the current render's case functions. It memoized the case on the state, so a case kept the values its first render closed over.
  • @ghostry/finity-solidjs: a case renders once when it starts to match, not again on every state change. While it matches, the state it receives reads the latest values, so a transition within the case updates what it rendered. Once it no longer matches, the state keeps its last values, so a late transition is rejected as stale.

Behavior change

  • A transition to an equal state of the same kind does nothing.
  • @ghostry/finity-reactjs and @ghostry/finity-solidjs pass every option to the core package, not only onInvalidTransition.

For integration authors

  • ExhaustiveSwitch takes a fourth type parameter, F, for what a case's function may return. It defaults to R, the result of use.

Docs: Equal states, Rendering, Solid

v0.0.10

Choose a tag to compare

@github-actions github-actions released this 02 Sep 14:55
Immutable release. Only release title and notes can be modified.
951ef6b

Fixes

  • UsingTransitionalState and UsingStrictlyTransitionalState are exported again, from all three packages. They give the type of a used state from its definition.
    type State = UsingStrictlyTransitionalState<typeof State>;

v0.0.9

Choose a tag to compare

@github-actions github-actions released this 01 Sep 14:44
Immutable release. Only release title and notes can be modified.
23faf4d

Fixes

  • require() no longer points at CommonJS files that don't exist. The packages are ES modules only, and package.json no longer declares main or a require condition.
  • @ghostry/finity-reactjs and @ghostry/finity-solidjs re-export the core types again: Config, ExhaustiveSwitch, ExhaustiveSwitchInstance, Getter, InvalidTransitionError, Setter, TransitionalState, and TransitionalStates.

v0.0.8

Choose a tag to compare

@github-actions github-actions released this 18 Jul 23:33
Immutable release. Only release title and notes can be modified.
c5fba34

Compatibility

  • Published to JSR again, after 0.0.5. Every exported function declares its return type, which JSR requires.

Internal

  • UseStrictlyTransitionalStateHook names the type of the useStrictlyTransitionalState hook.

v0.0.7

Choose a tag to compare

@github-actions github-actions released this 18 Jul 23:25
Immutable release. Only release title and notes can be modified.
244e200

Breaking changes

  • @ghostry/finity-core exports only its public API. That's initialize, never, noop, InvalidTransitionError, ExhaustiveSwitchInstance, and the types Config, Getter, Setter, ExhaustiveSwitch, TransitionalState, TransitionalStates, and Initialized. Its internal types are no longer exported. UsingTransitionalState and UsingStrictlyTransitionalState return in 0.0.10.
  • @ghostry/finity-reactjs and @ghostry/finity-solidjs no longer re-export the core package's types. Import them from @ghostry/finity-core until 0.0.9 restores them.

Compatibility

  • Not published to JSR. JSR goes from 0.0.5 to 0.0.8.

Internal

  • Every exported symbol has a doc comment.

v0.0.6

Choose a tag to compare

@github-actions github-actions released this 01 Jul 04:23
Immutable release. Only release title and notes can be modified.
485ef91

Breaking changes

  • The packages ship ES modules only. The CommonJS and UMD builds are removed, along with source maps. The require condition in package.json still points at the removed CommonJS build, so require() fails until 0.0.9.

Compatibility

  • Not published to JSR. JSR goes from 0.0.5 to 0.0.8.