Skip to content

Commit

Permalink
fix: release and publish from 'main' rather than 'master' branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Jan 27, 2023
1 parent 3eeb331 commit 82acc40
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/docs-public.yml
Expand Up @@ -4,7 +4,7 @@ name: Public docs

on:
push:
branches: [ master ]
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -30,5 +30,3 @@ jobs:
build_dir: website/build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -6,7 +6,7 @@ name: Release
on:
push:
branches:
- master
- main

jobs:
release:
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -2,7 +2,7 @@

# Immer

[![npm](https://img.shields.io/npm/v/immer.svg)](https://www.npmjs.com/package/immer) [![Build Status](https://travis-ci.org/immerjs/immer.svg?branch=master)](https://travis-ci.org/immerjs/immer) [![Coverage Status](https://coveralls.io/repos/github/mweststrate/immer/badge.svg?branch=master)](https://coveralls.io/github/mweststrate/immer?branch=master) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![OpenCollective](https://opencollective.com/immer/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/immer/sponsors/badge.svg)](#sponsors) [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/immerjs/immer)
[![npm](https://img.shields.io/npm/v/immer.svg)](https://www.npmjs.com/package/immer) [![Build Status](https://travis-ci.org/immerjs/immer.svg?branch=main)](https://travis-ci.org/immerjs/immer) [![Coverage Status](https://coveralls.io/repos/github/mweststrate/immer/badge.svg?branch=main)](https://coveralls.io/github/mweststrate/immer?branch=main) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![OpenCollective](https://opencollective.com/immer/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/immer/sponsors/badge.svg)](#sponsors) [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/immerjs/immer)

_Create the next immutable state tree by simply modifying the current tree_

Expand Down
8 changes: 5 additions & 3 deletions website/docs/performance.mdx
Expand Up @@ -9,7 +9,8 @@ title: Immer performance
data-ea-type="image"
className="horizontal bordered"
></div>
</center> <details>
</center>
<details>
<summary className="egghead-summary">
egghead.io lesson 5: Leveraging Immer's structural sharing in React
</summary>
Expand All @@ -28,7 +29,8 @@ title: Immer performance
>
Hosted on egghead.io
</a>
</details> <details>
</details>
<details>
<summary className="egghead-summary">
egghead.io lesson 7: Immer will try to re-cycle data if there was no
semantic change
Expand All @@ -50,7 +52,7 @@ title: Immer performance
</a>
</details>

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.
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.

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.

Expand Down
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Expand Up @@ -75,7 +75,7 @@ module.exports = {
"@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: "/"
}
],
Expand Down
Expand Up @@ -9,7 +9,8 @@ title: Immer 性能
data-ea-type="image"
className="horizontal bordered"
></div>
</center> <details>
</center>
<details>
<summary className="egghead-summary">
egghead.io 第5课: 在 React 中利用 Immer 的结构共享
</summary>
Expand All @@ -28,7 +29,8 @@ title: Immer 性能
>
Hosted on egghead.io
</a>
</details> <details>
</details>
<details>
<summary className="egghead-summary">
egghead.io 第7课: 如果没有语义变化,Immer 会使用原先的数据
</summary>
Expand All @@ -49,7 +51,7 @@ title: Immer 性能
</a>
</details>

这是一个关于 Immer 性能的 [简单 benchmark](https://github.com/immerjs/immer/blob/master/__performance_tests__/todo.js) 。该测试需要 50,000 个待办事项并更新其中的 5,000 个。 _Freeze_ 表示状态树在生成后已被冻结。这是一种开发最佳实践,因为它可以防止开发人员意外修改状态树。
这是一个关于 Immer 性能的 [简单 benchmark](https://github.com/immerjs/immer/blob/main/__performance_tests__/todo.js) 。该测试需要 50,000 个待办事项并更新其中的 5,000 个。 _Freeze_ 表示状态树在生成后已被冻结。这是一种开发最佳实践,因为它可以防止开发人员意外修改状态树。

上面的数字没有反映一些东西,但实际上,Immer 有时比手写的 reducer __ 得多。这样做的原因是,Immer 会检测“无操作”状态变化,如果实际上没有任何变化,则返回原始状态,这可以避免很多重新渲染。众所周知,只需应用 immer 即可解决关键性能问题。

Expand All @@ -68,7 +70,7 @@ title: Immer 性能

### 预冻结数据

当向 Immer producer 中的状态树添加大型数据集时(例如从 JSON 端点接收的数据),可以在首先添加的数据的根上调用 `freeze(json)`来_浅冻结_它。这将允许 Immer 更快地将新数据添加到树中,因为它将避免_递归_扫描和冻结新数据的需要
当向 Immer producer 中的状态树添加大型数据集时(例如从 JSON 端点接收的数据),可以在首先添加的数据的根上调用 `freeze(json)`*浅冻结*。这将允许 Immer 更快地将新数据添加到树中,因为它将避免*递归*扫描和冻结新数据的需要

### 您可以随时选择退出

Expand Down

0 comments on commit 82acc40

Please sign in to comment.