Skip to content

Conversation

chris-walz
Copy link

snyk-top-banner

Snyk has created this PR to upgrade react-sweet-state from 2.6.4 to 2.7.2.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 4 versions ahead of your current version.

  • The recommended version was released 8 months ago.

Release notes
Package name: react-sweet-state
  • 2.7.2 - 2024-08-24

    Bug fixes

    • Fix container subscription leak in StrictMode in #228
  • 2.7.1 - 2023-09-08

    ⚠️ 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 onInit might be deferred. In most cases that should improve performance, but might make some tests failing if only a container is rendered (with no subscribers).
  • 2.7.0 - 2023-08-02

    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
  • 2.6.5 - 2022-09-26

    2.6.5

  • 2.6.4 - 2022-08-15
    • Officially support React 18
    • Use React useSyncExternalStore hook
    • Officially deprecate batchUpdates setting via types, making default true for R18+
    • Change internal API (storeState.subscribe) types to no longer expose get state/store as arguments. Still available in reality to not break compat
from react-sweet-state GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

Snyk has created this PR to upgrade react-sweet-state from 2.6.4 to 2.7.2.

See this package in npm:
react-sweet-state

See this project in Snyk:
https://app.snyk.io/org/engineering-container-scanning/project/a19ed8c8-084c-4782-b944-bab9c10e1361?utm_source=github&utm_medium=referral&page=upgrade-pr
Copy link

changeset-bot bot commented May 9, 2025

⚠️ No Changeset found

Latest commit: 06f03d5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants