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

Update source.md #96

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions docs/preparation/source.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
了解了源码的文件目录,这一节我们看看如何调试源码。

即使版本号相同(当前最新版为`17.0.0 RC`),但是`facebook/react`项目`master`分支的代码和我们使用`create-react-app`创建的项目`node_modules`下的`react`项目代码还是有些区别。
即使版本号相同(当前最新版为`17.0.2`),但是`facebook/react`项目`main`分支的代码和我们使用`create-react-app`创建的项目`node_modules`下的`react`项目代码还是有些区别。

因为`React`的新代码都是直接提交到`master`分支,而`create-react-app`内的`react`使用的是稳定版的包。
因为`React`的新代码都是直接提交到`main`分支,而`create-react-app`内的`react`使用的是稳定版的包。

为了始终使用最新版`React`教学,我们调试源码遵循以下步骤:

1. 从`facebook/react`项目`master`分支拉取最新源码
1. 从`facebook/react`项目`main`分支拉取最新源码
2. 基于最新源码构建`react`、`scheduler`、`react-dom`三个包
3. 通过`create-react-app`创建测试项目,并使用步骤2创建的包作为项目依赖的包

Expand Down