facebook / facebook/docusaurus

Docusaurus V4 - Umbrella issue

Open
#11,719 21 comments 5 reactions 0 assignees View on GitHub
proposal
Dominant language
TypeScript
Stars
66.2k
Forks
10k
Avg merge
1d 3h
Merged PRs (30d)
52

Description

This is a meta issue to gather information about the upcoming Docusaurus v4 release.
This comment will be updated regularly as we progress toward v4.

If you have opinions on breaking changes and dependency upgrades we should focus on, please let us know.

Apart from that, I'd like to keep the release relatively small, to make it easy to adopt, and to not delay it more than needed.

## Top Priority changes

These are the changes we really want for v4. The list is already quite long, so I'm likely to migrate some items to optional changes.

Dependency upgrades:

- [x] Node 24+ (https://github.com/facebook/docusaurus/pull/11914)
- [x] React 19.2+ (https://github.com/facebook/docusaurus/pull/11916)
- [x] TypeScript 6.0+ (https://github.com/facebook/docusaurus/pull/11915)
- [x] Rspack v2.0+ (https://github.com/facebook/docusaurus/pull/12187)
- [x] DocSearch v4.6+ (https://github.com/facebook/docusaurus/pull/11917)
- [ ] React Router v8+ / history v5+
- [x] Webpack/PostCSS/CSSNano/Bundler dependencies (https://github.com/facebook/docusaurus/pull/11924)
- [x] Cheerio v1.2+ (https://github.com/facebook/docusaurus/pull/11922)
- [X] jiti v2+ (https://github.com/facebook/docusaurus/pull/12045) (or load config files with native Node.js TS support? later?)
- [x] Replace Globby by Tinyglobby (https://github.com/facebook/docusaurus/pull/11042)
- [x] Replace gray-matter by 11ty/gray-matter maintained fork (https://github.com/facebook/docusaurus/pull/12182)
- [x] Feed v5 (https://github.com/facebook/docusaurus/pull/12060)
- [x] Sharp 0.35 - no postinstall script anymore (https://github.com/facebook/docusaurus/pull/12188)
- [ ] `@rspack/dev-server`
- [ ] `@rspack/plugin-react-refresh`
- [x] Replace chalk by Node [styleText](https://nodejs.org/api/util.html#utilstyletextformat-text-options) (https://github.com/facebook/docusaurus/pull/12405)
- [x] Eta v4 (https://github.com/facebook/docusaurus/pull/12404)

Behaviors:
- [x] [Trusted publishing](https://docs.npmjs.com/trusted-publishers) for official releases
- [ ] v4 future flags are turned on by default; we may provide an opt-out for some, like CSS Cascade Layers
- [ ] `experimental_faster` is now stable and enabled by default. It remains possible to opt out webpack/slower tools.
- [x] `experimental_storage` is now stable and uses namespacing by default, with the ability to out-out.
- [ ] Remove deprecated APIs
- [ ] Use browserslist query [`baseline widely available`](https://web.dev/blog/browserslist-supports-baseline) by default
- [x] Use native `RegExp.escape`
- [ ] Remove CLI built-in `--bundle-analyzer` option, it shouldn't be in core and could be a plugin
- [ ] Enable [`respectPrefersColorScheme `](https://github.com/facebook/docusaurus/pull/11293) by default
- [x] Remove Google Analytics plugin
- [ ] Get rid of prop-types from client bundle
- [ ] Migrate docs/blog/pages-specific code from theme-common to plugin client exports
- [ ] TypeScript strict by default (cleanup init template, now useless since TS 6.0)
- [ ] Deprecate `configureWebpack(...args)` in favor of `configureBundler({params})`, upgrade webpack-merge

Also: handle all the `// TODO Docusaurus v4` comments in code

## Optional changes

These are the changes we'd like to have for v4, but if they are too complicated, difficult to implement, or too disruptive for users, we may postpone them to another major version.

- Deprecate `algolia.themeConfig` in favor of plugin/preset options?
- [v4.0 milestone](https://github.com/facebook/docusaurus/milestone/21) contains various fixes/upgrades requiring breaking changes or version upgrades
- [Babel 8](https://babeljs.io/blog/2026/01/31/7.29.0) for Docusaurus Slower?
- Deprecate [`getSwizzleComponentList`](https://docusaurus.io/docs/api/plugin-methods/extend-infrastructure#getSwizzleComponentList) in favor of `getSwizzleConfig`
- Truncate blog markdown loader with AST/remark instead of String split regexp
- `.md` parsed as CommonMark by default?
- Internalize and shrink down Infima
- [Chokidar v4?](https://github.com/paulmillr/chokidar/releases/tag/4.0.0) or migrate to [Parcel watcher](https://github.com/parcel-bundler/watcher) like many others?
- [Commander v12?](https://github.com/tj/commander.js/releases/tag/v12.0.0)

## Rejected changes

- react-helmet-async v3+ (https://github.com/staylor/react-helmet-async/pull/260): I tried updating, and it didn't work well. For React v19 this lib is a quite useless pass-through. For that reason, we'll stay on my fork that added v19 support. There are alternatives to consider in https://github.com/staylor/react-helmet-async/issues/239 ([unjs/head](https://unhead.unjs.io/) and [birdofpreyru/react-helmet](https://github.com/birdofpreyru/react-helmet)), but no need to upgrade immediately.

- Babel 8 (https://github.com/facebook/docusaurus/pull/12408): PR has been closed for the reasons mentioned at the top. Not really needed right now, and would lead to a duplicate Babel7/8 version anyway.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.