Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update quick-start & add migration.md #784

Merged
merged 2 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 16.x
cache: yarn
cache-dependency-path: website/yarn.lock
- name: Install dependencies
Expand Down
10 changes: 10 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<h1>Migration</h1>

- [From version 1.0.x to 1.1.0](#from-version-10x-to-110)
- [React18 upgrade](#react18-upgrade)

## From version 1.0.x to 1.1.0

### React18 upgrade

React 18 introduced a [new root API](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis). Starting from 1.1.0, Molecule itself will auto-detect your version of react and use the new root API automatically if you're on React18. But It's attentioned that there are several dependencies of Molecule still incompatible of React18's strict mode. So Molecule now still not compatible with `React.StrictMode` in React@18.x. For exmaple: [react-scrollbars-custom](https://github.com/xobotyi/react-scrollbars-custom/issues/234).
14 changes: 14 additions & 0 deletions website/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ export default App;

`extensions` are extensions that need to be customized.

And open the `src/index.js` file and change it to the following:

```diff title="src/index.js"
root.render(
- <React.StrictMode>
<App />
- </React.StrictMode>
);
```

:::caution
It's **noticed** that the Molecule for now is not compatible with `React.StrictMode`. So we should remove `React.StrictMode` from `src/index.js`.
:::

## Startup Project

Finally, run the `start` command in the terminal:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ export default App;

`extensions` 是需要自定义的扩展程序。

然后,打开 `src/index.js` 文件,并修改如下的部分:

```diff title="src/index.js"
root.render(
- <React.StrictMode>
<App />
- </React.StrictMode>
);
```

:::caution
需要注意的是目前 Molecule 还无法与 `React.StrictMode` 兼容,所以我们需要在 `src/index.js` 中移除 `React.StrictMode`。
:::

## 启动项目

最后,在终端中运行`start` 命令:
Expand Down