Skip to content
Myr

Updated docs

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 edb1cad · Browse files · 8 files+72 added−6 removed
This commit

State

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

Diff stats

8 files+72 added−6 removed

  • other:+72 added−6 removed

8 files+72 added−6 removed

modified:docs/api.md+5 added
modified:docs/complex-objects.md+2 added
modified:docs/installation.md+57 added
modified:docs/introduction.md+1 added-1 removed
59 unmodified lines
60- Object freezing out of the box61- Deep updates are a breeze62- Boilerplate reduction. Less noise, more concise code.63- First class support for patches64- Small [![size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/immer/dist/immer.umd.js?compression=gzip)](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/immer/dist/immer.umd.js)64- Small: 3KB gzipped
modified:docs/patches.md+2 added
21 unmodified lines
22 </div>23 <a style="font-style:italic;padding:5px;margin:5px;" href="https://egghead.io/lessons/react-apply-patches-using-immer-applypatches-to-synchronize-state-across-clients">Hosted on egghead.io</a>24</details>2526_⚠ Since version 6 support for Patches has to be enabled explicitly by calling [`enablePatches()`](installation#pick-your-immer-version) once when starting your application._2728During the run of a producer, Immer can record all the patches that would replay the changes made by the reducer. This is a very powerful tool if you want to fork your state temporarily and replay the changes to the original.2930Patches are useful in few scenarios:31
139 unmodified lines
modified:notes.txt+3 added-3 removed
6 unmodified lines
7[x] _ postfix all members8[x] clean up finalize9[x] remove die10[x] own invariant11[ ] update docs11[x] update docs12[x] plugin tests13[ ] check if we can create more local vars14[x] verify performance15[ ] kill ownKeys?16[x] kill enumerations17[ ] check todos18[ ] kill marchChangesSweep recursive if possible and no perf impact18[ ] ~~kill marchChangesSweep recursive if possible and no perf impact~~ does have perf impact19[ ] optimize each closures away? pass in additional args?20[x] document performance tip: if externally added data is frozen, it doesn't recurse (also update related issue) #46521[ ] put some invariants behind __DEV__21[x] put some invariants behind __DEV__22[x] check for plugin specific utils23[ ] bind util24[ ] eliminate switches25
92 unmodified lines
modified:package.json+1 added-1 removed
22 unmodified lines
23 "build": "rimraf dist/ && tsdx build --name immer --format esm,cjs,umd && yarn build:flow",24 "build:flow": "cpx 'src/types/immer.js.flow' dist -v",25 "publish-docs": "cd website && GIT_USER=mweststrate USE_SSH=true yarn run publish-gh-pages",26 "start": "cd website && yarn start",27 "test:size": "yarn build && yarn import-size --report . produce enableES5 enableMapSet enablePatches"27 "test:size": "yarn build && yarn import-size --report . produce enableES5 enableMapSet enablePatches enableAllPlugins"28 },29 "husky": {30 "hooks": {31 "pre-commit": "pretty-quick --staged"
54 unmodified lines
modified:readme.md+1 added-1 removed