Skip to content

Releases: davidgilbertson/react-recollect

v4.0.3

09 Mar 08:08
Compare
Choose a tag to compare

Downgrades the errors when a user reads from or writes to the 'wrong' store. These are now a console.error rather than throw Error().

v4.0.2

07 Mar 06:18
Compare
Choose a tag to compare

Fixes an issue server-rendering with Next.js

v4.0.1

05 Mar 07:51
Compare
Choose a tag to compare

Fixes ReferenceError: window is not defined in Node.js.

v4.0.0

05 Mar 02:24
Compare
Choose a tag to compare

New stuff

  • The new batch function allows making multiple changes to the store, while only triggering a single update to components.
  • Support for Map and Set objects in the store.
  • Support for Symbol keys
  • Simplified ref forwarding. The complicated forwardRef logic has been removed. Instead, to pass a ref into a component wrapped in collect, just use a prop name other than ref.

Breaking changes

  • The shape of the event object passed to the afterChange callback has changed.
    • Prop paths are now arrays. E.g. if a task was marked as done, the 'path' of this change would be ['tasks', 2, 'done'], whereas previously it was store.tasks.2.done.
    • The components prop has been renamed to updatedComponents
    • The propPath prop has been renamed to changedProps, and is now an array of all changed paths that triggered an update.
  • Updating the store during a render (technically, a collection cycle) now results in an error. This includes code in componentDidMount(). This should help catch subtle bugs.

Other stuff

  • Recollect is now 100% TypeScript

v3.1.2

31 Jan 20:46
Compare
Choose a tag to compare
3.1.2

v3.1.0

01 Dec 22:12
Compare
Choose a tag to compare

A significant performance improvement under some circumstances.

For example, if you had a large array of stock prices and fetch an update from the network and apply it to the store. You want to apply the new data to each one, but some prices may be the same as the previous value.

Now, if an update would have no effect it's short circuited and the store object isn't even updated.

Tests in tests/unit/nonReactStatics.test.js

Diff of 3.0.0 and 3.1.0

v3.0.0

25 Nov 04:37
Compare
Choose a tag to compare
  • Condensed the afterChange callback parameters into a single object
  • Fixed a bug when setting the store multiple times in a event handler (e.g. onClick)
  • Allow passing a ref to a collected component

Full diff of v2.4.0 to v3.0.0

v2.4.0

24 Nov 10:10
Compare
Choose a tag to compare
  • Now works with server-side rendering, with a new function initStore.

v2.3.0

23 Nov 21:28
Compare
Choose a tag to compare
  • Hoist non-react statics
  • Include index.d.ts in the npm package
  • Add docs for 'selector pattern'

v2.2.1

18 Nov 09:18
Compare
Choose a tag to compare