Skip to content

Commit

Permalink
chore: bump docusaurus to canary verison (#428)
Browse files Browse the repository at this point in the history
Support for building projects via rspack has been added in the latest Canary version of Docusaurus, which significantly improves compilation speed. 

```bash
❯ hyperfine --prepare 'pnpm clear' --runs 5 'DOCUSAURUS_FASTER=false pnpm build' 'DOCUSAURUS_FASTER=true pnpm build'
Benchmark 1: DOCUSAURUS_FASTER=false pnpm build
  Time (mean ± σ):     70.715 s ± 17.150 s    [User: 134.096 s, System: 31.651 s]
  Range (min … max):   52.330 s … 88.497 s    5 runs

Benchmark 2: DOCUSAURUS_FASTER=true pnpm build
  Time (mean ± σ):     30.094 s ±  4.572 s    [User: 64.061 s, System: 28.384 s]
  Range (min … max):   25.832 s … 37.655 s    5 runs

Summary
  DOCUSAURUS_FASTER=true pnpm build ran
    2.35 ± 0.67 times faster than DOCUSAURUS_FASTER=false pnpm build
```

see: facebook/docusaurus#10556 (comment)

```release-note
None 
```
  • Loading branch information
ruibaby authored Oct 31, 2024
1 parent c03925c commit aa466d9
Show file tree
Hide file tree
Showing 3 changed files with 4,127 additions and 4,821 deletions.
23 changes: 5 additions & 18 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const config = {
},
themes: ['@docusaurus/theme-mermaid'],

future: {
experimental_faster: true,
},

presets: [
[
"classic",
Expand Down Expand Up @@ -104,7 +108,7 @@ const config = {
([versionName, versionUrl]) => ({
label: versionName,
href: versionUrl,
})
}),
),
{
to: "/versions",
Expand Down Expand Up @@ -244,23 +248,6 @@ const config = {
},
],
],
webpack: {
jsLoader: (isServer) => ({
loader: require.resolve("swc-loader"),
options: {
jsc: {
parser: {
syntax: "typescript",
tsx: true,
},
target: "es2017",
},
module: {
type: isServer ? "commonjs" : "es6",
},
},
}),
},
scripts: [
{
src: "https://analytics.halo.run/script.js",
Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
]
},
"dependencies": {
"@docusaurus/core": "3.4.0",
"@docusaurus/plugin-client-redirects": "^3.4.0",
"@docusaurus/preset-classic": "3.4.0",
"@docusaurus/theme-classic": "3.4.0",
"@docusaurus/theme-common": "3.4.0",
"@docusaurus/theme-mermaid": "3.4.0",
"@docusaurus/core": "3.5.2-canary-6127",
"@docusaurus/faster": "3.5.2-canary-6127",
"@docusaurus/plugin-client-redirects": "3.5.2-canary-6127",
"@docusaurus/preset-classic": "3.5.2-canary-6127",
"@docusaurus/theme-classic": "3.5.2-canary-6127",
"@docusaurus/theme-common": "3.5.2-canary-6127",
"@docusaurus/theme-mermaid": "3.5.2-canary-6127",
"@mdx-js/react": "^3.0.0",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.2.1",
Expand All @@ -47,12 +48,10 @@
"url-loader": "^4.1.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.4.0",
"@swc/core": "^1.5.7",
"@docusaurus/module-type-aliases": "3.5.2-canary-6127",
"husky": "^7.0.4",
"markdownlint": "^0.25.1",
"markdownlint-cli2": "^0.4.0",
"swc-loader": "^0.2.6"
"markdownlint-cli2": "^0.4.0"
},
"engines": {
"node": ">=18.0"
Expand Down
Loading

0 comments on commit aa466d9

Please sign in to comment.