fix: release and publish from 'main' rather than 'master' branch
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 3eeb331 · Browse files · 6 files·+15 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+15 added−13 removed
- other:+15 added−13 removed
Provenance
- Commit
82acc40- Tree
2180cf9- Author
Michel Weststrate <mweststrate@fb.com>- Committer
Michel Weststrate <mweststrate@fb.com>- Parent
3eeb331
6 files changed+15 added−13 removed
modified:.github/workflows/docs-public.yml+1 added-3 removed
2 unmodified lines34567789101117 unmodified lines2930313233342 unmodified linesname: Public docs
on: push: branches: [ master ] branches: [main]
# Allows you to run this workflow manually from the Actions tab workflow_dispatch:
17 unmodified lines target_branch: gh-pages build_dir: website/build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
modified:.github/workflows/release.yml+1 added-1 removed
4 unmodified lines5678991011121318 unmodified lines4 unmodified lines
on: push: branches: - master - main
jobs: release: runs-on: ubuntu-latest18 unmodified linesmodified:website/docs/performance.mdx+5 added-3 removed
7 unmodified lines8 data-ea-publisher="immerjs"9 data-ea-type="image"10 className="horizontal bordered"11 ></div>12-</center> <details>12+</center>13+<details>14 <summary className="egghead-summary">15 egghead.io lesson 5: Leveraging Immer's structural sharing in React16 </summary>17 <br />10 unmodified lines28 href="https://egghead.io/lessons/react-profile-react-rendering-and-optimize-with-memo-to-leverage-structural-sharing"29 >30 Hosted on egghead.io31 </a>31-</details> <details>32+</details>33+<details>34 <summary className="egghead-summary">35 egghead.io lesson 7: Immer will try to re-cycle data if there was no36 semantic change37 </summary>13 unmodified lines51 Hosted on egghead.io52 </a>53 </details>54 53-Here is a [simple benchmark](https://github.com/immerjs/immer/blob/master/__performance_tests__/todo.js) on the performance of Immer. This test takes 50,000 todo items and updates 5,000 of them. _Freeze_ indicates that the state tree has been frozen after producing it. This is a _development_ best practice, as it prevents developers from accidentally modifying the state tree.55+Here is a [simple benchmark](https://github.com/immerjs/immer/blob/main/__performance_tests__/todo.js) on the performance of Immer. This test takes 50,000 todo items and updates 5,000 of them. _Freeze_ indicates that the state tree has been frozen after producing it. This is a _development_ best practice, as it prevents developers from accidentally modifying the state tree.56 57 Something that isn't reflected in the numbers above, but in reality, Immer is sometimes significantly _faster_ than a hand written reducer. The reason for that is that Immer will detect "no-op" state changes, and return the original state if nothing actually changed, which can avoid a lot of re-renderings for example. Cases are known where simply applying immer solved critical performance issues.58 59 These tests were executed on Node 10.16.3. Use `yarn test:perf` to reproduce them locally.27 unmodified linesmodified:website/i18n/zh-CN/docusaurus-plugin-content-docs/current/performance.mdx+6 added-4 removed
7 unmodified lines8 data-ea-publisher="immerjs"9 data-ea-type="image"10 className="horizontal bordered"11 ></div>12-</center> <details>12+</center>13+<details>14 <summary className="egghead-summary">15 egghead.io 第5课: 在 React 中利用 Immer 的结构共享16 </summary>17 <br />10 unmodified lines28 href="https://egghead.io/lessons/react-profile-react-rendering-and-optimize-with-memo-to-leverage-structural-sharing"29 >30 Hosted on egghead.io31 </a>31-</details> <details>32+</details>33+<details>34 <summary className="egghead-summary">35 egghead.io 第7课: 如果没有语义变化,Immer 会使用原先的数据36 </summary>37 <br />12 unmodified lines50 Hosted on egghead.io51 </a>52 </details>53 52-这是一个关于 Immer 性能的 [简单 benchmark](https://github.com/immerjs/immer/blob/master/__performance_tests__/todo.js) 。该测试需要 50,000 个待办事项并更新其中的 5,000 个。 _Freeze_ 表示状态树在生成后已被冻结。这是一种开发最佳实践,因为它可以防止开发人员意外修改状态树。54+这是一个关于 Immer 性能的 [简单 benchmark](https://github.com/immerjs/immer/blob/main/__performance_tests__/todo.js) 。该测试需要 50,000 个待办事项并更新其中的 5,000 个。 _Freeze_ 表示状态树在生成后已被冻结。这是一种开发最佳实践,因为它可以防止开发人员意外修改状态树。55 56 上面的数字没有反映一些东西,但实际上,Immer 有时比手写的 reducer _快_ 得多。这样做的原因是,Immer 会检测“无操作”状态变化,如果实际上没有任何变化,则返回原始状态,这可以避免很多重新渲染。众所周知,只需应用 immer 即可解决关键性能问题。57 58 这些测试在 Node 10.16.3 上执行。使用 `yarn test:perf` 在本地重现它们。10 unmodified lines69 ## 性能提示70 71 ### 预冻结数据72 71-当向 Immer producer 中的状态树添加大型数据集时(例如从 JSON 端点接收的数据),可以在首先添加的数据的根上调用 `freeze(json)` ,来_浅冻结_它。这将允许 Immer 更快地将新数据添加到树中,因为它将避免_递归_扫描和冻结新数据的需要。73+当向 Immer producer 中的状态树添加大型数据集时(例如从 JSON 端点接收的数据),可以在首先添加的数据的根上调用 `freeze(json)` ,来*浅冻结*它。这将允许 Immer 更快地将新数据添加到树中,因为它将避免*递归*扫描和冻结新数据的需要。74 75 ### 您可以随时选择退出76 77 immer 在任何地方都是可选的,因此手动编写性能非常苛刻的 reducers ,并将 immer 用于所有普通的的 reducers 是非常好的。即使在 producer 内部,您也可以通过使用 `original` 或 `current` 函数来选择退出 Immer 的某些部分逻辑,并对纯 JavaScript 对象执行一些操作。8 unmodified linesmodified:website/docusaurus.config.js+1 added-1 removed
73 unmodified lines7475767778787980818223 unmodified lines73 unmodified lines [ "@docusaurus/plugin-content-docs", { sidebarPath: require.resolve("./sidebars.js"), editUrl: "https://github.com/immerjs/immer/edit/master/website/", editUrl: "https://github.com/immerjs/immer/edit/main/website/", routeBasePath: "/" } ], [23 unmodified linesmodified:readme.md+1 added-1 removed
1 <img src="images/immer-logo.svg" height="200px" align="right"/>2 3 # Immer4 5-[](https://www.npmjs.com/package/immer) [](https://travis-ci.org/immerjs/immer) [](https://coveralls.io/github/mweststrate/immer?branch=master) [](https://github.com/prettier/prettier) [](#backers) [](#sponsors) [](https://gitpod.io/#https://github.com/immerjs/immer)5+[](https://www.npmjs.com/package/immer) [](https://travis-ci.org/immerjs/immer) [](https://coveralls.io/github/mweststrate/immer?branch=main) [](https://github.com/prettier/prettier) [](#backers) [](#sponsors) [](https://gitpod.io/#https://github.com/immerjs/immer)6 7 _Create the next immutable state tree by simply modifying the current tree_8 9 Winner of the "Breakthrough of the year" [React open source award](https://osawards.com/react/) and "Most impactful contribution" [JavaScript open source award](https://osawards.com/javascript/) in 201924 unmodified lines