Changelog

effector

23.2.0

  • Improve type validation for derived stores in fork
  • Add missed runtime validation for allSettled calls with derived units. This case was labeled as a type error, but was forgotten in runtime.

23.1.0

  • Support arbitary callbacks in scopeBind. Allows library developers to create better APIs in a way that is Fork API - compatible. PR #1016
  • Remove deprecated types for already removed $store.map overload. PR #1029

23.0.0 Spacewatch

Improvements

  • Introduce EventCallable, StoreWritable and UnitTargetable types to allow users to express and understand what could be updated or called directly and what could not. Now createStore returns StoreWritable which can be passed to sample target and combine returns Store which will show type and runtime error (PR #966)
  • Improve error messages: now it includes unit names and locations so it will be useful to find errors in raw server logs or bundles with disabled source maps. To enable locations in errors use addLoc: true in babel-plugin. Usually the one wanted to enable this in development only so addLoc plugin option is disabled by default (PR #1015)
  • Add batch option to createWatch (PR #850)
  • Add @withease/factories to babel-plugin defaults (PR #995)
  • Add all patronum modules to babel-plugin defaults (PR #996)
  • Rename greedy to batch in sample. greedy: true becomes batch: false which is a better mental model for what this option do (PR #972)
  • Unify programmatic sid insertion in merge and restore (PR #969)
  • Allow domain to be used in attach without parent effect (PR #895)

Bug fixes

  • Fix nullable type of .reinit, now it exists in StoreWritable and not exists in Store (PR #966)
  • Fix serialization of ignored stores (PR #903)
  • Fix race condition in parallel effect calls (PR #849)
  • Fix scope reading its initial values from current (not initial) store value (PR #909)
  • Fix duplicated combine calls (PR #916)
  • Fix reading stale value in attach (PR #1011)

Deprecations and removed apis

  • Deprecate undefined as magical value to skip store updates, use skipVoid: true option in combine and map to enable old behavior. Getting rid of that edge case will allow to introduce lazy computations (issue #920)
  • Deprecate forward and guard in favor of sample (PR #913)
  • Deprecate reactSsr option in babel-plugin (PR #910)
  • Deprecate onlyChanges option in serialize (PR #907)
  • Deprecate raw object {[fx.sid]: Function} in fork handlers (PR #973)
  • Deprecate .watch with second argument in favor of sample (PR #906)
  • Deprecate .getType() - relic from ancient times which exists for redux compatibility (PR #899)
  • Deprecate effector/babel-plugin-react (PR #948)
  • Deprecate fork(domain) and hydrate(domain) - this api existed for traking units in scopes when Fork API was introduced, but starting from 22 version this is done automatically and domain is no longer required for that (PR #950)

  • Throw error when unit called from a pure function (PR #905)
  • Throw error when derived event is called (PR #905)
  • Throw error when fn in $store.map(fn) returns undefined in the initialization (issue #828)

  • Remove flow typings. In the beginning, the effector was written in flow, but now only types remained and they were extremely outdated due to lack of expertise in the technology. The flow community maintains bindings in a separate repository. (PR #912)
  • Remove deprecated effector/fork module (PR #842)
  • Remove deprecated createStoreObject alias for combine (PR #908)
  • Remove deprecated .thru method (PR #843)
  • Remove deprecated second argument with state from $store.map (PR #846)
  • Remove deprecated restore($store) support. This was an obscure feature when store is passed to method and returned without changes as is (PR #1018)

Performance

See also our migration guide

22.8.8

  • Add new types from effector 23: UnitTargetable, EventCallable and StoreWritable as aliases to improve migration experience and ecosystem compatibility

22.8.7

  • Fix combine function called twice on first allSettled call (PR #984)

22.8.6

  • Follow-up fix for 22.8.2: now combine in tuple-form handles compelx edge-cases with mapped stores correctly. (PR #902)

22.8.5

  • Follow up fix for 22.8.4: now fix works for fork({ handlers }) calls too. PR #898

22.8.4

  • Fixed an edge case for fork calls without sid (function from release 22.8.0). Some libraries provide built-in sid’s in the code, which led to the duplicated sid found exception when calling fork when trying to use two instances of the same factory in a test and running it without effector/babel-plugin. The exception on fork calls is no longer thrown, and all sid-related checks and assertions have been moved to serialize calls, since sid’s are actually only required for serialize to work. PR #897

22.8.3

  • Added missing node and stateRef ids to meta-objects. These are internal changes which are not covered by the types or docs yet.

22.8.2

  • combine types now allow primitive values, just like it was stated in the docs. Thanks to @faustienf PR #884
  • Events, created from split with match-object shape and internal inFlight counters of Effects now have proper metadata to use in the Inspect API. PR #892

22.8.1

  • Internal state refs now also see meta, if owned by store. PR #889

22.8.0

  • Sids are no longer required for fork({ values, handlers }), which allows to run tests without effector/babel-plugin. Note, that plugin and sids are still required for SSR. (PR #855)

22.7.0

  • Fix Declaration type, provide missing top-level properties for region and factory types
  • Add node’s id to Declaration type

22.6.2

  • Fix return type of withRegion

22.6.1

  • Add missing exports definition for effector/inspect API

22.5.2

  • Fix serialize: "ignore" in fork({ values }) (PR #862)

22.5.1

  • Fix default factories list in babel-plugin (PR #857)

22.4.1

  • Add type support for read only arrays in sample source. This case now supported and typechecked correctly:

Note that the one need to use “as const” in that case to got correct typechecking because without it typescript cannot infer the type [Store<string>, Store<number>]. We are working to avoid that limitation, stay tuned!

Encke 22.4.0

  • Add custom serializers for Store (PR #744)
  • Allow to pass domain as an argument for createEvent and similar methods (PR #763)
  • Add store.reinit event to set default value into store (PR #797)
  • Add safe mode for scopeBind (PR #688)
  • Add is.attached method to detect effects created via attach (PR #670)
  • Add @farfetched/core and atomic-router to default factories so the one not needed to describe them explicitly
  • Protect against combine argument being broken via Array.slice (PR #801)
  • Add “type” entry for package exports (PR #759)
  • Finally allow Gate to be serialized (as this requires changes in babel plugin) (PR #683)

22.2.0

  • Added filter option to sample, thereby making guard an alias (issue #521)
  • Added clock option to split (issue #537)
  • Improved sample type checking:
    • Fixed cases when target units becomes compatible with any type (issue #600)
    • Fixed cases when method call being marked as error when it perfectly correct
    • Removed vague “incompatible unit in target” error
    • Error messages now explicitly tells which type is given by source and which one is expected by target
    • 16 overloads was merged into single one to improve clarity of error messages. Will remove a lot of noise from IDE output thereby improving developer expirience
  • Improved split type checking:
    • Fixed a case when units in cases becomes compatible with any type
    • Removed vague “incompatible unit in target” error
    • Error messages now explicitly tells which type is given by source and which one is expected by failed target case
  • Added jsdoc documentation for all top level methods. Will be used by IDE such as VS Code and Webstorm to provide better developer expirience
  • Derived units in target of sample, guard, split and forward are deprecated (issue #563)
  • Imperative calls of derived units created by merge, sample and split are deprecated
  • Imperative calls of events and effects in pure functions are deprecated (issue #541)
  • restore($store) is deprecated (issue #571)
  • Effects created by attach got correct name for use in developer tools like effector-logger (issue #527)
  • Fixed a case when sample/guard pass obsolete data from it’s source store (issue #544)
  • Fixed data race when using combine with fork api (issue #613)
  • Fixed cases when effector/babel-plugin changes function calls which it should avoid (issue #603)
  • Fixed support for multiple passes of effector/babel-plugin (issue #601)
  • Fixed combine support for units with large union types (issue #531)
  • Fixed support for calls without payload for Event<unknown> (PR #454)
  • Fixed circular reference warning during import of typings (issue #578)

22.1.2

  • Allow to use effector/babel-plugin in patronum/macro

22.1.1

  • Fix data races that cause obsolete states to appear in the .on and .reset methods

22.1.0

  • Added option debugSids to effector/babel-plugin

The option allows adding file path and variable name to a sid for each unit definition. It allows to easily debug serialized scope using SSR.

22.0.0

  • Add support for plain functions to attach: attach({source, async effect(source, params) {}})
  • Allow to use fork without domains: const scope = fork()
    • Unit not found in scope error is no longer exists, any unit could be used in any scope
    • Increase performance of fork and serialize a hundredfold
  • Add support for attached effects to fork handlers
  • Add support for tuples to fork values and handlers: fork({values: [[$user, 'alice'], [$age, 22]]})
  • Add serialize: 'ignore' option to createStore to declare store as ignored by serialize calls
  • Make onlyChanges: true a default serialize option
  • Fix babel plugin issue with parsing method calls (e.g. in react native)
  • Validate combine arguments and throw an error in case of undefined and non-store units (issue #509)
  • Throw an error when fork handlers or values got units without sid or with duplicate sid
  • Deprecate createStoreObject alias for combine
  • Deprecate effector/fork module
  • Deprecate .thru
  • Deprecate second argument in store.map
  • Deprecate direct manipulations with derived units:
    • Deprecate .on in derived stores created by store.map and combine
    • Deprecate calls of derived events created by event.map, event.filterMap and event.filter
    • Deprecate calls of fx.done, fx.doneData and other events belongs to effects
  • Remove ɔ (latin small letter open o) symbol to prevent incorrect unicode parsing
  • Remove undocumented scope.find which is a wrong abstraction for a new fork
  • Make Scope a unit:
    • Add support for Scope to is.unit
    • Add is.scope method
  • Allow to pass a scope to scopeBind: scopeBind(unit, {scope}), which is also can be used outside from .watch
  • Improve es modules support
  • Make package size 10% smaller

21.8.0

  • Add type support for arrays in sample target (PR #284, #445)
  • Add support for case functions, case stores and matcher stores to split. Case functions and stores will choose target case by its name, matcher stores are boolean stores which indicate whether to choose given case
  • Add updateFilter config field to createStore to skip arbitrary store updates (discussion #428)
  • Add support for sample with clock without source. For example, it useful in cases when clock is array of units and no source stores is needed
  • Add support for clock to guard to improve developer expirience in cases when update trigger (clock field) and data source (source field) are different things
  • Add addNames field to babel plugin (PR #450)

  • Add type support for Scope to clearNode (issue #441)

  • Add compositeName to Domain typings, making it consistent with other units

  • Add EventPayload and UnitValue type helpers (PR #434)

  • Improve various edge cases with fork api and serialization

  • Improve typechecking for attach (issue #439)

  • Fix various type issues in sample and guard typings

21.7.0

  • Add support for scopes to hydrate, to provide a way to fill additional values to existing scope (happens during SSG navigation in next.js)

  • Improve prepend type inference (PR #415 (thanks @doasync))

21.6.0

  • Add support for user-defined factories in fork api. Starting from this release, application developers can use their own functions and be sure that their content will be properly serialized and hydrated by fork api. New field factories in effector/babel-plugin accepts array of module names which exports will be treated as custom factories therefore each function call will provide unique prefix for sid properties of units inside them

Import createEffectStatus from './createEffectStatus' was treated as factory function so each store created by it has its own sid and will be handled by serialize independently, although without factories they will share the same sid

factories in documentation

  • Add user-friendly unit name in fork api error messages when given unit is not found in scope. This improves error messages in both effector and effector-react

  • Add validation for values and handlers fields in fork and for values field in hydrate

  • Add type support for createEffect<typeof handler, Error>(handler) to infer Params and Done types from given handler and provide custom Fail type at the same time

createEffect and custom errors in documentation

  • Improve guard return type inference (PR #406 (thanks @doasync))

  • Fix void params support for createEffect(name, config) (issue #404)

  • Allow to use Event<void> in cases when only () => void is accepted (PR #400 (thanks @doasync))

  • Add support for merge to effector/babel-plugin

21.5.0

  • Add support for attach({effect}) to create effect which will call effect with params as it is. That allow to create separate effects with shared behavior (PR #396 and #397 (thanks @sergeysova and @oas89))

  • Add reactSsr option to effector/babel-plugin to replace imports from effector-react to effector-react/ssr. Useful for building both server-side and client-side builds from the same codebase

21.4.0

  • Add support for return status to allSettled. When allSettled is called with Effect, it return object with value and status fields (discussion)

Try it

  • Allow to expicitly define return/error types in createEffect(handler)
  • Add types for domain.effect(handler)

  • Fix effector/babel-plugin behavior in case when methods like createStore are imported from unrelated library and should be ignored. Import library could be defined by importName config field

  • Improve fork api support for watchers

21.3.0

  • Add support for createEffect(handler)

createEffect(handler) in documentation

Try it

  • Add support for attach({source, effect}) without mapParams: in case with source and effect only, inner effect will be triggered with source values

attach({effect, source}) in documentation

it’s a shorthand for common use case:

Try it

  • Handle throws in attach mapParams field: errors happened in mapParams function will force attached effect to fail
  • Add babel plugin support for split and createApi
  • Add name field to attach typings
  • Add .filter and .filterMap to effect typings (PR #376)
  • Improve config validation for forward, attach, sample and guard: attempt to call these methods without arguments will lead to error with user-friendly description
  • Improve fork api support for stores and events

21.2.0

  • Add array support for sample clock field which acts like a merge call
  • Improve ide type hints support for sample in case of config form
  • Add package.json to package exports field (read more in nodejs documentation)

21.1.0

  • Add onlyChanges option to serialize to ignore stores which didn’t changed in fork (prevent default values from being carried over network)

  • Add type helpers for stores and effects: StoreValue, EffectParams, EffectResult and EffectError

  • Allow domain.createEffect to infer type from given handler (that feature was already implemented for createEffect method), this code now typechecked as expected:
  • Allow to call allSettled with void units without params field, this code now typechecked as expected:

21.0.0

  • Add object form of split for pattern-matching without additional forwards

split in documentation

Try it

You can match directly to store api as well:

Try it

  • Merge effector/fork into effector. Now all methods required for SSR are exported from the library itself, making effector/fork an alias
  • Make Scope type alias for Fork
  • Add support for es modules: import {createStore} from 'effector/effector.mjs'
  • Effect without a handler now throws an error during a call instead of calling console.error with undefined return, which was violating the type of effect
  • Remove restore aliases, event.filter(fn) alias for event.filterMap(fn), greedy in sample as separate last argument and unused blocks and Kind

20.17.2

  • Add effects created via attach to domain effects, allowing these effects to be called within other effects when using fork

Try it

  • Add validation for combine first argument which should be store, object with stores or array with stores PR #362 (thanks @doasync)

20.17.1

  • Add validation for event.watch watcher, this code now throw error as expected:

Try it

20.17.0

  • Add support for nested effect calls in forked scope. Parallel requests are supported as well

Try it

  • Allow createNode to call without arguments
  • Make Step type alias for Node

20.16.1

  • Allow typescript to refine type if guard got Boolean (a function) as filter

20.16.0

  • Add support for handlers to fork to change effect handlers for forked scope (useful for testing)

Try it

  • Add support for scope.getState(store) to access to store values in forked scopes
  • Fix values support for fork

20.15.1

  • Fix additional store updates during state hydration

Try it

20.14.0

  • Add ignore parameter to serialize to skip stores during app state serialization PR #325 (thanks @sergeysova)

20.13.6

  • Fix cases with effector/babel-plugin when inability to determine unit name led to the absence of sid property

20.13.5

  • Extend typescript support for any to void forwarding: add support for forwarding to array of void units
  • Fix computed stores support for hydrate
  • Fix allSettled support for effects as first argument

20.13.0

  • Introduce attach: wrapper for effect, which allow to map effect arguments and use data from stores.

Use cases: declarative passing values from stores to effects and argument preprocessing.

Documentation for attach

  • Add noDefaults option for effector/babel-plugin for making custom unit factories with clean configuration

20.12.2

  • Add type support for sample with target and without clock (in that case, source will become clock as well)

Try it

20.12.1

  • Add support for guard to babel-plugin
  • Add support for forward to babel-plugin
  • Add support for explicit domain.hooks calls as escape hatch for imperative adding units to given domain

20.11.0

  • Add effect.inFlight store to effects. It show how many effect calls aren’t settled yet. Useful for rate limiting.

Try it

Documentation for effect.inFlight

  • Introduce withRegion: region-based memory management tool, which attach units (stores, events and effects) and watchers, created inside given callback to lifecycle of owner unit to be erased together with it.

Try it

  • Add support for Map<Store, any> to values property in fork.
  • Fix concurrent requests support in effect.pending: it will become false only after all pending effect calls becomes settled.

20.10.0

  • Add launch({target: unit, params}) overload for launch - low level method for running computation in units (events, effects or stores). Mostly used by library developers for fine-grained control of computations.

20.9.0

  • Introduce effector/fork and effector-react/ssr: api for server side rendering and managing independent instances of application in general.

This solution requires effector/babel-plugin in babel configuration:

Example application with express Serverless example

  • Add events created with createApi, stores created with restore and events created with .prepend to domain of given source units

Try it

20.8.2

  • Improve combine batching in a few edge cases with nested combine calls

Try it

20.8.0

  • Allow to use objects and arrays with stores in sample source

Try it

20.7.0

  • Add domain.createStore as alias for domain.store (proposal)
  • Add domain.createEvent as alias for domain.event
  • Add domain.createEffect as alias for domain.effect
  • Add domain.createDomain as alias for domain.domain

20.6.0

  • Add support for arrays to forward

Try it

20.5.0

  • Merge createStoreObject to combine to reduce api surface. Wherever createStoreObject was used, it can be replaced with combine

Try it

  • Add ability to use arrays of stores with combine

Try it

20.4.4

  • Ensure that both effect.done and effect.fail are called before effect.finally watchers, thereby preventing side-effects from interrupting pure computations

20.4.3

  • Throw expected error in case with sample({clock: undefined})

20.4.0

  • Introduce guard: conditional event routing Control one event with the help of another: when the condition and the data are in different places, then we can use guard with stores as a filters to trigger events when condition state is true, thereby modulate signals without mixing them

See ui visualization

Also, guard can accept common function predicate as a filter, to drop events before forwarding them to target

Type inference Implementation tests

  • Introduce name property in sample parameters list

Each basic entity in effector (event/effect/store/domain) may have a name. You now can name sampled entities in the same manner as basic ones.

20.3.2

  • Allow typescript to refine type with split method (PR)
  • Improve type inference of effects with optional arguments in Typescript (PR)
  • Ensure that effect handler is called only after effect update itself, thereby preventing side-effects from interrupting pure computations

Try it

20.3.1

  • Fix edge case when clearNode been called on store belonged to certain domain led to the removal of the entire domain

20.3.0

  • Add shortName to domains

Try it

  • Add history to domains with read-only sets of events, effects, stores and subdomains

Try it

20.2.0

  • Add support for domains to clearNode
  • Add .sid - stable hash identifier for events, effects, stores and domains, preserved between environments, to handle client-server interaction within the same codebase.

The key is that sid can be autogenerated by effector/babel-plugin with default config and it will be stable between builds

See example project

  • Add support for implicit void params in createEffect for typescript #106
  • Fix bug with cannot read property .toString of undefined error during store initialization

20.1.2

  • Allow typescript to refine type of payload if event.filter({fn}) got a predicate function as a callback PR
  • Allow typescript to refine type with is methods PR
  • Add new fields to definition of graph nodes (discussion)

20.1.1

  • Add support for IE11 to effector/compat
  • Fix flow typings for sample
  • Allow effector/babel-plugin to work in browser

20.1.0

  • Add effector/compat module to use with Smart TV (Chrome 47) apps without babel (fix #152). Starting with this release, the library code is tested by browserstack.com for compatibility with our targets, including smart tv
  • Improve typescript typings for sample (thanks @abliarsar) (PR #156)
  • Fix webpack issue, which generated incorrect code with some ancient targets (IE10)

20.0.0

  • Add merge for merging events

Try it

  • Add split for pattern-matching over events

Try it

  • Allow clearNode to automatically dispose all related intermediate steps

Try it

  • Fix promise warning for effects

  • Add effect.finally

Try it

  • Add types for createEvent with config instead of string
  • Add types for createEffect with config instead of string
  • Add event.filterMap as new alias for event.filter(fn)
  • Remove extract, withProps, is.* re-exports

19.1.0

  • Add support for event.filter with common predicate functions

19.0.0

To indicate the stability of the project, we adopting semantic versioning and happy to announce version 19.0.0 for all packages. And to make the transition easier, that release contains no breaking changes; simple replacement of “^0.18.*“ to “^19.0.0” is safe for sure ☄️

0.18.7-0.18.8

  • Add support for passing multiply items at once in store.reset
  • Add support for createEvent and createEffect with config (see next code example)

  • Add .pending property for effects

it’s a shorthand for common use case

Try it

  • Introduce sample. Sample allows to integrate rapidly changed values with common ui states

see sample in action here

Sampling (signal processing)

  • Add babel plugin for automatic naming of events, effects and stores (useful for identifying resources with SSR)
  • Add babel plugin for automatic displayName for react components

Plugins are available out from a box

.babelrc:

see plugins in action

  • Add support for passing events and effects to watchers
  • Improve execution order for sync effects
  • Improve typescript typings for createApi (#102)

0.18.5-0.18.6

  • Optimize combined stores: no intermediate steps no more
  • Use the new kernel. Provide improved eventual consistency: any side effects will be triggered only after performing all pure computations

  • Add is namespace for all type validators

  • Add clearNode to break references and subscriptions between events, stores, etc

  • Add support for custom datatypes by making step constructors, createNode and launch functions public

  • Fix fromObservable, ensure it works with redux as a typical library with Symbol.observable support
  • Fix version, now it always equals version in package.json
  • Add support forwarding to effects

0.18.3-0.18.4

  • Add version variable to public exports
  • Add effect handler to domain 4c6ae8

  • Add Unit<T> as common interface implemented by Event, Effect and Store

  • Add isStore, isEvent, isEffect and isUnit validators

  • Add extended createStore with config
  • Publish babel-plugins

  • Improve naming for chrome performance timeline

  • Fix typescript typings #45

  • Fix event.prepend bug #35

0.18.2

  • Fix webpack usage issue. To prevent this in a future, webpack integration test was added.

  • Improve typescript typings for createApi. This code example became type checked

  • Add umd bundle to npm. Therefore, you can use cdn to include library without bundlers

0.18.1

  • Add forward: common function for forwarding updates and events
  • add support for storages in store.on
  • Allow to pass {handler: Function} as second argument to createEffect
  • Make effect.use return the same effect instead of void (ability to chain method calls)

0.18.0

  • Log events into Chrome devtools performance timeline
  • Add notifications about errors inside computation chain
  • Add store.defaultState property
  • effector-react: Add createComponent
  • Make withProps static function
  • Make effect return plain promise

0.17.7

  • Keep and replay the whole domain history for every new hook

0.17.6

  • Add domain hooks for handle new events, effects or stores in domain.
  • Improve TypeScript typings

0.17.5

  • Add ability to use createEvent, createEffect and createDomain without arguments (omit name)
  • Fix wrong order of effect names
  • Add createWrappedDomain to watch all nested events and updates
  • Add extract to watch only part of nested storages
  • Deprecate .epic method (library supports symbol-observable, so assumed that most.from(event) or Observable.Of(store) covered all use cases)

0.17.4

  • effector-react: Add check for mounting of store consumer
  • Add effect.use.getCurrent() method to get current used function
  • Improve type inference in flow typing for createStoreObject
  • Improve public ts and flow typings

0.17.3

  • Fix effector-react typings
  • Build with node 6 target, add engine field to package.json
  • Add warning dependency

0.17.2

  • Memoize store.map and store updates

0.17.0

  • Added sync graph reduction engine (it’s internal)
  • Added store updates memoization
  • Introduced effector-react

0.16.0

  • Removed most-subject dependency
  • New api

0.15.0-rc.2

  • Add AVar: low-level interface for asynchronous variables
  • Clean up builds before publishing
  • Add types dir into npm build

0.14.0

  • Add independent createStore method
  • Replace console.warn with console.error in warnings
  • Make reducers full-featured store elements (add .get(), .set(x) and .map(fn) methods)
  • Add observable declaration to effects, events and reducers, which allow interop in this way: from(effect)

0.13.0

  • Build via rollup
  • New module architechture

0.12.0

  • Exclude coverage from npm build
  • Rename mill to collect
  • Rename joint to combine

0.11.1

  • Remove source files from npm release

0.11.0

  • Add support for sync functions in .use
  • breaking Rename config option effectImplementationCheck to unused

0.10.2

  • Fix overriding of flow modules

0.10.0

  • breaking Removed rootDomain alias for createRootDomain
  • Fixed duplication of typeConstant events
  • Added sync event propagation
  • Catching of watch function errors
  • Added warning to port errors
  • Added type aliases DomainAuto, EventAuto and EffectAuto
  • Added mill fluent “AND” reducer combinator

0.9.1

  • Added hot reload support for root domains
  • Added support for dispatching halt action

0.9.0

First stable version

effector-react

23.2.0

  • Make Gate.open and Gate.close EventCallable to allow users to call it in tests

23.1.0

  • Skip enumerable prototype-inherited properties in useUnit(shape). Some badly-written polyfills might add such properties to built-ins like Array. PR #1023
  • Add missing depreaction tag to the one of useEvent overloads. PR #1030
  • Add useProvidedScope low level API for library developers. PR #1033

23.0.1

  • Fix warning about useStore appeared in useList (PR #1022)

23.0.0

  • Deprecate effector-react/scope in favor of isomorphic hooks (PR #979)
  • Deprecate useStore, useEvent, connect and createStoreConsumer in favor of universal useUnit (PR #951)
  • Deprecate createComponent in favor of @effector/reflect
  • Remove deprecated effector-react/ssr module (PR #844)
  • Remove deprecated createReactState and createContextComponent (PR #845)

22.5.4

  • Fix for createWatch implementation to improve @effector/next updates flow

22.5.3

  • Fix too frequent useUnit updates

22.5.1

  • Fix Gate usage as component. <Gate /> will also be isomorphic by scope.

22.5.0

  • Make useGate isomorphic in effector-react module, so the one not needed to use effector-react/scope anymore (PR #852)
  • Fix useUnit hangs when scope is changed (happens when route is changed in next.js) (PR #851)

22.3.4

  • Fix useUnit skipping updates when used with useEffect and useGate

22.3.3

  • Fix useUnit skipping updates during scope changes (often happens in next.js apps). Big thanks to @AlexandrHoroshih for investigation

22.3.1

  • Fix useUnit skipping updates in react 16-17

22.3.0

  • Made hooks useEvent, useStore, useStoreMap and useList isomorphic, now they would use scope from the Provider if it is available and scope-less mode otherwise. For useUnit it was done in 22.2.0.
  • Added parameter forceScope to useEvent, useStore, useStoreMap and useList to force usage of scope from Provider, it would throw an error if Provider is not available, /scope module sets forceScope to true by default

22.2.0

  • Made hook useUnit isomorphic, now it would use scope from the Provider if it is available and scope-less mode otherwise (PR #776 and PR #785)
  • Added parameter forceScope to useUnit to force usage of scope from Provider, it would throw an error if Provider is not available (PR #776 and PR #785), /scope module sets forceScope to true by default
  • Added “type” entry for package exports (PR #759)
  • Fixed typing in useUnit (PR #747)

22.1.0

  • Added support for react 18 (PR #655)
  • Added useUnit method to read multiple stores and bind events or effects to scope in a single batched call (PR #733, #738)
  • Added placeholder option to useList to render in cases of empty list
  • Added defaultValue option to useStoreMap to return in cases when fn returns undefined
  • Fixed Gate.status store being serialized (PR #683)

22.0.6

  • Fix Can't perform a React state update on an unmounted component warning for useStoreMap in a few cases (issue #574)

22.0.0

  • Add module effector-react/scope and make effector-react/ssr an alias for it
  • Fix Cannot update a component warning in useGate
  • Allow to return undefined in useStoreMap
  • Make domain field in createGate optional
  • Deprecate createContextComponent and createReactState
  • Improve es modules support

21.3.1

  • Fixed TypeError in useStoreMap with scope (PR #474)

21.3.0

  • Add support for updateFilter to useStoreMap. It helps to control component rerendering, e.g. when component should rerender only when id field is changed
  • Add useStoreMap($store, value => result) shorthand
  • Add support for getKey to useList. Function in this field will be used to compute key for every item of list
  • Add support for stores with functions in them to useStore (PR #431)
  • Add domain name passed to createGate to gate.displayName and gate units (issue #449)
  • Fix unhandled promise rejection in useEvent when used effect throw an error

21.2.0

  • Add createGate implementation to effector-react/ssr

21.1.0

  • Add support for object and array of events to useEvent. It’s a shorthand for calling several useEvent at once (PR #425 by @sergeysova)

21.0.0

  • Add support for es modules
  • Remove experimental Gate.isOpen plain property, which was incompatibile with concurrent mode and ssr, use Gate.status instead

Gate.status in documentation

20.9.0

  • Export useGate with fork support from effector-react/ssr

Try it

  • Add domain optional field to createGate which will be used to create gate units (useful for ssr)

createGate({domain}) in documentation

  • Improve useList hook typings for typescript exported from effector-react/ssr by allowing usage as components’ return value (fix DefinitelyTyped issue)

20.8.0

  • Add ability to define default Gate state in createGate via defaultState field

createGate({defaultState}) in documentation

  • Remove object restriction from createGate Props type in typescript, as it becomes useless with introduction of useGate. This code now passes type checking successfully

20.7.3

  • Fix regression in effector-react/compat and effector-vue/compat compatibility with IE11

20.7.1

  • Improve useList hook typings for typescript by allowing usage as components’ return value (fix DefinitelyTyped issue)

This code now works without type errors:

20.7.0

  • Use shallow compare for skipping updates with useGate, thereby making it consistent with <Gate />
  • Remove nesting from components, created by createContextComponent and createReactState, which previously were based on createComponent

20.6.3

  • Add type support for stores with ReadonlyArray to useList for typescript

20.6.0

  • Introduce effector/fork and effector-react/ssr: api for server side rendering and managing independent instances of application in general.

This solution requires effector/babel-plugin in babel configuration:

Example application with express Serverless example

  • Add events created with createApi, stores created with restore and events created with .prepend to domain of given source units

Try it

20.5.2

  • Add ability to infer fn argument types without as const in useStoreMap. In effector-react 20.0.3 we introduced an improvement for useStoreMap types, which helps to infer types of fn arguments from keys. And now useStoreMap types improved even more: every item in second argument will have its own type even without as const, out from a box

Type tests

useStoreMap in docs

PR #274 (thanks @abliarsar)

20.5.0

  • Pass props to Gate.open & Gate.close events

Try it

20.4.0

  • Add support for keys field in useList. By default, useList rerenders only when some of its items was changed. Howewer, sometimes we need to update items when some external value (e.g. props field or state of another store) is changed. In such cases we need to tell react about our dependencies and pass keys explicitly.

Try it

20.3.0

  • Add support for react hooks in createComponent

20.2.2

  • effector-react, effector-vue and effector itself have compat builds for compatibility with old devices without babel. In such versions, it should import effector/compat, not just effector (Fix #173)

20.2.1

  • Add support for IE11 to effector-react/compat and effector-vue/compat

20.2.0

  • Add effector-react/compat module to use with Smart TV (Chrome 47) apps without babel

20.1.1

  • Add useList for efficient rendering of store lists

Try it

20.0.5

  • Fix irrelevant react memory leak warning in a few cases

20.0.4

  • Fix a bug in useStore with lack of store updates triggered by react hooks in children components

20.0.3

  • Allow as const typescript assertion for useStoreMap keys. It helps us to infer type for fn arguments

In typescript versions below 3.4, you can still use an explicit type assertion

as const in typescript docs

20.0.2

  • Fix bug with additional rerender in case of useStore argument change

20.0.1

  • Fix flow typings for useStoreMap

20.0.0

  • Removed unstable_createStoreProvider

19.0.0

To indicate the stability of the project, we adopting semantic versioning and happy to announce version 19.0.0 for all packages. And to make the transition easier, that release contains no breaking changes; simple replacement of “^0.18.*“ to “^19.0.0” is safe for sure ☄️

0.18.10

  • Add initial props factory to createComponent
  • Implicitly convert objects to createStoreObject in createComponent
  • Add mounted and unmounted events to components created by createComponent
  • Replace useLayoutEffect with useIsomorphicLayoutEffect to support server-side rendering

0.18.9

  • Replace useEffect with useLayoutEffect in useStore hook to response to state changes immediately

effector-vue

23.0.0

  • Add useUnit hook (PR #1003)
  • Make bindings isomorphic
  • Deprecate effector-vue/ssr in favor of isomorphic hooks (PR #1005)
  • Remove obsolete deprecated apis $watchAsStore and $store (PR #1004)

22.2.0

  • Add useStoreMap hook for Vue 3 composition API to select part from a store ((PR #780)[https://github.com/effector/effector/pull/780]) by @ilajosmanov

22.1.2

  • Added “type” entry for package exports (PR #759)

22.0.0

  • Improve es modules support

21.1.0

  • Add support for vue@next (vue 3)
  • useStore useVModel useGate createGate see docs

21.0.0

  • Add support for es modules

20.5.0

  • Migrated from Vue.util.defineReactive to Vue.observable

  • Effector stores will show in Vue devtools

  • Cosmetic improvements for support plugin in the future.

  • Now we can add some units to effector object (will be return Store<number>)

  • Support v-model directive for scalar values

20.4.2

  • Fix regression in effector-react/compat and effector-vue/compat compatibility with IE11

20.4.1

  • Improve typescript typings for usage via Vue.extend (PR #343)

20.3.0

  • Add createComponent HOC for TypeScript usage. This HOC provides type-safe properties in vue components.

20.2.0

  • Add support for object shape

20.1.2

  • effector-react, effector-vue and effector itself have compat builds for compatibility with old devices without babel. In such versions, it should import effector/compat, not just effector (Fix #173)

20.1.1

  • Add support for IE11 to effector-react/compat and effector-vue/compat

20.1.0

  • Add effector-vue/compat module to use with Smart TV (Chrome 47) apps without babel

20.0.0

Vue adapter for effector 20

19.0.0

To indicate the stability of the project, we adopting semantic versioning and happy to announce version 19.0.0 for all packages. And to make the transition easier, that release contains no breaking changes; simple replacement of “^0.18.*“ to “^19.0.0” is safe for sure ☄️