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

Docusaurus v3.6 - enable Docusaurus Faster #1003

Merged
merged 4 commits into from
Nov 4, 2024

Conversation

slorber
Copy link
Contributor

@slorber slorber commented Oct 25, 2024

Description

Upgrade to Docusaurus v3.6 - Enable Docusaurus Faster

Motivation and Context

It's faster, see facebook/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

"@types/crypto-js": "^4.1.0",
"@types/file-saver": "^2.0.5",
"@types/lodash": "^4.14.176",
"concurrently": "^5.2.0",
"eslint-plugin-prettier": "^5.0.1"
},
"dependencies": {
"@docusaurus/theme-common": "^3.5.0",
Copy link
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

@@ -47,7 +47,7 @@
"docusaurus-plugin-sass": "^0.2.3",
"file-saver": "^2.0.5",
"lodash": "^4.17.20",
"node-polyfill-webpack-plugin": "^2.0.1",
Copy link
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

Copy link

github-actions bot commented Oct 27, 2024

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
Copy link
Contributor Author

slorber commented Nov 4, 2024

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 facebook/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
@sserrata sserrata merged commit 9163472 into PaloAltoNetworks:main Nov 4, 2024
17 of 19 checks passed
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