Skip to content

Releases: RisingStack/react-easy-state

v6.1.2

22 May 16:20
Compare
Choose a tag to compare

Fixes

  • Fixed a memory leak with the batching implementation (#85)
  • Fixed an issue with batching on IOS Safari (#84)

v6.1.1

06 Feb 10:27
Compare
Choose a tag to compare

Fixes

  • Fixed a critical issue with React hooks. Please upgrade to this patch when you upgrade React from v16.8 alpha to v16.8 stable.

v6.1.0

31 Jan 13:54
Compare
Choose a tag to compare

Changes

  • Automatic sync batching was added for native DOM event handlers to improve performance.

  • Rewrote the batching implementation to use React's unstable_batchedUpdates.

    • Components will no longer render twice if a related store and their props are both changed in a single sync batch.

    • Components are always rendered in a parent-child order in a single batch.

    • The batch function is just an alias of unstable_batchedUpdates.

  • Fixed a bug with ES6 Maps and Sets, where object values with nested data were not reactive sometimes.

  • Tests are wrapped with <StrictMode> to guarantee the compatibility with tomorrow's React.

  • Added a React Native example and test coverage for React Native.

  • Added typings for the batch function. (Thanks to moritzuehling)

  • Improved docs.

v6.0.6

25 Nov 09:44
Compare
Choose a tag to compare

Fixes

  • Fixed incorrect 'this' value in auto batched methods (like websocket.onmessage)

v6.0.5

27 Oct 12:10
Compare
Choose a tag to compare

Fixes

v6.0.4

05 Oct 16:01
Compare
Choose a tag to compare

Fixes

Added automatic batching to WebSocket handlers

v6.0.3

04 Oct 22:52
Compare
Choose a tag to compare

Critical Fix

  • Fixed Easy State breaking Promises and timers

v6.0.2

04 Oct 15:29
Compare
Choose a tag to compare

Fixes

  • Fixed a build issue

v6.0.1

04 Oct 15:26
Compare
Choose a tag to compare

Features

  • Added the batch function to manually batch updates.

Fixes

  • Added auto batching to requestAnimationFrame and requestIdleCallback.

v6.0.0

03 Oct 12:22
Compare
Choose a tag to compare
v6.0.0 Pre-release
Pre-release

Breaking changes

Changed the default bundle to ES6 (from the previous ES5 one). The project uses none polyfillable ES6 Proxies, so the ES5 build was only defaulted to support older toolchains (bundler/minifier). If you use an older toolset please follow this docs section to learn how to use the older ES5 build.

create-react-app 2 and webpack 4 should both work with the ES6 build.

Features

Added sync batching for the most common task sources for better performance. This removes the necessity of following this docs section for performance upgrades. The docs section will be removed soon.

easy-state is using vanilla setState calls behind the scenes, which has a limited batching functionality at the moment. easy-state usage usually includes a lot of data manipulation, which results in multiple setState calls. To avoid multiple re-renders easy-state now has built-in synchronous batching for common task sources (timers and promises). The below example demonstrates this:

import { store, view } from 'react-easy-state'

const clock = store({ time: new Date() })

setInterval(() => {
  clock.time = new Date()
  clock.time = new Date()
}, 1000)

const Clock = view(() => <div>clock.time.toString()</div>)

easy-state v5 would render Clock two times every second, because clock.time is set two times. easy-state v6 renders clock.time once every second, because it has a synchronous batching. In general a single synchronous block of code renders components only once.

NOTE: This batching will be removed in favor of React's own batching when it is released (hopefully in React 17).