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

chore: upgrade Docusaurus, enable Faster - Rspack/SWC/LightningCSS #2997

Merged
merged 3 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ function remarkDirectiveBabel8Plugin({ renderBabel8 }) {
}

const siteConfig = {
future: {
// See https://docusaurus.io/blog/releases/3.6
experimental_faster: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slorber Thank you for the PR. Will docusaurus 4 remove this option and completely switch to Rspack/SWC/LightningCSS?

Copy link
Contributor Author

@slorber slorber Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

I think we'll keep it for v4, but maybe it will become true by default.

It's also possible to enable all the other options except replacing Babel loader by SWC if you really want your site to use Babel.

Note: if you want to keep Babel, we have a {webpack: {jsLoader: fn}} hook to plug your own custom loader. Even if we remove the faster options and make SWC the default, this hook remains an escape hatch to use Babel, OXC, Esbuild, or whatever you want.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm personally fine with using SWC, as long as there is an opt out if we'll ever need it.

},
titleDelimiter: "·",
baseUrl: "/",
favicon: "img/favicon.png",
Expand Down
7 changes: 4 additions & 3 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
"serve": "docusaurus serve"
},
"devDependencies": {
"@docusaurus/core": "^3.5.2",
"@docusaurus/preset-classic": "^3.5.2",
"@docusaurus/remark-plugin-npm2yarn": "^3.5.2",
"@docusaurus/core": "3.6.0",
"@docusaurus/faster": "3.6.0",
"@docusaurus/preset-classic": "3.6.0",
"@docusaurus/remark-plugin-npm2yarn": "3.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "^9.0.0",
Expand Down
Loading