|
| 1 | +--- |
| 2 | +title: Docusaurus 3.7 |
| 3 | +authors: [slorber] |
| 4 | +tags: [release] |
| 5 | +image: ./img/social-card.png |
| 6 | +date: 2025-01-03 |
| 7 | +--- |
| 8 | + |
| 9 | +We are happy to announce **Docusaurus 3.7**. |
| 10 | + |
| 11 | +Docusaurus is now compatible with [React 19](https://react.dev/blog/2024/12/05/react-19). |
| 12 | + |
| 13 | +Upgrading should be easy. Our [release process](/community/release-process) respects [Semantic Versioning](https://semver.org/). Minor versions do not include any breaking changes. |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +{/* truncate */} |
| 18 | + |
| 19 | +## Highlight |
| 20 | + |
| 21 | +### React 19 |
| 22 | + |
| 23 | +In [#10763](https://github.com/facebook/docusaurus/pull/10763), we added support for [React 19](https://react.dev/blog/2024/12/05/react-19), and the Docusaurus website is running on React 19 already. |
| 24 | + |
| 25 | +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. |
| 26 | + |
| 27 | +However, React 18 remains supported, and existing Docusaurus sites can either choose to stay on React 18, or upgrade their dependencies to React 19: |
| 28 | + |
| 29 | +```diff |
| 30 | +{ |
| 31 | + "name": "my-docusaurus-site", |
| 32 | + "dependencies": { |
| 33 | +- "react": "^18.0.0", |
| 34 | +- "react-dom": "^18.0.0" |
| 35 | ++ "react": "^19.0.0", |
| 36 | ++ "react-dom": "^19.0.0" |
| 37 | + } |
| 38 | +} |
| 39 | +``` |
| 40 | + |
| 41 | +:::warning |
| 42 | + |
| 43 | +There's no urge to upgrade your site immediately. |
| 44 | + |
| 45 | +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. |
| 46 | + |
| 47 | +However, upgrading to React 19 prepares your site for Docusaurus v4, that will drop support for React 18. |
| 48 | + |
| 49 | +Here are good reasons to upgrade your site before Docusaurus v4: |
| 50 | + |
| 51 | +- You have custom React code and want to ensure it is ready for React19 |
| 52 | +- You plan to leverage the brand-new React 19 features in your own code |
| 53 | +- You use custom or third-party plugins and want to ensure their compatibility |
| 54 | +- You have a monorepo and want to align the React dependency to v19 for all packages |
| 55 | + |
| 56 | +::: |
| 57 | + |
| 58 | +Along the way, we [fixed](https://github.com/facebook/docusaurus/pull/10786) all the remaining hydration errors reported by React 19, some of them produced by our aggressive HTML minifier settings. |
| 59 | + |
| 60 | +### SVGR plugin |
| 61 | + |
| 62 | +Docusaurus has built-in support for [SVGR](https://github.com/gregberge/svgr), allowing you to seamlessly import and use SVG files as React components: |
| 63 | + |
| 64 | +```tsx |
| 65 | +import DocusaurusSvg from './docusaurus.svg'; |
| 66 | + |
| 67 | +<DocusaurusSvg />; |
| 68 | +``` |
| 69 | + |
| 70 | +This built-in support has been the source of various bug reports due to the inability to customize the [SVGR Options](https://react-svgr.com/docs/options/), in particular the [SVG Optimizer](https://svgo.dev/) options. |
| 71 | + |
| 72 | +In [#10677](https://github.com/facebook/docusaurus/pull/10677), we extracted a new [`@docusaurus/plugin-svgr`](/docs/api/plugins/@docusaurus/plugin-svgr) that you can now configure according to your needs. It is included by default in our classic preset: |
| 73 | + |
| 74 | +```js |
| 75 | +export default { |
| 76 | + presets: [ |
| 77 | + [ |
| 78 | + 'classic', |
| 79 | + { |
| 80 | + svgr: { |
| 81 | + svgrConfig: { |
| 82 | + // Your SVGR options ... |
| 83 | + svgoConfig: { |
| 84 | + // Your SVGO options ... |
| 85 | + // Use "svgoConfig: undefined" to use a svgo.config.js file |
| 86 | + }, |
| 87 | + }, |
| 88 | + }, |
| 89 | + }, |
| 90 | + ], |
| 91 | + ], |
| 92 | +}; |
| 93 | +``` |
| 94 | + |
| 95 | +## Other changes |
| 96 | + |
| 97 | +Other notable changes include: |
| 98 | + |
| 99 | +- [#10768](https://github.com/facebook/docusaurus/pull/10768): Blog authors have built-in icons for social platforms bluesky, mastodon, threads, twitch, youtube, instagram. |
| 100 | +- [#10729](https://github.com/facebook/docusaurus/pull/10729): Blog now supports `frontMatter.sidebar_label` |
| 101 | +- [#10803](https://github.com/facebook/docusaurus/pull/10803): `@docusaurus/remark-plugin-npm2yarn` now supports Bun conversions. |
| 102 | +- [#10672](https://github.com/facebook/docusaurus/pull/10672): Upgrade Algolia DocSearch to `algoliasearch` v5. |
| 103 | +- [#10800](https://github.com/facebook/docusaurus/pull/10800): Docusaurus Faster turns Rspack incremental mode on by default. |
| 104 | +- [#10783](https://github.com/facebook/docusaurus/pull/10783): Improve Dutch theme translations. |
| 105 | +- [#10760](https://github.com/facebook/docusaurus/pull/10760): Improve Korean theme translations. |
| 106 | + |
| 107 | +Check the **[3.7.0 changelog entry](/changelog/3.7.0)** for an exhaustive list of changes. |
0 commit comments