Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

chore(deps): bump immer from 9.0.21 to 10.0.1 #1670

Merged
merged 3 commits into from
Apr 18, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 18, 2023

Bumps immer from 9.0.21 to 10.0.1.

Release notes

Sourced from immer's releases.

v10.0.1

10.0.1 (2023-04-17)

Bug Fixes

  • production bundle was loaded incorrectly, fixes #1037 (707e72b)

v10.0.0

10.0.0 (2023-04-17)

Release notes

  • [breaking change] Immer 10 only supports modern browsers, that have support for Proxy, Reflect, Symbol and Map and Set.
  • [breaking change] There is no longer a UMD build exposed (thanks Mark Erikson for modernizing the build setup in #1032!
  • [breaking change] getters and setters are ignored by default on plain object, as this is a very uncommon case and provides a significant performance boost (ca 33%, but depends a lot on the scenario). Fixes #867, #1012. Thanks hrsh7th for implementing it in #941!
  • [breaking change] Promise based reducers are no longer supported. Conceptually it is an anti pattern to hold on to drafts over time. If needed the old behavior can still be achieved by leveraging createDraft and finishDraft.
  • [breaking change] ES5 mode (for legacy browsers) has been dropped. If your project relies on enableES5(), you SHOULD NOT upgrade Immer. enableES5 has been removed.
  • [breaking change] produce is no longer exposed as the default export. This improves eco system compatibility, and makes sure that there is only one correct way of doing things
  • [breaking change] enableAllPlugins has been removed, use enablePatches(); enableMapSet() instead
  • [breaking change] shortening the length of a JSON array now results in delete patches, rather than a mutation of the length property, in accordance with JSON spec. Thanks kshramt for implementing this in #964!
  • Immer is now an ESM package that can be directly imported into the browser. CJS should still work, UMD support has been removed.

Overall, there is a rough performance increase of 33% for Immer (and in some cases significantly higher), and the (non gzipped) bundle size has reduced from 16 to 11.5 KB, while the the minimal gzipped import of just produce has remained roughly the same at 3.3 KB.

For more details, see #1015

Migration steps

  1. If you have any enableES5() call, don't migrate
  2. When using getters/ setters icmw plain objects, call useStrictShallowCopy(true) at startup
  3. Replace all default imports: Replace import produce from "immer" with import {produce} from "immer"
  4. Replace all calls to enableAllPlugins() with enablePatches(); enableMapSet(); to be more specific and smoothen future migrations.
  5. If any producer returned a Promise, refactor it to leverage createDraft instead. Roughly:
const newState = await produce(oldState, recipe)
// becomes
const draft  = createDraft(oldState)
await recipe(draft)
const newState = finishDraft(draft)

Commits
  • 707e72b fix: production bundle was loaded incorrectly, fixes #1037
  • 2ef9a42 Merge pull request #1028 from immerjs/immer-10
  • 41ebbbc Restore mangleProps
  • 6f2a12b Merge branch 'markerikson-feature/build-tsup' into immer-10
  • 46cd1d5 Minor build fixes after tsup migration
  • d5be8f2 Remove tsdx
  • d897c6b Micro-optimize Object.getPrototypeOf uses
  • 3ad1df5 Use tsup to build and modernize build artifacts
  • 17cfe4e Output modern JS syntax
  • 3c1a668 Add tsup
  • Additional commits viewable in compare view

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 ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [immer](https://github.com/immerjs/immer) from 9.0.21 to 10.0.1.
- [Release notes](https://github.com/immerjs/immer/releases)
- [Commits](immerjs/immer@v9.0.21...v10.0.1)

---
updated-dependencies:
- dependency-name: immer
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot requested a review from a team April 18, 2023 08:03
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Apr 18, 2023
@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Merging #1670 (a9ae83d) into main (d899bab) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1670   +/-   ##
=======================================
  Coverage   65.59%   65.59%           
=======================================
  Files          71       71           
  Lines        2058     2058           
  Branches      470      470           
=======================================
  Hits         1350     1350           
  Misses        666      666           
  Partials       42       42           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sonarcloud
Copy link

sonarcloud bot commented Apr 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@kahboom kahboom merged commit b49cf7b into main Apr 18, 2023
@kahboom kahboom deleted the dependabot/npm_and_yarn/immer-10.0.1 branch April 18, 2023 10:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

1 participant