Skip to content
Myr

Preserve error codes in production

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Michel Weststrate · committed by Michel Weststrate · parent 718b7f6 · Browse files · 19 files+190 added−152 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

19 files+190 added−152 removed

  • tests:+90 added−90 removed
  • other:+100 added−62 removed

19 files+190 added−152 removed

modified:__tests__/__snapshots__/base.js.snap+68 added-68 removed
1// Jest Snapshot v1, https://goo.gl/fbAQLP23exports[`base functionality - es5 (autofreeze) async recipe function works with rejected promises 1`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":0,\\"b\\":1}"`;3exports[`base functionality - es5 (autofreeze) async recipe function works with rejected promises 1`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":0,\\"b\\":1}"`;45exports[`base functionality - es5 (autofreeze) recipe functions cannot return a modified child draft 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;5exports[`base functionality - es5 (autofreeze) recipe functions cannot return a modified child draft 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;67exports[`base functionality - es5 (autofreeze) recipe functions cannot return an object that references itself 1`] = `"Invariant failed: Immer forbids circular references"`;7exports[`base functionality - es5 (autofreeze) recipe functions cannot return an object that references itself 1`] = `"[Immer] Immer forbids circular references"`;89exports[`base functionality - es5 (autofreeze) revokes the draft once produce returns 1`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;9exports[`base functionality - es5 (autofreeze) revokes the draft once produce returns 1`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;1011exports[`base functionality - es5 (autofreeze) revokes the draft once produce returns 2`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;11exports[`base functionality - es5 (autofreeze) revokes the draft once produce returns 2`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;1213exports[`base functionality - es5 (autofreeze) revokes the draft once produce returns 3`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;13exports[`base functionality - es5 (autofreeze) revokes the draft once produce returns 3`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;1415exports[`base functionality - es5 (autofreeze) revokes the draft once produce returns 4`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;15exports[`base functionality - es5 (autofreeze) revokes the draft once produce returns 4`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;1617exports[`base functionality - es5 (autofreeze) throws on computed properties 1`] = `"Invariant failed: Immer drafts cannot have computed properties"`;17exports[`base functionality - es5 (autofreeze) throws on computed properties 1`] = `"[Immer] Immer drafts cannot have computed properties"`;1819exports[`base functionality - es5 (autofreeze) throws when the draft is modified and another object is returned 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;19exports[`base functionality - es5 (autofreeze) throws when the draft is modified and another object is returned 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;2021exports[`base functionality - es5 (autofreeze)(patch listener) async recipe function works with rejected promises 1`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":0,\\"b\\":1}"`;21exports[`base functionality - es5 (autofreeze)(patch listener) async recipe function works with rejected promises 1`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":0,\\"b\\":1}"`;2223exports[`base functionality - es5 (autofreeze)(patch listener) recipe functions cannot return a modified child draft 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;23exports[`base functionality - es5 (autofreeze)(patch listener) recipe functions cannot return a modified child draft 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;2425exports[`base functionality - es5 (autofreeze)(patch listener) recipe functions cannot return an object that references itself 1`] = `"Invariant failed: Immer forbids circular references"`;25exports[`base functionality - es5 (autofreeze)(patch listener) recipe functions cannot return an object that references itself 1`] = `"[Immer] Immer forbids circular references"`;2627exports[`base functionality - es5 (autofreeze)(patch listener) revokes the draft once produce returns 1`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;27exports[`base functionality - es5 (autofreeze)(patch listener) revokes the draft once produce returns 1`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;2829exports[`base functionality - es5 (autofreeze)(patch listener) revokes the draft once produce returns 2`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;29exports[`base functionality - es5 (autofreeze)(patch listener) revokes the draft once produce returns 2`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;3031exports[`base functionality - es5 (autofreeze)(patch listener) revokes the draft once produce returns 3`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;31exports[`base functionality - es5 (autofreeze)(patch listener) revokes the draft once produce returns 3`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;3233exports[`base functionality - es5 (autofreeze)(patch listener) revokes the draft once produce returns 4`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;33exports[`base functionality - es5 (autofreeze)(patch listener) revokes the draft once produce returns 4`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;3435exports[`base functionality - es5 (autofreeze)(patch listener) throws on computed properties 1`] = `"Invariant failed: Immer drafts cannot have computed properties"`;35exports[`base functionality - es5 (autofreeze)(patch listener) throws on computed properties 1`] = `"[Immer] Immer drafts cannot have computed properties"`;3637exports[`base functionality - es5 (autofreeze)(patch listener) throws when the draft is modified and another object is returned 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;37exports[`base functionality - es5 (autofreeze)(patch listener) throws when the draft is modified and another object is returned 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;3839exports[`base functionality - es5 (no freeze) async recipe function works with rejected promises 1`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":0,\\"b\\":1}"`;39exports[`base functionality - es5 (no freeze) async recipe function works with rejected promises 1`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":0,\\"b\\":1}"`;4041exports[`base functionality - es5 (no freeze) recipe functions cannot return a modified child draft 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;41exports[`base functionality - es5 (no freeze) recipe functions cannot return a modified child draft 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;4243exports[`base functionality - es5 (no freeze) recipe functions cannot return an object that references itself 1`] = `"Invariant failed: Immer forbids circular references"`;43exports[`base functionality - es5 (no freeze) recipe functions cannot return an object that references itself 1`] = `"[Immer] Immer forbids circular references"`;4445exports[`base functionality - es5 (no freeze) revokes the draft once produce returns 1`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;45exports[`base functionality - es5 (no freeze) revokes the draft once produce returns 1`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;4647exports[`base functionality - es5 (no freeze) revokes the draft once produce returns 2`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;47exports[`base functionality - es5 (no freeze) revokes the draft once produce returns 2`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;4849exports[`base functionality - es5 (no freeze) revokes the draft once produce returns 3`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;49exports[`base functionality - es5 (no freeze) revokes the draft once produce returns 3`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;5051exports[`base functionality - es5 (no freeze) revokes the draft once produce returns 4`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;51exports[`base functionality - es5 (no freeze) revokes the draft once produce returns 4`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;5253exports[`base functionality - es5 (no freeze) throws on computed properties 1`] = `"Invariant failed: Immer drafts cannot have computed properties"`;53exports[`base functionality - es5 (no freeze) throws on computed properties 1`] = `"[Immer] Immer drafts cannot have computed properties"`;5455exports[`base functionality - es5 (no freeze) throws when the draft is modified and another object is returned 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;55exports[`base functionality - es5 (no freeze) throws when the draft is modified and another object is returned 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;5657exports[`base functionality - es5 (patch listener) async recipe function works with rejected promises 1`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":0,\\"b\\":1}"`;57exports[`base functionality - es5 (patch listener) async recipe function works with rejected promises 1`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":0,\\"b\\":1}"`;5859exports[`base functionality - es5 (patch listener) recipe functions cannot return a modified child draft 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;59exports[`base functionality - es5 (patch listener) recipe functions cannot return a modified child draft 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;6061exports[`base functionality - es5 (patch listener) recipe functions cannot return an object that references itself 1`] = `"Invariant failed: Immer forbids circular references"`;61exports[`base functionality - es5 (patch listener) recipe functions cannot return an object that references itself 1`] = `"[Immer] Immer forbids circular references"`;6263exports[`base functionality - es5 (patch listener) revokes the draft once produce returns 1`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;63exports[`base functionality - es5 (patch listener) revokes the draft once produce returns 1`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;6465exports[`base functionality - es5 (patch listener) revokes the draft once produce returns 2`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;65exports[`base functionality - es5 (patch listener) revokes the draft once produce returns 2`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":1}"`;6667exports[`base functionality - es5 (patch listener) revokes the draft once produce returns 3`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;67exports[`base functionality - es5 (patch listener) revokes the draft once produce returns 3`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;6869exports[`base functionality - es5 (patch listener) revokes the draft once produce returns 4`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;69exports[`base functionality - es5 (patch listener) revokes the draft once produce returns 4`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? [1]"`;7071exports[`base functionality - es5 (patch listener) throws on computed properties 1`] = `"Invariant failed: Immer drafts cannot have computed properties"`;71exports[`base functionality - es5 (patch listener) throws on computed properties 1`] = `"[Immer] Immer drafts cannot have computed properties"`;7273exports[`base functionality - es5 (patch listener) throws when the draft is modified and another object is returned 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;73exports[`base functionality - es5 (patch listener) throws when the draft is modified and another object is returned 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;7475exports[`base functionality - proxy (autofreeze) array drafts throws when a non-numeric property is added 1`] = `"Invariant failed: Immer only supports setting array indices and the 'length' property"`;75exports[`base functionality - proxy (autofreeze) array drafts throws when a non-numeric property is added 1`] = `"[Immer] Immer only supports setting array indices and the 'length' property"`;7677exports[`base functionality - proxy (autofreeze) array drafts throws when a non-numeric property is deleted 1`] = `"Invariant failed: Immer only supports deleting array indices"`;77exports[`base functionality - proxy (autofreeze) array drafts throws when a non-numeric property is deleted 1`] = `"[Immer] Immer only supports deleting array indices"`;7879exports[`base functionality - proxy (autofreeze) async recipe function works with rejected promises 1`] = `"Cannot perform 'get' on a proxy that has been revoked"`;8081exports[`base functionality - proxy (autofreeze) recipe functions cannot return a modified child draft 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;81exports[`base functionality - proxy (autofreeze) recipe functions cannot return a modified child draft 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;8283exports[`base functionality - proxy (autofreeze) recipe functions cannot return an object that references itself 1`] = `"Invariant failed: Immer forbids circular references"`;83exports[`base functionality - proxy (autofreeze) recipe functions cannot return an object that references itself 1`] = `"[Immer] Immer forbids circular references"`;8485exports[`base functionality - proxy (autofreeze) revokes the draft once produce returns 1`] = `"Cannot perform 'get' on a proxy that has been revoked"`;8687exports[`base functionality - proxy (autofreeze) revokes the draft once produce returns 2`] = `"Cannot perform 'set' on a proxy that has been revoked"`;
9 unmodified lines
97exports[`base functionality - proxy (autofreeze) revokes the draft once produce returns 7`] = `"Cannot perform 'get' on a proxy that has been revoked"`;9899exports[`base functionality - proxy (autofreeze) revokes the draft once produce returns 8`] = `"Cannot perform 'set' on a proxy that has been revoked"`;100101exports[`base functionality - proxy (autofreeze) throws on computed properties 1`] = `"Invariant failed: Immer drafts cannot have computed properties"`;101exports[`base functionality - proxy (autofreeze) throws on computed properties 1`] = `"[Immer] Immer drafts cannot have computed properties"`;102103exports[`base functionality - proxy (autofreeze) throws when Object.defineProperty() is used on drafts 1`] = `"Invariant failed: Object.defineProperty() cannot be used on an Immer draft"`;103exports[`base functionality - proxy (autofreeze) throws when Object.defineProperty() is used on drafts 1`] = `"[Immer] Object.defineProperty() cannot be used on an Immer draft"`;104105exports[`base functionality - proxy (autofreeze) throws when Object.setPrototypeOf() is used on a draft 1`] = `"Invariant failed: Object.setPrototypeOf() cannot be used on an Immer draft"`;105exports[`base functionality - proxy (autofreeze) throws when Object.setPrototypeOf() is used on a draft 1`] = `"[Immer] Object.setPrototypeOf() cannot be used on an Immer draft"`;106107exports[`base functionality - proxy (autofreeze) throws when the draft is modified and another object is returned 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;107exports[`base functionality - proxy (autofreeze) throws when the draft is modified and another object is returned 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;108109exports[`base functionality - proxy (autofreeze)(patch listener) array drafts throws when a non-numeric property is added 1`] = `"Invariant failed: Immer only supports setting array indices and the 'length' property"`;109exports[`base functionality - proxy (autofreeze)(patch listener) array drafts throws when a non-numeric property is added 1`] = `"[Immer] Immer only supports setting array indices and the 'length' property"`;110111exports[`base functionality - proxy (autofreeze)(patch listener) array drafts throws when a non-numeric property is deleted 1`] = `"Invariant failed: Immer only supports deleting array indices"`;111exports[`base functionality - proxy (autofreeze)(patch listener) array drafts throws when a non-numeric property is deleted 1`] = `"[Immer] Immer only supports deleting array indices"`;112113exports[`base functionality - proxy (autofreeze)(patch listener) async recipe function works with rejected promises 1`] = `"Cannot perform 'get' on a proxy that has been revoked"`;114115exports[`base functionality - proxy (autofreeze)(patch listener) recipe functions cannot return a modified child draft 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;115exports[`base functionality - proxy (autofreeze)(patch listener) recipe functions cannot return a modified child draft 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;116117exports[`base functionality - proxy (autofreeze)(patch listener) recipe functions cannot return an object that references itself 1`] = `"Invariant failed: Immer forbids circular references"`;117exports[`base functionality - proxy (autofreeze)(patch listener) recipe functions cannot return an object that references itself 1`] = `"[Immer] Immer forbids circular references"`;118119exports[`base functionality - proxy (autofreeze)(patch listener) revokes the draft once produce returns 1`] = `"Cannot perform 'get' on a proxy that has been revoked"`;120121exports[`base functionality - proxy (autofreeze)(patch listener) revokes the draft once produce returns 2`] = `"Cannot perform 'set' on a proxy that has been revoked"`;
9 unmodified lines
131exports[`base functionality - proxy (autofreeze)(patch listener) revokes the draft once produce returns 7`] = `"Cannot perform 'get' on a proxy that has been revoked"`;132133exports[`base functionality - proxy (autofreeze)(patch listener) revokes the draft once produce returns 8`] = `"Cannot perform 'set' on a proxy that has been revoked"`;134135exports[`base functionality - proxy (autofreeze)(patch listener) throws on computed properties 1`] = `"Invariant failed: Immer drafts cannot have computed properties"`;135exports[`base functionality - proxy (autofreeze)(patch listener) throws on computed properties 1`] = `"[Immer] Immer drafts cannot have computed properties"`;136137exports[`base functionality - proxy (autofreeze)(patch listener) throws when Object.defineProperty() is used on drafts 1`] = `"Invariant failed: Object.defineProperty() cannot be used on an Immer draft"`;137exports[`base functionality - proxy (autofreeze)(patch listener) throws when Object.defineProperty() is used on drafts 1`] = `"[Immer] Object.defineProperty() cannot be used on an Immer draft"`;138139exports[`base functionality - proxy (autofreeze)(patch listener) throws when Object.setPrototypeOf() is used on a draft 1`] = `"Invariant failed: Object.setPrototypeOf() cannot be used on an Immer draft"`;139exports[`base functionality - proxy (autofreeze)(patch listener) throws when Object.setPrototypeOf() is used on a draft 1`] = `"[Immer] Object.setPrototypeOf() cannot be used on an Immer draft"`;140141exports[`base functionality - proxy (autofreeze)(patch listener) throws when the draft is modified and another object is returned 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;141exports[`base functionality - proxy (autofreeze)(patch listener) throws when the draft is modified and another object is returned 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;142143exports[`base functionality - proxy (no freeze) array drafts throws when a non-numeric property is added 1`] = `"Invariant failed: Immer only supports setting array indices and the 'length' property"`;143exports[`base functionality - proxy (no freeze) array drafts throws when a non-numeric property is added 1`] = `"[Immer] Immer only supports setting array indices and the 'length' property"`;144145exports[`base functionality - proxy (no freeze) array drafts throws when a non-numeric property is deleted 1`] = `"Invariant failed: Immer only supports deleting array indices"`;145exports[`base functionality - proxy (no freeze) array drafts throws when a non-numeric property is deleted 1`] = `"[Immer] Immer only supports deleting array indices"`;146147exports[`base functionality - proxy (no freeze) async recipe function works with rejected promises 1`] = `"Cannot perform 'get' on a proxy that has been revoked"`;148149exports[`base functionality - proxy (no freeze) recipe functions cannot return a modified child draft 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;149exports[`base functionality - proxy (no freeze) recipe functions cannot return a modified child draft 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;150151exports[`base functionality - proxy (no freeze) recipe functions cannot return an object that references itself 1`] = `"Invariant failed: Immer forbids circular references"`;151exports[`base functionality - proxy (no freeze) recipe functions cannot return an object that references itself 1`] = `"[Immer] Immer forbids circular references"`;152153exports[`base functionality - proxy (no freeze) revokes the draft once produce returns 1`] = `"Cannot perform 'get' on a proxy that has been revoked"`;154155exports[`base functionality - proxy (no freeze) revokes the draft once produce returns 2`] = `"Cannot perform 'set' on a proxy that has been revoked"`;
9 unmodified lines
165exports[`base functionality - proxy (no freeze) revokes the draft once produce returns 7`] = `"Cannot perform 'get' on a proxy that has been revoked"`;166167exports[`base functionality - proxy (no freeze) revokes the draft once produce returns 8`] = `"Cannot perform 'set' on a proxy that has been revoked"`;168169exports[`base functionality - proxy (no freeze) throws on computed properties 1`] = `"Invariant failed: Immer drafts cannot have computed properties"`;169exports[`base functionality - proxy (no freeze) throws on computed properties 1`] = `"[Immer] Immer drafts cannot have computed properties"`;170171exports[`base functionality - proxy (no freeze) throws when Object.defineProperty() is used on drafts 1`] = `"Invariant failed: Object.defineProperty() cannot be used on an Immer draft"`;171exports[`base functionality - proxy (no freeze) throws when Object.defineProperty() is used on drafts 1`] = `"[Immer] Object.defineProperty() cannot be used on an Immer draft"`;172173exports[`base functionality - proxy (no freeze) throws when Object.setPrototypeOf() is used on a draft 1`] = `"Invariant failed: Object.setPrototypeOf() cannot be used on an Immer draft"`;173exports[`base functionality - proxy (no freeze) throws when Object.setPrototypeOf() is used on a draft 1`] = `"[Immer] Object.setPrototypeOf() cannot be used on an Immer draft"`;174175exports[`base functionality - proxy (no freeze) throws when the draft is modified and another object is returned 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;175exports[`base functionality - proxy (no freeze) throws when the draft is modified and another object is returned 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;176177exports[`base functionality - proxy (patch listener) array drafts throws when a non-numeric property is added 1`] = `"Invariant failed: Immer only supports setting array indices and the 'length' property"`;177exports[`base functionality - proxy (patch listener) array drafts throws when a non-numeric property is added 1`] = `"[Immer] Immer only supports setting array indices and the 'length' property"`;178179exports[`base functionality - proxy (patch listener) array drafts throws when a non-numeric property is deleted 1`] = `"Invariant failed: Immer only supports deleting array indices"`;179exports[`base functionality - proxy (patch listener) array drafts throws when a non-numeric property is deleted 1`] = `"[Immer] Immer only supports deleting array indices"`;180181exports[`base functionality - proxy (patch listener) async recipe function works with rejected promises 1`] = `"Cannot perform 'get' on a proxy that has been revoked"`;182183exports[`base functionality - proxy (patch listener) recipe functions cannot return a modified child draft 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;183exports[`base functionality - proxy (patch listener) recipe functions cannot return a modified child draft 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;184185exports[`base functionality - proxy (patch listener) recipe functions cannot return an object that references itself 1`] = `"Invariant failed: Immer forbids circular references"`;185exports[`base functionality - proxy (patch listener) recipe functions cannot return an object that references itself 1`] = `"[Immer] Immer forbids circular references"`;186187exports[`base functionality - proxy (patch listener) revokes the draft once produce returns 1`] = `"Cannot perform 'get' on a proxy that has been revoked"`;188189exports[`base functionality - proxy (patch listener) revokes the draft once produce returns 2`] = `"Cannot perform 'set' on a proxy that has been revoked"`;
9 unmodified lines
199exports[`base functionality - proxy (patch listener) revokes the draft once produce returns 7`] = `"Cannot perform 'get' on a proxy that has been revoked"`;200201exports[`base functionality - proxy (patch listener) revokes the draft once produce returns 8`] = `"Cannot perform 'set' on a proxy that has been revoked"`;202203exports[`base functionality - proxy (patch listener) throws on computed properties 1`] = `"Invariant failed: Immer drafts cannot have computed properties"`;203exports[`base functionality - proxy (patch listener) throws on computed properties 1`] = `"[Immer] Immer drafts cannot have computed properties"`;204205exports[`base functionality - proxy (patch listener) throws when Object.defineProperty() is used on drafts 1`] = `"Invariant failed: Object.defineProperty() cannot be used on an Immer draft"`;205exports[`base functionality - proxy (patch listener) throws when Object.defineProperty() is used on drafts 1`] = `"[Immer] Object.defineProperty() cannot be used on an Immer draft"`;206207exports[`base functionality - proxy (patch listener) throws when Object.setPrototypeOf() is used on a draft 1`] = `"Invariant failed: Object.setPrototypeOf() cannot be used on an Immer draft"`;207exports[`base functionality - proxy (patch listener) throws when Object.setPrototypeOf() is used on a draft 1`] = `"[Immer] Object.setPrototypeOf() cannot be used on an Immer draft"`;208209exports[`base functionality - proxy (patch listener) throws when the draft is modified and another object is returned 1`] = `"Invariant failed: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;209exports[`base functionality - proxy (patch listener) throws when the draft is modified and another object is returned 1`] = `"[Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."`;210211exports[`complex nesting map / set / object modify deep object 1`] = `212Object {213 "map": Map {
372 unmodified lines
modified:__tests__/__snapshots__/curry.js.snap+8 added-8 removed
1// Jest Snapshot v1, https://goo.gl/fbAQLP23exports[`curry - es5 should check arguments 1`] = `"Invariant failed: The first or second argument to \`produce\` must be a function"`;3exports[`curry - es5 should check arguments 1`] = `"[Immer] The first or second argument to \`produce\` must be a function"`;45exports[`curry - es5 should check arguments 2`] = `"Invariant failed: The first or second argument to \`produce\` must be a function"`;5exports[`curry - es5 should check arguments 2`] = `"[Immer] The first or second argument to \`produce\` must be a function"`;67exports[`curry - es5 should check arguments 3`] = `"Invariant failed: The first or second argument to \`produce\` must be a function"`;7exports[`curry - es5 should check arguments 3`] = `"[Immer] The first or second argument to \`produce\` must be a function"`;89exports[`curry - es5 should check arguments 4`] = `"Invariant failed: The third argument to \`produce\` must be a function or undefined"`;9exports[`curry - es5 should check arguments 4`] = `"[Immer] The third argument to \`produce\` must be a function or undefined"`;1011exports[`curry - proxy should check arguments 1`] = `"Invariant failed: The first or second argument to \`produce\` must be a function"`;11exports[`curry - proxy should check arguments 1`] = `"[Immer] The first or second argument to \`produce\` must be a function"`;1213exports[`curry - proxy should check arguments 2`] = `"Invariant failed: The first or second argument to \`produce\` must be a function"`;13exports[`curry - proxy should check arguments 2`] = `"[Immer] The first or second argument to \`produce\` must be a function"`;1415exports[`curry - proxy should check arguments 3`] = `"Invariant failed: The first or second argument to \`produce\` must be a function"`;15exports[`curry - proxy should check arguments 3`] = `"[Immer] The first or second argument to \`produce\` must be a function"`;1617exports[`curry - proxy should check arguments 4`] = `"Invariant failed: The third argument to \`produce\` must be a function or undefined"`;17exports[`curry - proxy should check arguments 4`] = `"[Immer] The third argument to \`produce\` must be a function or undefined"`;
modified:__tests__/__snapshots__/manual.js.snap+10 added-10 removed
1// Jest Snapshot v1, https://goo.gl/fbAQLP23exports[`manual - es5 cannot modify after finish 1`] = `"Invariant failed: Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":2}"`;3exports[`manual - es5 cannot modify after finish 1`] = `"[Immer] Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":2}"`;45exports[`manual - es5 should check arguments 1`] = `"Invariant failed: First argument to \`createDraft\` must be a plain object, an array, or an immerable object"`;5exports[`manual - es5 should check arguments 1`] = `"[Immer] First argument to \`createDraft\` must be a plain object, an array, or an immerable object"`;67exports[`manual - es5 should check arguments 2`] = `"Invariant failed: First argument to \`createDraft\` must be a plain object, an array, or an immerable object"`;7exports[`manual - es5 should check arguments 2`] = `"[Immer] First argument to \`createDraft\` must be a plain object, an array, or an immerable object"`;89exports[`manual - es5 should check arguments 3`] = `"Invariant failed: First argument to \`finishDraft\` must be a draft returned by \`createDraft\`"`;9exports[`manual - es5 should check arguments 3`] = `"[Immer] First argument to \`finishDraft\` must be a draft returned by \`createDraft\`"`;1011exports[`manual - es5 should not finish drafts from produce 1`] = `"Invariant failed: First argument to \`finishDraft\` must be a draft returned by \`createDraft\`"`;11exports[`manual - es5 should not finish drafts from produce 1`] = `"[Immer] First argument to \`finishDraft\` must be a draft returned by \`createDraft\`"`;1213exports[`manual - es5 should not finish twice 1`] = `"Invariant failed: The given draft is already finalized"`;13exports[`manual - es5 should not finish twice 1`] = `"[Immer] The given draft is already finalized"`;1415exports[`manual - es5 should support patches drafts 1`] = `16Array [17 Array [
33 unmodified lines
51`;5253exports[`manual - proxy cannot modify after finish 1`] = `"Cannot perform 'set' on a proxy that has been revoked"`;5455exports[`manual - proxy should check arguments 1`] = `"Invariant failed: First argument to \`createDraft\` must be a plain object, an array, or an immerable object"`;55exports[`manual - proxy should check arguments 1`] = `"[Immer] First argument to \`createDraft\` must be a plain object, an array, or an immerable object"`;5657exports[`manual - proxy should check arguments 2`] = `"Invariant failed: First argument to \`createDraft\` must be a plain object, an array, or an immerable object"`;57exports[`manual - proxy should check arguments 2`] = `"[Immer] First argument to \`createDraft\` must be a plain object, an array, or an immerable object"`;5859exports[`manual - proxy should check arguments 3`] = `"Invariant failed: First argument to \`finishDraft\` must be a draft returned by \`createDraft\`"`;59exports[`manual - proxy should check arguments 3`] = `"[Immer] First argument to \`finishDraft\` must be a draft returned by \`createDraft\`"`;6061exports[`manual - proxy should not finish drafts from produce 1`] = `"Invariant failed: First argument to \`finishDraft\` must be a draft returned by \`createDraft\`"`;61exports[`manual - proxy should not finish drafts from produce 1`] = `"[Immer] First argument to \`finishDraft\` must be a draft returned by \`createDraft\`"`;6263exports[`manual - proxy should not finish twice 1`] = `"Cannot perform 'get' on a proxy that has been revoked"`;6465exports[`manual - proxy should support patches drafts 1`] = `
36 unmodified lines
modified:__tests__/__snapshots__/patch.js.snap+3 added-3 removed
1// Jest Snapshot v1, https://goo.gl/fbAQLP23exports[`applyPatches throws when \`op\` is not "add", "replace", nor "remove" 1`] = `"Invariant failed: Unsupported patch operation: copy"`;3exports[`applyPatches throws when \`op\` is not "add", "replace", nor "remove" 1`] = `"[Immer] Unsupported patch operation: copy"`;45exports[`applyPatches throws when \`path\` cannot be resolved 1`] = `"Invariant failed: Cannot apply patch, path doesn't resolve: a/b"`;5exports[`applyPatches throws when \`path\` cannot be resolved 1`] = `"[Immer] Cannot apply patch, path doesn't resolve: a/b"`;67exports[`applyPatches throws when \`path\` cannot be resolved 2`] = `"Invariant failed: Cannot apply patch, path doesn't resolve: a/b/c"`;7exports[`applyPatches throws when \`path\` cannot be resolved 2`] = `"[Immer] Cannot apply patch, path doesn't resolve: a/b/c"`;
modified:__tests__/readme.js+1 added-1 removed
231 unmodified lines
232 // The old one was never modified233 expect(usersById_v1.size).toBe(0)234 // And trying to change a Map outside a producers is going to: NO!235 expect(() => usersById_v3.clear()).toThrowErrorMatchingInlineSnapshot(236 `"Invariant failed: This object has been frozen and should not be mutated"`236 `"[Immer] This object has been frozen and should not be mutated"`237 )238})
modified:src/plugins/es5.ts+6 added-2 removed
9 unmodified lines
10 isDraftable,11 shallowCopy,12 latest,13 DRAFT_STATE,14 assertUnrevoked,14 is,15 loadPlugin,16 ImmerScope,17 createProxy,18 ProxyTypeES5Array,19 ProxyTypeES5Object,21 AnyObject20 AnyObject,21 die22} from "../internal"2324type ES5State = ES5ArrayState | ES5ObjectState25
274 unmodified lines
300 const desc = Object.getOwnPropertyDescriptor(base, prop)301 return desc && desc.enumerable ? true : false302 }303304 function assertUnrevoked(state: any /*ES5State | MapState | SetState*/) {305 if (state.revoked_) die(3, JSON.stringify(latest(state)))306 }307308 loadPlugin("es5", {309 createES5Proxy_,310 markChangedES5_,311 willFinalizeES5_
2 unmodified lines
modified:src/plugins/mapset.ts+6 added-6 removed
6 unmodified lines
7 SetState,8 DRAFT_STATE,9 ImmerScope,10 latest,11 assertUnrevoked,11 iteratorSymbol,12 isDraftable,13 createProxy,14 loadPlugin,15 markChanged,16 ProxyTypeMap,18 ProxyTypeSet17 ProxyTypeSet,18 die19} from "../internal"20import invariant from "tiny-invariant"2021export function enableMapSet() {22 /* istanbul ignore next */23 var extendStatics = function(d: any, b: any): any {
20 unmodified lines
44 ((__.prototype = b.prototype), new __())45 }4647 const DraftMap = (function(_super) {49 invariant(_super, "Map is not polyfilled")48 __extends(DraftMap, _super)49 // Create class manually, cause #50250 function DraftMap(this: any, target: AnyMap, parent?: ImmerState): any {51 this[DRAFT_STATE] = {
146 unmodified lines
198 }199 }200201 const DraftSet = (function(_super) {204 invariant(_super, "Set is not polyfilled")205202 __extends(DraftSet, _super)203 // Create class manually, cause #502204 function DraftSet(this: any, target: AnySet, parent?: ImmerState) {205 this[DRAFT_STATE] = {
125 unmodified lines
331 })332 }333 }334335 function assertUnrevoked(state: any /*ES5State | MapState | SetState*/) {336 if (state.revoked_) die(3, JSON.stringify(latest(state)))337 }338339 loadPlugin("mapset", {proxyMap_, proxySet_})340}
modified:src/plugins/patches.ts+5 added-5 removed
22 unmodified lines
23 ProxyTypeProxyArray,24 ProxyTypeSet,25 ArchtypeMap,26 ArchtypeSet,27 ArchtypeArray27 ArchtypeArray,28 die29} from "../internal"29import invariant from "tiny-invariant"3031export function enablePatches() {32 function generatePatches_(33 state: ImmerState,
163 unmodified lines
197198 let base: any = draft199 for (let i = 0; i < path.length - 1; i++) {200 base = get(base, path[i])201 invariant(typeof base === "object","Cannot apply patch, path doesn't resolve: " + path.join("/")) // prettier-ignore201 if (typeof base !== "object") die(15, path.join("/"))202 }203204 const type = getArchtype(base)205 const value = deepClonePatchValue(patch.value) // used to clone patch to ensure original patch is not modified, see #411
4 unmodified lines
210 case ArchtypeMap:211 return base.set(key, value)212 /* istanbul ignore next */213 case ArchtypeSet:214 invariant(false, 'Sets cannot have "replace" patches.')214 die(16)215 default:216 // if value is an object, then it's assigned by reference217 // in the following add or remove ops, the value field inside the patch will also be modifyed218 // so we use value from the cloned patch
22 unmodified lines
241 default:242 return delete base[key]243 }244 default:245 invariant(false, "Unsupported patch operation: " + op)245 die(17, op)246 }247 })248249 return draft
21 unmodified lines
modified:src/common.ts+4 added-13 removed
11 unmodified lines
12 hasMap,13 ArchtypeObject,14 ArchtypeArray,15 ArchtypeMap,16 ArchtypeSet16 ArchtypeSet,17 die18} from "./internal"18import invariant from "tiny-invariant"1920/** Returns true if the given value is an Immer draft */21/*#__PURE__*/22export function isDraft(value: any): boolean {
138 unmodified lines
161 }162 const desc = Object.getOwnPropertyDescriptor(base, key)!163 let {value} = desc164 if (desc.get) {165 invariant(invokeGetters, "Immer drafts cannot have computed properties")165 if (!invokeGetters) die(1)166 value = desc.get.call(base)167 }168 if (desc.enumerable) {169 clone[key] = value
17 unmodified lines
187 if (deep) each(obj, (_, value) => freeze(value, true))188}189190function dontMutateFrozenCollections() {191 invariant(false, "This object has been frozen and should not be mutated")191 die(2)192}193194// TODO: move to ES5 / Map195export function assertUnrevoked(state: any /*ES5State | MapState | SetState*/) {196 invariant(197 !state.revoked_,198 "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " +199 JSON.stringify(latest(state))200 )201}
added:src/errors.ts+48 added
1declare const __DEV__: boolean23const errors = {4 0: "Illegal state",5 1: "Immer drafts cannot have computed properties",6 2: "This object has been frozen and should not be mutated",7 3(data: any) {8 return (9 "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " +10 data11 )12 },13 4: "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",14 5: "Immer forbids circular references",15 6: "The first or second argument to `produce` must be a function",16 7: "The third argument to `produce` must be a function or undefined",17 8: "First argument to `createDraft` must be a plain object, an array, or an immerable object",18 9: "First argument to `finishDraft` must be a draft returned by `createDraft`",19 10: "The given draft is already finalized",20 11: "Object.defineProperty() cannot be used on an Immer draft",21 12: "Object.setPrototypeOf() cannot be used on an Immer draft",22 13: "Immer only supports deleting array indices",23 14: "Immer only supports setting array indices and the 'length' property",24 15(path: string) {25 return "Cannot apply patch, path doesn't resolve: " + path26 },27 16: 'Sets cannot have "replace" patches.',28 17(op: string) {29 return "Unsupported patch operation: " + op30 }31} as const3233export function die(error: keyof typeof errors, ...args: any[]): never {34 if (__DEV__) {35 const e = errors[error]36 const msg = !e37 ? "unknown error nr: " + error38 : typeof e === "function"39 ? e.apply(null, args as any)40 : e41 throw new Error(`[Immer] ${msg}`)42 }43 throw new Error(44 `[Immer] minified error nr: ${error}${45 args.length ? " " + args.join(",") : ""46 }`47 )48}
modified:src/finalize.ts+4 added-4 removed
15 unmodified lines
16 get,17 ProxyTypeES5Object,18 ProxyTypeES5Array,19 ProxyTypeSet,20 getPlugin20 getPlugin,21 die22} from "./internal"22import invariant from "tiny-invariant"2324export function processResult(result: any, scope: ImmerScope) {25 scope.unfinalizedDrafts_ = scope.drafts_.length26 const baseDraft = scope.drafts_![0]
2 unmodified lines
29 getPlugin("es5").willFinalizeES5_(scope, result, isReplaced)30 if (isReplaced) {31 if (baseDraft[DRAFT_STATE].modified_) {32 scope.revoke_()33 invariant(false, "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.") // prettier-ignore33 die(4)34 }35 if (isDraftable(result)) {36 // Finalize the result in case it contains (or is) a subset of the draft.37 result = finalize(scope, result)
77 unmodified lines
115 prop: string | number,116 childValue: any,117 rootPath?: PatchPath118) {119 invariant(childValue !== targetObject, "Immer forbids circular references")119 if (__DEV__ && childValue === targetObject) die(5)120 if (isDraft(childValue)) {121 const path =122 rootPath &&123 parentState &&
39 unmodified lines
added:src/globals.d.ts+1 added
1declare const __DEV__: boolean
modified:src/immerClass.ts+15 added-19 removed
14 unmodified lines
15 isDraft,16 isMap,17 isSet,18 markChangedProxy,19 createProxyProxy19 createProxyProxy,20 freeze,21 getPlugin,22 die23} from "./internal"21import invariant from "tiny-invariant"22import {freeze} from "./common"23import {getPlugin} from "./plugins"2425declare const __DEV__: boolean25/* istanbul ignore next */26function verifyMinified() {}2728interface ProducersFns {
53 unmodified lines
82 return self.produce(base, (draft: Drafted) => recipe.call(this, draft, ...args)) // prettier-ignore83 }84 }8587 invariant(88 typeof recipe === "function",89 "The first or second argument to `produce` must be a function"90 )91 invariant(92 patchListener === undefined || typeof patchListener === "function",93 "The third argument to `produce` must be a function or undefined"94 )86 if (__DEV__) {87 if (typeof recipe !== "function") die(6)88 if (patchListener !== undefined && typeof patchListener !== "function")89 die(7)90 }9192 let result9394 // Only plain objects, arrays, and "immerable classes" are drafted.
36 unmodified lines
131 if (typeof arg1 === "function") {132 return (state: any, ...args: any[]) =>133 this.produceWithPatches(state, (draft: any) => arg1(draft, ...args))134 }139 // non-curried form140 /* istanbul ignore next */141 invariant(!arg3)135136 let patches: Patch[], inversePatches: Patch[]137 const nextState = this.produce(arg1, arg2, (p: Patch[], ip: Patch[]) => {138 patches = p139 inversePatches = ip
1 unmodified line
141 return [nextState, patches!, inversePatches!]142 }143144 createDraft<T extends Objectish>(base: T): Draft<T> {151 invariant(isDraftable(base), "First argument to `createDraft` must be a plain object, an array, or an immerable object") // prettier-ignore145 if (!isDraftable(base)) die(8)146 const scope = ImmerScope.enter_(this)147 const proxy = createProxy(this, base, undefined)148 proxy[DRAFT_STATE].isManual_ = true149 scope.leave_()
4 unmodified lines
154 draft: D,155 patchListener?: PatchListener156 ): D extends Draft<infer T> ? T : never {157 const state: ImmerState = draft && draft[DRAFT_STATE]164 invariant(state && state.isManual_, "First argument to `finishDraft` must be a draft returned by `createDraft`") // prettier-ignore165 invariant(!state.finalized_, "The given draft is already finalized") // prettier-ignore158 if (__DEV__) {159 if (!state || !state.isManual_) die(9)160 if (state.finalized_) die(10)161 }162 const {scope_: scope} = state163 scope.usePatches_(patchListener)164 return processResult(undefined, scope)165 }
70 unmodified lines
modified:src/internal.ts+1 added
1export * from "./env"2export * from "./errors"3export * from "./types-external"4export * from "./types-internal"5export * from "./common"6export * from "./plugins"
4 unmodified lines
modified:src/proxy.ts+5 added-5 removed
16 unmodified lines
17 createProxy,18 ProxyTypeProxyObject,19 ProxyTypeProxyArray20} from "./internal"21import invariant from "tiny-invariant"21import {die} from "./errors"2223interface ProxyBaseState extends ImmerBaseState {24 assigned_: {25 [property: string]: boolean
160 unmodified lines
186 }187 return desc188 },189 defineProperty() {190 invariant(false, "Object.defineProperty() cannot be used on an Immer draft") // prettier-ignore190 die(11)191 },192 getPrototypeOf(state) {193 return Object.getPrototypeOf(state.base_)194 },195 setPrototypeOf() {196 invariant(false, "Object.setPrototypeOf() cannot be used on an Immer draft") // prettier-ignore196 die(12)197 }198}199200/**
8 unmodified lines
209 return fn.apply(this, arguments)210 }211})212arrayTraps.deleteProperty = function(state, prop) {213 invariant(!isNaN(parseInt(prop as any)), "Immer only supports deleting array indices") // prettier-ignore213 if (__DEV__ && isNaN(parseInt(prop as any))) die(13)214 return objectTraps.deleteProperty!.call(this, state[0], prop)215}216arrayTraps.set = function(state, prop, value) {217 invariant(prop === "length" || !isNaN(parseInt(prop as any)), "Immer only supports setting array indices and the 'length' property") // prettier-ignore217 if (__DEV__ && prop !== "length" && isNaN(parseInt(prop as any))) die(14)218 return objectTraps.set!.call(this, state[0], prop, value, state[0])219}220221/**
39 unmodified lines
modified:notes.txt+4 added-1 removed
5 unmodified lines
6[x] kill hooks7[x] _ postfix all members8[x] clean up finalize9[x] remove die10[ ] own invariant10[x] own invariant11[ ] update docs12[ ] plugin tests13[ ] check if we can create more local vars14[x] verify performance
96 unmodified lines
111 3196112113add draft optimization1143199115116invariant1173206
modified:package.json-1 removed
74 unmodified lines
75 "rimraf": "^2.6.2",76 "seamless-immutable": "^7.1.3",77 "semantic-release": "^17.0.2",78 "spec.ts": "^1.1.0",79 "tiny-invariant": "^1.1.0",79 "ts-jest": "^25.2.0",80 "tsdx": "^0.12.3",81 "typescript": "^3.7.3",82 "webpack": "^4.41.6",
3 unmodified lines
modified:tsconfig.json+1 added-1 removed
13 unmodified lines
14 "moduleResolution": "node",15 "module": "esnext",16 "allowJs": true17 },18 "files": ["./src/immer.ts", "./src/plugins/es5.ts", "./src/plugins/mapset.ts", "./src/plugins/patches.ts"]18 "files": ["./src/immer.ts", "./src/plugins/es5.ts", "./src/plugins/mapset.ts", "./src/plugins/patches.ts", "./src/globals.d.ts"]19}
modified:yarn.lock-5 removed
11700 unmodified lines
11701 dependencies:11702 globalyzer "^0.1.0"11703 globrex "^0.1.1"1170411705tiny-invariant@^1.1.0:11706 version "1.1.0"11707 resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875"11708 integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==1170911705tiny-relative-date@^1.3.0:11706 version "1.3.0"11707 resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07"11708 integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A==
1031 unmodified lines