Skip to content

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 11, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
immer ^9.0.6 -> ^10.0.0 age adoption passing confidence

Release Notes

immerjs/immer (immer)

v10.0.3

Compare Source

Bug Fixes

v10.0.2

Compare Source

Bug Fixes

v10.0.1

Compare Source

Bug Fixes

v10.0.0

Compare Source

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)

v9.0.21

Compare Source

Bug Fixes
  • ensure type exports is first in package.json export declaration (#​1018) (b6ccd0f)

v9.0.20

Compare Source

Bug Fixes

v9.0.19

Compare Source

Bug Fixes
  • don't freeze drafts returned from produce if they were passed in as draft (#​917) (46867f8)
  • produce results should never be frozen when returned from nested produces, to prevent 'hiding' drafts. Fixes #​935 (a810960)
  • release and publish from 'main' rather than 'master' branch (82acc40)
  • revert earlier fix (#​990) for recursive types (#​1014) (3eeb331)
  • Upgrade Github actions to Node 16 attempt 1 (9d4ea93)
  • Upgrade Github actions to Node 16 attempt 2 (082eecd)

v9.0.18

Compare Source

Bug Fixes

v9.0.17

Compare Source

Bug Fixes

v9.0.16

Compare Source

Bug Fixes
  • protect isDraftable against undefined constructor (#​969) (ced4563)

v9.0.15

Compare Source

Bug Fixes

v9.0.14

Compare Source

Bug Fixes
  • Use .esm.js module for backwards compatibility with old build tools (#​939) (d30d219)

v9.0.13

Compare Source

Bug Fixes
  • consistent recipe return type in produceWithPatches (#​934) (220d61d)
  • incorrect return type for async produceWithPatches (#​933) (9f7623d)

v9.0.12

Compare Source

Bug Fixes

v9.0.11

Compare Source

Bug Fixes

v9.0.10

Compare Source

Bug Fixes
  • No patches being generated for root primitive replacements. Fixes #​888 (0f96270)

v9.0.9

Compare Source

Bug Fixes
  • make sure produceWithPatches accepts promises (d80e823)

v9.0.8

Compare Source

Bug Fixes

v9.0.7

Compare Source

Bug Fixes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), 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 has been generated by Mend Renovate. View repository job log here.

@vercel
Copy link

vercel bot commented Aug 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
regex-vis ❌ Failed (Inspect) Aug 11, 2023 10:31am

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.

1 participant