Releases: effector/effector
Releases · effector/effector
effector 23.2.2
- Fix types for createEffect and attach in factories with generics (issue #1069). Cases like this now works correctly:
function createModel<T>() {
const $data = createStore<T | null>(null)
const fx = createEffect(() => null as T)
sample({clock: fx.doneData, target: $data})
}
effector-react 23.2.1
- Fix types for
useUnit([fx])
with effect with custom error (PR #1070)
effector 23.2.1
- Fix forbidden keys in combine (issue #1064)
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.
effector-react 23.2.0
- Make
Gate.open
andGate.close
EventCallable
to allow users to call it in tests
effector 23.1.0
effector-react 23.1.0
effector-react 23.0.1
- Fix warning about
useStore
appeared inuseList
(PR #1022)
effector Spacewatch 23.0.0
Improvements
- Introduce
EventCallable
,StoreWritable
andUnitTargetable
types to allow users to express and understand what could be updated or called directly and what could not. NowcreateStore
returnsStoreWritable
which can be passed to sample target andcombine
returnsStore
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 soaddLoc
plugin option is disabled by default (PR #1015) - Add
batch
option tocreateWatch
(PR #850) - Add
@withease/factories
to babel-plugin defaults (PR #995) - Add all
patronum
modules to babel-plugin defaults (PR #996) - Rename
greedy
tobatch
insample
.greedy: true
becomesbatch: false
which is a better mental model for what this option do (PR #972) - Unify programmatic sid insertion in
merge
andrestore
(PR #969) - Allow
domain
to be used inattach
without parent effect (PR #895)
Bug fixes
- Fix nullable type of
.reinit
, now it exists inStoreWritable
and not exists inStore
(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 incombine
andmap
to enable old behavior. Getting rid of that edge case will allow to introduce lazy computations (issue #920) - Deprecate
forward
andguard
in favor ofsample
(PR #913) - Deprecate
reactSsr
option in babel-plugin (PR #910) - Deprecate
onlyChanges
option inserialize
(PR #907) - Deprecate raw object
{[fx.sid]: Function}
in forkhandlers
(PR #973) - Deprecate
.watch
with second argument in favor ofsample
(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)
andhydrate(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)
returnsundefined
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 forcombine
(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
- 10% performance improvement (PR #1014)