Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork867
Releases: immerjs/immer
Releases · immerjs/immer
v10.2.0
e1996ce This commit was created on GitHub.com and signed with GitHub’sverified signature.
v10.1.3
85faaa2 This commit was created on GitHub.com and signed with GitHub’sverified signature.
Assets2
Uh oh!
There was an error while loading.Please reload this page.
4 people reacted
v10.1.2
062210e This commit was created on GitHub.com and signed with GitHub’sverified signature.
v10.1.1
e2d222b This commit was created on GitHub.com and signed with GitHub’sverified signature.
v10.1.0
53e3203 This commit was created on GitHub.com and signed with GitHub’sverified signature.
10.1.0 (2024-04-27)
Features
- performance: Make non-strict mode faster for classes. Addresses#1071 (53e3203). Immer 10.x solved slow iteration for plain JS objects. This update applies the same handling to class instances. In cases this makes class instance handling 3 times faster. Note that this slightly modifies the behavior of Immer with classes in obscure corner cases, in ways that match current documentation, but do not match previous behavior. If you run into issues with this release icmw. class instances, use
setUseStrictShallowCopy("class_only")to revert to the old behavior. For more details seehttps://immerjs.github.io/immer/complex-objects#semantics-in-detail
Assets2
Uh oh!
There was an error while loading.Please reload this page.
v10.0.4
v10.0.3
f6736a4 This commit was created on GitHub.com and signed with GitHub’sverified signature. The key has expired.
v10.0.2
75e004d This commit was created on GitHub.com and signed with GitHub’sverified signature. The key has expired.
v10.0.1
Assets2
Uh oh!
There was an error while loading.Please reload this page.
4 people reacted
v10.0.0
2ef9a42 This commit was created on GitHub.com and signed with GitHub’sverified signature. The key has expired.
10.0.0 (2023-04-17)
Release notes
- [breaking change] Immer 10 only supports modern browsers, that have support for
Proxy,Reflect,SymbolandMapandSet. - [breaking change] There is no longer a UMD build exposed (thanksMark 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. Thankshrsh7th 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
createDraftandfinishDraft. - [breaking change] ES5 mode (for legacy browsers) has been dropped. If your project relies on
enableES5(), you SHOULD NOT upgrade Immer.enableES5has been removed. - [breaking change]
produceis no longer exposed as thedefaultexport. This improves eco system compatibility, and makes sure that there is only one correct way of doing things - [breaking change]
enableAllPluginshas been removed, useenablePatches(); enableMapSet()instead - [breaking change] shortening the length of a JSON array now results in delete patches, rather than a mutation of the
lengthproperty, in accordance with JSON spec. Thankskshramt 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 justproduce has remained roughly the same at 3.3 KB.
For more details, see#1015
Migration steps
- If you have any
enableES5()call, don't migrate - When using getters/ setters icmw plain objects, call
useStrictShallowCopy(true)at startup - Replace all default imports: Replace
import produce from "immer"withimport {produce} from "immer" - Replace all calls to
enableAllPlugins()withenablePatches(); enableMapSet();to be more specific and smoothen future migrations. - If any producer returned a Promise, refactor it to leverage
createDraftinstead. Roughly:
constnewState=awaitproduce(oldState,recipe)// becomesconstdraft=createDraft(oldState)awaitrecipe(draft)constnewState=finishDraft(draft)
Assets2
Uh oh!
There was an error while loading.Please reload this page.
68 people reacted