Changelog
for @ghostry/finity-solidjs
Every release of @ghostry/finity-solidjs, newest first. Releases up to v0.0.12 covered all three finity packages under one version.
v0.0.13
New
FinityErroris exported as a type, alongsideInvalidTransitionError. It's the base of every error finity creates, with its subclasses in its namespace:FinityError.InvalidTransitionError. For aninstanceofcheck, import the class from@ghostry/finity-core.
Behavior change
- The error
onInvalidTransitionreceives is named"@ghostry/finity-core:InvalidTransitionError", where it was"Error".
Compatibility
- Depends on
@ghostry/finity-core0.0.13 exactly. If you also import from finity-core directly, fornoop,never,shallowEqual, or aninstanceofcheck, install 0.0.13 so only one copy is installed. package.jsondeclaresengines.node>=20.0.0andsideEffects: false.
Internal
- Each finity package has its own version and release, tagged
finity-solidjs/vX.Y.Z. Releases up tov0.0.12covered all three packages under one version. - Tests run on
bun test.
Docs: FinityError, Installation
v0.0.12
Fixes
- Types resolve for consumers on
moduleResolution: node16ornodenext. The published declarations imported their sibling files without an extension, which those modes reject for an ESM package. UnderskipLibCheck: truethere was no error: every export was silently typed asany. Every relative import indist/typesnow names its file.
Internal
- The build type-checks the emitted declarations, so a broken
dist/typesfails the build instead of shipping.
v0.0.11
New
isEqualStateis an option ofinitialize. A transition to a state of the samekindthat it considers equal is skipped: the state isn't set, so effects and renders don't run again, and thetransitionyou called stays valid. It compares the states without theirtransitionproperty, and defaults toshallowEqual, 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
transitionfrom 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:useRenderuses 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 latetransitionis rejected as stale.
Behavior change
- A transition to an equal state of the same
kinddoes nothing. @ghostry/finity-reactjsand@ghostry/finity-solidjspass every option to the core package, not onlyonInvalidTransition.
For integration authors
ExhaustiveSwitchtakes a fourth type parameter,F, for what a case's function may return. It defaults toR, the result ofuse.
Docs: Equal states, Rendering, Solid
v0.0.10
Fixes
UsingTransitionalStateandUsingStrictlyTransitionalStateare 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
Fixes
require()no longer points at CommonJS files that don't exist. The packages are ES modules only, andpackage.jsonno longer declaresmainor arequirecondition.@ghostry/finity-reactjsand@ghostry/finity-solidjsre-export the core types again:Config,ExhaustiveSwitch,ExhaustiveSwitchInstance,Getter,InvalidTransitionError,Setter,TransitionalState, andTransitionalStates.
v0.0.8
Compatibility
- Published to JSR again, after 0.0.5. Every exported function declares its return type, which JSR requires.
Internal
UseStrictlyTransitionalStateHooknames the type of theuseStrictlyTransitionalStatehook.
v0.0.7
Breaking changes
@ghostry/finity-coreexports only its public API. That'sinitialize,never,noop,InvalidTransitionError,ExhaustiveSwitchInstance, and the typesConfig,Getter,Setter,ExhaustiveSwitch,TransitionalState,TransitionalStates, andInitialized. Its internal types are no longer exported.UsingTransitionalStateandUsingStrictlyTransitionalStatereturn in 0.0.10.@ghostry/finity-reactjsand@ghostry/finity-solidjsno longer re-export the core package's types. Import them from@ghostry/finity-coreuntil 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
Breaking changes
- The packages ship ES modules only. The CommonJS and UMD builds are removed, along with source maps. The
requirecondition inpackage.jsonstill points at the removed CommonJS build, sorequire()fails until 0.0.9.
Compatibility
- Not published to JSR. JSR goes from 0.0.5 to 0.0.8.
v0.0.5
Breaking changes
onInvalidTransitionreceives anInvalidTransitionErrorinstead of{ from, to }. Itsreasonis"disallowed"or"stale". Itsstateholds the definition'sname(fromdefineTransitionalState(name)),from, andto, and itstickholds the clock ticks behind a stale transition. Throw it to fail loudly, or report it.initialize({ onInvalidTransition: (error) => { throw error; }, });case([...])is a type error when its list names the samekindtwice.
New
- Stale transitions are rejected. A state's
transitionbelongs to the state it came with. Once the state has changed through anyset,update, ortransition, calling an earliertransitiondoes nothing and reports a"stale"InvalidTransitionError. This keeps a slow effect, such as a request that resolves after the user has moved on, from overwriting a newer state. InvalidTransitionErroris exported.- The packages are published to JSR as well as npm.
Fixes
@ghostry/finity-reactjs:setandupdatereturn the new state. They returned the updater function instead.
v0.0.4
Breaking changes
assertNeveris renamednever.- State values must be non-nullish.
useState,Getter,Setter, and a custom integration'sConfig.useStatenow constrain their type toT extends {}.
New
onInvalidTransitionis an option ofinitializein every package. It's called with{ from, to }whentransition()asks for a transition that the state's definition doesn't allow.
Behavior change
- A disallowed transition no longer throws. The state stays as it is, and
onInvalidTransitionis called if it's set. The types already reject a disallowedtransition()call, so this only happens through a cast.
Compatibility
- The build output targets ES2015 instead of ES5.
Docs: Invalid transitions
v0.0.3
Fixes a bug with the React library that prevented it from working.
