From 82acc409b2b1d66373fc44200443e63917a32198 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Fri, 27 Jan 2023 14:58:32 +0100 Subject: [PATCH] fix: release and publish from 'main' rather than 'master' branch --- .github/workflows/docs-public.yml | 4 +--- .github/workflows/release.yml | 2 +- readme.md | 2 +- website/docs/performance.mdx | 8 +++++--- website/docusaurus.config.js | 2 +- .../current/performance.mdx | 10 ++++++---- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docs-public.yml b/.github/workflows/docs-public.yml index e81b7205..88556326 100644 --- a/.github/workflows/docs-public.yml +++ b/.github/workflows/docs-public.yml @@ -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: @@ -30,5 +30,3 @@ jobs: build_dir: website/build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ebdefc4c..de0259e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ name: Release on: push: branches: - - master + - main jobs: release: diff --git a/readme.md b/readme.md index 32e917a1..e1c3f74c 100644 --- a/readme.md +++ b/readme.md @@ -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_ diff --git a/website/docs/performance.mdx b/website/docs/performance.mdx index aee07326..37f54afd 100644 --- a/website/docs/performance.mdx +++ b/website/docs/performance.mdx @@ -9,7 +9,8 @@ title: Immer performance data-ea-type="image" className="horizontal bordered" > -
+ +
egghead.io lesson 5: Leveraging Immer's structural sharing in React @@ -28,7 +29,8 @@ title: Immer performance > Hosted on egghead.io -
+
+
egghead.io lesson 7: Immer will try to re-cycle data if there was no semantic change @@ -50,7 +52,7 @@ title: Immer performance
-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. diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 04783fbc..313d743e 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -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: "/" } ], diff --git a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/performance.mdx b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/performance.mdx index c9bba401..51fe3874 100644 --- a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/performance.mdx +++ b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/performance.mdx @@ -9,7 +9,8 @@ title: Immer 性能 data-ea-type="image" className="horizontal bordered" > -
+ +
egghead.io 第5课: 在 React 中利用 Immer 的结构共享 @@ -28,7 +29,8 @@ title: Immer 性能 > Hosted on egghead.io -
+
+
egghead.io 第7课: 如果没有语义变化,Immer 会使用原先的数据 @@ -49,7 +51,7 @@ title: Immer 性能
-这是一个关于 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 即可解决关键性能问题。 @@ -68,7 +70,7 @@ title: Immer 性能 ### 预冻结数据 -当向 Immer producer 中的状态树添加大型数据集时(例如从 JSON 端点接收的数据),可以在首先添加的数据的根上调用 `freeze(json)` ,来_浅冻结_它。这将允许 Immer 更快地将新数据添加到树中,因为它将避免_递归_扫描和冻结新数据的需要。 +当向 Immer producer 中的状态树添加大型数据集时(例如从 JSON 端点接收的数据),可以在首先添加的数据的根上调用 `freeze(json)` ,来*浅冻结*它。这将允许 Immer 更快地将新数据添加到树中,因为它将避免*递归*扫描和冻结新数据的需要。 ### 您可以随时选择退出