跳转至主内容

Canary 版本

Docusaurus 提供 Canary 版本。

您可以在合并代码后立刻测试未发布的全新功能

这有助于您向维护者们提交反馈,确保新实现的功能正常工作。

note

实际上,在生产环境中使用 Canary 版本并不存在风险。

Canary 版本通过了所有的自动化测试,就连本网站的生产环境中也在使用此版本。

caution

The canary version shown below may not be up-to-date. Please go to the npm page to find the actual version name.

Canary npm 版本标签

For any code-related commit on main, the continuous integration will publish a canary release under the @canary npm dist tag. It generally takes up to 10 minutes.

You can see on npm the current dist tags:

  • latest: stable releases (Current: 2.0.0-beta.20)
  • canary: canary releases (Example: 0.0.0-4922)
tip

Make sure to use the latest canary release and check the publication date (sometimes the publish process fails).

note

Canary versions follow the naming convention 0.0.0-commitNumber.

使用 Canary 版本

Take the latest version published under the canary npm dist tag (Example: 0.0.0-4922).

Use it for all the @docusaurus/* dependencies in your package.json:

-  "@docusaurus/core": "^2.0.0-beta.20",
- "@docusaurus/preset-classic": "^2.0.0-beta.20",
+ "@docusaurus/core": "0.0.0-4922",
+ "@docusaurus/preset-classic": "0.0.0-4922",

Then, install the dependencies again and start your site:

npm install
npm start

You can also upgrade the @docusaurus/* packages with command line:

npm install --save-exact @docusaurus/[email protected] @docusaurus/[email protected]
caution

Make sure to include all the @docusaurus/* packages.

For canary releases, prefer using an exact version instead of a semver range (avoid the ^ prefix).