Skip to content

Docusaurus v3.6 - enable Docusaurus Faster - #1003

Merged
sserrata merged 4 commits into
PaloAltoNetworks:mainfrom
slorber:slorber/docusaurus-faster
Nov 4, 2024
Merged

sserrata merged 4 commits into
PaloAltoNetworks:mainfrom
slorber:slorber/docusaurus-faster

Conversation

@slorber

@slorber slorber commented Oct 25, 2024

Copy link
Copy Markdown
Contributor

Description

Upgrade to Docusaurus v3.6 - Enable Docusaurus Faster

Motivation and Context

It's faster, see meta/docusaurus#10556

Benchmarks

Cold builds - almost 3x faster:

hyperfine --prepare 'yarn workspace demo clear' --runs 3 'DOCUSAURUS_FASTER=false yarn build-demo' 'DOCUSAURUS_FASTER=true yarn build-demo'


Benchmark 1: DOCUSAURUS_FASTER=false yarn build-demo
  Time (mean ± σ):     26.049 s ±  0.252 s    [User: 49.003 s, System: 5.959 s]
  Range (min … max):   25.885 s … 26.340 s    3 runs

Benchmark 2: DOCUSAURUS_FASTER=true yarn build-demo
  Time (mean ± σ):      9.726 s ±  0.063 s    [User: 16.771 s, System: 2.176 s]
  Range (min … max):    9.661 s …  9.787 s    3 runs

Summary
  DOCUSAURUS_FASTER=true yarn build-demo ran
    2.68 ± 0.03 times faster than DOCUSAURUS_FASTER=false yarn build-demo

Rebuilds - a bit slower (for now) but acceptable

DOCUSAURUS_FASTER=false yarn build-demo
hyperfine --runs 3 'DOCUSAURUS_FASTER=false yarn build-demo' 'DOCUSAURUS_FASTER=true yarn build-demo'


Benchmark 1: DOCUSAURUS_FASTER=false yarn build-demo
  Time (mean ± σ):      8.134 s ±  1.780 s    [User: 8.932 s, System: 1.315 s]
  Range (min … max):    7.032 s … 10.188 s    3 runs

Benchmark 2: DOCUSAURUS_FASTER=true yarn build-demo
  Time (mean ± σ):     10.235 s ±  0.553 s    [User: 16.756 s, System: 2.246 s]
  Range (min … max):    9.836 s … 10.867 s    3 runs

Summary
  DOCUSAURUS_FASTER=false yarn build-demo ran
    1.26 ± 0.28 times faster than DOCUSAURUS_FASTER=true yarn build-demo

"eslint-plugin-prettier": "^5.0.1"
},
"dependencies": {
"@docusaurus/theme-common": "^3.5.0",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: I had to use the canary here otherwise it seems the ^ range doesn't resolve to the demo pre-release, leading to a duplicated package, leading to SSG errors due to providers.

This can be reverted once v3.6 is out

"docusaurus-plugin-sass": "^0.2.3",
"file-saver": "^2.0.5",
"lodash": "^4.17.20",
"node-polyfill-webpack-plugin": "^2.0.1",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This makes the plugin compatible with Rspack, see https://github.com/Richienb/node-polyfill-webpack-plugin/releases/tag/v3.0.0

3.0 is only this change, but baybe you could also upgrade to v4.0 although I'm not sure it's side-effect free

@github-actions

github-actions Bot commented Oct 27, 2024 •

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit e6ef3c4):

https://docusaurus-openapi-36b86--pr1003-m7ftbvnh.web.app

(expires Wed, 04 Dec 2024 14:31:52 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@slorber
slorber marked this pull request as ready for review November 4, 2024 13:11
@slorber

slorber commented Nov 4, 2024 •

Copy link
Copy Markdown
Contributor Author

v3.6 is out: https://docusaurus.io/blog/releases/3.6

PR ready to review

I kept the former ^3.5.0 range you used, I don't think it's necessary to require a newer version of Docusaurus.


Note the HTML minifier reports a few errors on the demo site, you might want to investigate those so that plugin users do not get invalid markup + the console errors.

See also meta/docusaurus#10580

CleanShot 2024-11-04 at 14 15 13@2x

@sserrata sserrata closed this Nov 4, 2024
@sserrata sserrata reopened this Nov 4, 2024

This branch had an error being deployed

1 failed deployment
default — e6ef3c48 Deployed Nov 4, 2024 by slorber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants