[go: up one dir, main page]

Skip to content

Tags: Spades-S/immer

Tags

v9.0.6

Toggle v9.0.6's commit message
fix(security): Follow up on CVE-2020-28477 where `path: [["__proto__"…

…], "x"]` could still pollute the prototype

v9.0.5

Toggle v9.0.5's commit message
fix: release missing dist/ folder

v9.0.4

Toggle v9.0.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
chore: fix docs deployment attempt 3

v9.0.3

Toggle v9.0.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix: isPlainObject: add quick comparison between input and `Object` t…

…o short-circuit taxing `Function.toString` invocations (immerjs#805)

v9.0.2

Toggle v9.0.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix: immerjs#785 fix type inference for produce incorrectly inferring…

… promise (immerjs#786)

v9.0.1

Toggle v9.0.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix: immerjs#768 `immerable` field being lost during patch value clon…

…ing (immerjs#771)

v9.0.0

Toggle v9.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
feature: Improved typescript types

The TypeScript typings of Immer have been rewritten, and support better inference now and are more accurate. The best practices are documented here: https://immerjs.github.io/immer/typescript. Please visit that page first when running into any compile errors after updating. 

The following changes have been made:

Immer can now infer the type of the `draft` for curried producers, if they are directly passed to another function / context from which the type can be inferred. So lines like these will now be strongly typed: `setTodo(produce(draft => { draft.done = true }))`, where `setTodo` is a React state updater (for example). Fixes immerjs#720.

Immer will now better respect the original types passed to a producer, and generally not wrap any returned types with `Immutable` automatically.

BREAKING CHANGE: It is no longer allowed to return `nothing` from a recipe if the target state doesn't accept `undefined`.

BREAKING CHANGE: It is no longer allowed to return arbitrary things from a recipe. Recipes should either return nothing, or something that is assignable to the original state type. This will catch mistakes with accidental returns earlier.

v8.0.4

Toggle v8.0.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
docs: add `break` to `switch` block (immerjs#769)

I get that there's only one `case` here but for people plucking this example
and then using it to build out their own reducer, they'll immediately run into
issues as soon as they add a second `case` with no `break` in the first.

v8.0.3

Toggle v8.0.3's commit message
fix: new Immer().produce now has the same type as produce. Fixes imme…

…rjs#749

v8.0.2

Toggle v8.0.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix: Add a type-checking fast path for primitive types (immerjs#755)

When `Draft<T>` is applied to a large enum type, TypeScript has to do a
lot of unnecessary structural comparisons to confirm that no element of
the enum matches `Function`, `Date`, `RegExp`, etc.  Determining that
they do match `string` or `number`, on the other hand, is trivial.  This
change splits `PrimitiveType` out of `AtomicObject` so that the fast
path can be checked first.

In microsoft/TypeScript#42824, this cut the
check time from ~2.5 seconds to ~0.3 seconds.