跳到主要内容

Docusaurus 3.7

· 阅读需 3 分钟
Sébastien Lorber
Docusaurus 维护者、React 周刊编者

We are happy to announce Docusaurus 3.7.

Docusaurus is now compatible with React 19.

Upgrading should be easy. Our release process respects Semantic Versioning. Minor versions do not include any breaking changes.

Docusaurus blog post social card

Highlight

React 19

In #10763, we added support for React 19, and the Docusaurus website is running on React 19 already.

From now on, all newly initialized sites will run on React 19 by default, and React 19 will be the minimum required version Docusaurus v4.

However, React 18 remains supported, and existing Docusaurus sites can either choose to stay on React 18, or upgrade their dependencies to React 19:

{
"name": "my-docusaurus-site",
"dependencies": {
- "react": "^18.0.0",
- "react-dom": "^18.0.0"
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0"
}
}
警告

There's no urge to upgrade your site immediately.

React 19 is a bit heavier than React 18. Since we support both versions, we don't leverage yet the new features that are exclusive to React 19.

However, upgrading to React 19 prepares your site for Docusaurus v4, that will drop support for React 18.

Here are good reasons to upgrade your site before Docusaurus v4:

  • You have custom React code and want to ensure it is ready for React19
  • You plan to leverage the brand-new React 19 features in your own code
  • You use custom or third-party plugins and want to ensure their compatibility
  • You have a monorepo and want to align the React dependency to v19 for all packages

Along the way, we fixed all the remaining hydration errors reported by React 19, some of them produced by our aggressive HTML minifier settings.

SVGR plugin

Docusaurus has built-in support for SVGR, allowing you to seamlessly import and use SVG files as React components:

import DocusaurusSvg from './docusaurus.svg';

<DocusaurusSvg />;

This built-in support has been the source of various bug reports due to the inability to customize the SVGR Options, in particular the SVG Optimizer options.

In #10677, we extracted a new @docusaurus/plugin-svgr that you can now configure according to your needs. It is included by default in our classic preset:

export default {
presets: [
[
'classic',
{
svgr: {
svgrConfig: {
// Your SVGR options ...
svgoConfig: {
// Your SVGO options ...
// Use "svgoConfig: undefined" to use a svgo.config.js file
},
},
},
},
],
],
};

其他改变:

Other notable changes include:

  • #10768: Blog authors have built-in icons for social platforms bluesky, mastodon, threads, twitch, youtube, instagram.
  • #10729: Blog now supports frontMatter.sidebar_label
  • #10803: @docusaurus/remark-plugin-npm2yarn now supports Bun conversions.
  • #10672: Upgrade Algolia DocSearch to algoliasearch v5.
  • #10800: Docusaurus Faster turns Rspack incremental mode on by default.
  • #10783: Improve Dutch theme translations.
  • #10760: Improve Korean theme translations.

Check the 3.7.0 changelog entry for an exhaustive list of changes.