Skip to content

Releases: smikhalevski/react-executor

v0.0.17

02 Jul 15:13
Compare
Choose a tag to compare

Changelog: v0.0.16...v0.0.17

  • Added Executor.pendingPromise which holds the promise of the pending task execution, or null if there's no pending task execution.

  • Executor.getOrDefault() can be called without an argument, default value is set to undefined 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

20 Jun 21:24
Compare
Choose a tag to compare

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 by Suspence. By default, non-fulfilled pending executors are awaited:

useExecutorSuspense(myExecutor, executor => !executor.isFulfilled);

v0.0.15

09 Jun 16:31
Compare
Choose a tag to compare

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 time nextHydrationScript was called.

v0.0.14

02 Jun 11:41
Compare
Choose a tag to compare

Changelog: v0.0.13...v0.0.14

  • Added abortWhen, resolveWhen, and retryWhen plugins, that take an Observable 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 and rejectPending 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

30 May 22:43
Compare
Choose a tag to compare

Changelog: v0.0.12...v0.0.13

Fixed incomplete SSR hydration bug.

v0.0.12

27 May 21:21
Compare
Choose a tag to compare

Changelog: v0.0.11...v0.0.12

Fixed backward compatibility bug.

v0.0.11

27 May 21:21
Compare
Choose a tag to compare

Changelog: v0.0.10...v0.0.11

  • ExecutorManager.keySerializer is set to JSON.stringify by default.

  • Extracted react-executor/core module that doesn't import React.

  • synchronizeStorage relies on ExecutorManager.keySerializer when guessing the storage key.

  • Removed use-sync-external-store dependency. In older versions of React, useExecutorSubscription relies on useState to rerender the component.

v0.0.10

27 May 21:15
Compare
Choose a tag to compare

Changelog: v0.0.9...v0.0.10

  • Added support for renderToString and streaming SSR.

  • initialState was removed from ExecutorManagerOptions. To hydrate an executor, use ExecutorManager.hydrate(initialState).

  • ExecutorManager.waitFor was renamed to getOrAwait.

  • Executor.toPromise was renamed to getOrAwait.

v0.0.9

15 May 14:51
Compare
Choose a tag to compare

Changelog: v0.0.8...v0.0.9

useExecutorSubscription now relies on useSyncExternalStore instead of useState to re-render the component.

v0.0.8

15 May 14:50
Compare
Choose a tag to compare

Changelog: v0.0.7...v0.0.8

  • Custom events are supported in Executor.publish().

  • Executor.timesamp was renamed to settledAt.

  • Added Executor.invalidatedAt that stores the timestamp when the executor result was invalidated.

  • Executor.dispose was renamed to detach.

  • "configured" event was renamed to "attached".

  • Plugins publish a "plugin_configured" event when their configuration is updated.

  • Executor.isRejected and isInvalidated are now getters.

  • Executor.invalidate now accepts the timestamp of the invalidation which is set to Date.now() by default.

  • invalidateByPeers calls peerMatched only when a new peer executor is attached.

  • synchronizeStorage plugin now accepts options with a custom storageKey.

  • Executors can be annotated with arbitrary metadata:

executor.annotate({ hello: 'Bill' });

executor.annotations.hello;
// ⮕ 'Bill'
  • Devtools integration.