Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump reselect from 4.1.8 to 5.0.0 #5993

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 4, 2023

Bumps reselect from 4.1.8 to 5.0.0.

Release notes

Sourced from reselect's releases.

v5.0.0-rc.1

This release candidate renames the original defaultMemoize function to lruMemoize, and improves dev check warnings to include a stack trace to help track down details. This release has breaking changes.

See the preview Redux Toolkit 2.0 + Redux core 5.0 Migration Guide for an overview of breaking changes in RTK 2.0 and Redux core.

npm install reselect@next
yarn add reselect@next

Changelog

Renaming defaultMemoize to lruMemoize

Reselect's createSelector originally only had one memoization function, which has always called defaultMemoize. In the previous v5.0.0-rc.0 release, we switched createSelector to use the new weakMapMemoize function as the default.

That meant that defaultMemoize was now badly named, because it isn't the default any more.

Given that, we've renamed defaultMemoize to lruMemoize, to better describe what it does.

This should not affect most Reselect users, since few apps actually customize selector setup. For those that do have references to defaultMemoize in the codebase, replace those with lruMemoize.

What's Changed

Full Changelog: reduxjs/reselect@v5.0.0-rc.0...v5.0.0-rc.1

v5.0.0-rc.0

This release candidate switches createSelector to use weakMapMemoize as the default memoization method, adds a resultEqualityCheck option to weakMapMemoize, reworks the dev mode check setup and adds a dev-mode check for result functions that look like x => x, and makes some final types tweaks. This has breaking changes.

See the preview Redux Toolkit 2.0 + Redux core 5.0 Migration Guide for an overview of breaking changes in RTK 2.0 and Redux core.

npm install reselect@next
yarn add reselect@next

Changelog

createSelector Uses weakMapMemoize By Default

Reselect's createSelector originally only had one memoization function, which has always called defaultMemoize. It's always used a customizable comparison method to compare each argument. Over time, we added more functionality, particularly in v4.1.0 where defaultMemoize gained options for {memoize, maxSize, resultEqualityCheck}.

However, defaultMemoize has limitations. The biggest one is that the default cache size is 1. This makes selector instances hard to reuse in scenarios like list items, which might call selectSomeValue(state, props.id), and thus never actually memoize due to changing arguments. There are workarounds, but they're cumbersome - using createSelectorCreator to create a customized createSelector function with a different memoization implementation, creating unique selector instances per component, or setting a fixed maxSize.

For 5.0, we added a new weakMapMemoize memoization function, which takes a different approach. It uses an internal tree of cache nodes rather than a single value or a list of values. This gives weakMapMemoize an effectively infinite cache size!

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  • @dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  • @dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  • @dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
  • @dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions

Bumps [reselect](https://github.com/reduxjs/reselect) from 4.1.8 to 5.0.0.
- [Release notes](https://github.com/reduxjs/reselect/releases)
- [Changelog](https://github.com/reduxjs/reselect/blob/master/CHANGELOG.md)
- [Commits](reduxjs/reselect@v4.1.8...v5.0.0)

---
updated-dependencies:
- dependency-name: reselect
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Dec 4, 2023
Copy link
Contributor Author

dependabot bot commented on behalf of github Dec 6, 2023

Superseded by #6003.

@dependabot dependabot bot closed this Dec 6, 2023
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/reselect-5.0.0 branch December 6, 2023 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants