- 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
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))
- 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
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
- 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
- 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
- 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)
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:
- 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
- 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)
- Add validation for
event.watch
watcher, this code now throw error as expected:
Try it
- 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
- Allow typescript to refine type if
guard
got Boolean
(a function) as filter
- 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
- Fix additional store updates during state hydration
Try it
- Add support for array of units to
store.on
(PR #328)
Try it
Documentation for store.on
- Add support for array of units to
store.reset
to make it consistent with merge and store.on
Try it
Documentation for store.reset
- Remove units erased with
clearNode(unit)
from their parent domain hooks and history sets
- Add
ignore
parameter to serialize
to skip stores during app state serialization PR #325 (thanks @sergeysova)
- Fix cases with
effector/babel-plugin
when inability to determine unit name led to the absence of sid
property
- 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
- 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
- Add type support for sample with target and without clock (in that case,
source
will become clock
as well)
Try it
- 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
- Add
effect.doneData
and effect.failData
events with effect result and error values as shorthands for common use cases effect.done.map(({result}) => result)
and effect.fail.map(({error}) => error)
Try it
Documentation for effect.doneData
Documentation for effect.failData
- 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.
- 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.
- 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
- Improve
combine
batching in a few edge cases with nested combine
calls
Try it
- Allow to use objects and arrays with stores in sample source
Try it
- 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
- Add typescript typings for compat builds
- Improve built-in source maps
- Add support for arrays to
forward
Try it
- 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
- Ensure that both
effect.done
and effect.fail
are called before effect.finally
watchers, thereby preventing side-effects from interrupting pure computations
- Throw expected error in case with
sample({clock: undefined})
- 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.
- 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
- Fix edge case when
clearNode
been called on store belonged to certain domain led to the removal of the entire domain
Try it
- Add
history
to domains with read-only sets of events, effects, stores and subdomains
Try it
- 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
- 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)
- Add support for IE11 to
effector/compat
- Fix flow typings for
sample
- Allow
effector/babel-plugin
to work in browser
- 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)
- 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
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
- Add support for
event.filter
with common predicate functions
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 ☄️
- Implement event
store.updates
, representing updates of given store. Use case: watchers, which will not trigger immediately after creation (unlike store.watch
)see spec for store.updates
in tests
Try it
- Add support for passing multiply items at once in
store.reset
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)
- Optimize combined stores: no intermediate steps no more
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
- 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
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
- 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)
- 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
- Keep and replay the whole domain history for every new hook
- Add domain hooks for handle new events, effects or stores in domain.
- Improve TypeScript typings
- 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)
- 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
- Fix effector-react typings
- Build with node 6 target, add engine field to package.json
- Add warning dependency
- Memoize store.map and store updates
- Added sync graph reduction engine (it’s internal)
- Added store updates memoization
- Introduced effector-react
- Removed most-subject dependency
- New api
- Add AVar: low-level interface for asynchronous variables
- Clean up builds before publishing
- Add types dir into npm build
- 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)
- Build via rollup
- New module architechture
- Exclude coverage from npm build
- Rename
mill
to collect
- Rename
joint
to combine
- Remove source files from npm release
- Add support for sync functions in
.use
- breaking Rename config option
effectImplementationCheck
to unused
- Fix overriding of flow modules
- 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
- Added hot reload support for root domains
- Added support for dispatching halt action
First stable version
Proof of concept
- Add
createGate
implementation to effector-react/ssr
- Add support for object and array of events to
useEvent
. It’s a shorthand for calling several useEvent
at once (PR #425 by @sergeysova)
- 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
- 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)
- 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
- Fix regression in
effector-react/compat
and effector-vue/compat
compatibility with IE11
- Improve
useList
hook typings for typescript by allowing usage as components’ return value (fix DefinitelyTyped issue)
This code now works without type errors:
- 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
- Add type support for stores with
ReadonlyArray
to useList
for typescript
- Fix umd build of effector-react and effector-vue
Cdn with umd build of effector-react
Cdn with umd build of effector-vue
- 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
- 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)
- Pass props to
Gate.open
& Gate.close
events
Try it
- Add typescript typings for compat builds
- Improve built-in source maps
- 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
- Add support for react hooks in
createComponent
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)
- Add support for IE11 to
effector-react/compat
and effector-vue/compat
- Add
effector-react/compat
module to use with Smart TV (Chrome 47) apps without babel
- Add
useList
for efficient rendering of store lists
Try it
- Fix irrelevant react memory leak warning in a few cases
- Fix a bug in
useStore
with lack of store updates triggered by react hooks in children components
- 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
- Fix bug with additional rerender in case of
useStore
argument change
- Fix flow typings for
useStoreMap
- Removed unstable_createStoreProvider
- Add
useStoreMap
hook to select part from a store. Motivation
Try it
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 ☄️
- 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
- Replace
useEffect
with useLayoutEffect
in useStore
hook to response to state changes immediately