Update dependency react-sweet-state to ^2.7.2
This PR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| react-sweet-state | ^2.6.5 -> ^2.7.2 |
Release Notes
atlassian/react-sweet-state (react-sweet-state)
v2.7.2
Bug fixes
- Fix container subscription leak in StrictMode in #228
v2.7.1
⚠️ Warning
This version accidentally causes a change in behaviour on React 16 with defaults.batchedUpdates unset (or set to false) on Containers that use onUpdate. Basically calling to setState inside an onUpdate might trigger a warning and the subscribers might receive the updates on next tick. We recommend staying on <= v2.7.0 until moving to React 18
Bug fix
- Removed old implementation of Container (class based) that was causing a memory leak is some circumstances. It was replaced with a functional implementation that should perform better. There is a change in behaviour tho: Container stores now get initialised lazily, when the first hook/subscriber is rendered, so
onInitmight be deferred. In most cases that should improve performance, but might make some tests failing if only a container is rendered (with no subscribers).
v2.7.0
New features
Until now, containers were exclusively bound to a single store, they would trigger actions based on the container component lifecycle and would require knowledge of the store and actions. We developed a new API that evolves the concept to be more flexible by inverting the relationship: containers act as boundaries for all stores that declare that they are containedBy it. This enables some great properties:
- a container can be shared across multiple stores forming a single boundary
- containers are super lightweight and can be imported anywhere without bundling the store
- the stores themselves can declare their own lifecycle handlers
- stores that specify containedBy but end up in a tree without container, will trigger an async error, making possible to track unintended global store leaks. Read more in the new Container docs.
The old container API still exists and is supported, as it makes sense in other contexts like tests, but we recommend the new API for production use cases.
This release also:
- improved performance on pages with thousands of listeners for a single store
- enabled Devtools tracing by default
Configuration
📅 Schedule: Branch creation - "on friday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.