Releases: smikhalevski/react-executor
v0.0.17
Changelog: v0.0.16...v0.0.17
-
Added
Executor.pendingPromise
which holds the promise of the pending task execution, ornull
if there's no pending task execution. -
Executor.getOrDefault()
can be called without an argument, default value is set toundefined
in this case. -
Updated parallel-universe to fix off-by-one error triggered when a listener is unsubscribed during an event publish.
v0.0.16
Changelog: v0.0.15...v0.0.16
-
Fixed initial value persistence in storage.
-
Promises retuned by
Executor.execute
don't trigger unhandled errors when rejected. -
useExecutorSuspense
accepts a condition under which executors are awaited bySuspence
. By default, non-fulfilled pending executors are awaited:
useExecutorSuspense(myExecutor, executor => !executor.isFulfilled);
v0.0.15
Changelog: v0.0.14...v0.0.15
-
Added CSP nonce support to
SSRExecutorManager
. -
SSRExecutorManager.nextHydrationScript()
returns a script source that hydrates the client with the state accumulated during SSR, or an empty string if there are no state changes since the last timenextHydrationScript
was called.
v0.0.14
Changelog: v0.0.13...v0.0.14
-
Added
abortWhen
,resolveWhen
, andretryWhen
plugins, that take anObservable
and abort, resolve, or retry the executor depending on the value pushed to its listeners. -
Removed
retryFocused
.retryWhen
should be used instead:
import retryWhen from 'react-executor/plugin/retryWhen';
import windowFocused from 'react-executor/observable/windowFocused';
useExecutor('test', heavyTask, [
retryWhen(windowFocused)
]);
- Added
abortPending
andrejectPending
plugins that abort the pending task if the execution takes too long:
import abortPending from 'react-executor/plugin/abortPending';
useExecutor('test', heavyTask, [
abortPending(10_000)
]);
- Fixed XSS-prone hydration script.
v0.0.13
Changelog: v0.0.12...v0.0.13
Fixed incomplete SSR hydration bug.
v0.0.12
Changelog: v0.0.11...v0.0.12
Fixed backward compatibility bug.
v0.0.11
Changelog: v0.0.10...v0.0.11
-
ExecutorManager.keySerializer
is set toJSON.stringify
by default. -
Extracted
react-executor/core
module that doesn't import React. -
synchronizeStorage
relies onExecutorManager.keySerializer
when guessing the storage key. -
Removed
use-sync-external-store
dependency. In older versions of React,useExecutorSubscription
relies onuseState
to rerender the component.
v0.0.10
Changelog: v0.0.9...v0.0.10
-
Added support for
renderToString
and streaming SSR. -
initialState
was removed fromExecutorManagerOptions
. To hydrate an executor, useExecutorManager.hydrate(initialState)
. -
ExecutorManager.waitFor
was renamed togetOrAwait
. -
Executor.toPromise
was renamed togetOrAwait
.
v0.0.9
Changelog: v0.0.8...v0.0.9
useExecutorSubscription
now relies on useSyncExternalStore
instead of useState
to re-render the component.
v0.0.8
Changelog: v0.0.7...v0.0.8
-
Custom events are supported in
Executor.publish()
. -
Executor.timesamp
was renamed tosettledAt
. -
Added
Executor.invalidatedAt
that stores the timestamp when the executor result was invalidated. -
Executor.dispose
was renamed todetach
. -
"configured"
event was renamed to"attached"
. -
Plugins publish a
"plugin_configured"
event when their configuration is updated. -
Executor.isRejected
andisInvalidated
are now getters. -
Executor.invalidate
now accepts the timestamp of the invalidation which is set toDate.now()
by default. -
invalidateByPeers
callspeerMatched
only when a new peer executor is attached. -
synchronizeStorage
plugin now accepts options with a customstorageKey
. -
Executors can be annotated with arbitrary metadata:
executor.annotate({ hello: 'Bill' });
executor.annotations.hello;
// ⮕ 'Bill'
- Devtools integration.