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

Upgrade Docusaurus - enable Docusaurus Faster #385

Merged
merged 14 commits into from
Nov 8, 2024

Conversation

slorber
Copy link
Contributor

@slorber slorber commented Oct 25, 2024

  • Upgrade website to Docusaurus v3.6
  • Make this plugin compatible with Docusaurus Faster
  • Keep retro-compatibility with lower versions

Benchmark

Cold builds - 3.3x faster:

hyperfine --prepare 'yarn workspace redocusaurus-website clear' --runs 3 'DOCUSAURUS_FASTER=false yarn build:website' 'DOCUSAURUS_FASTER=true yarn build:website'


Benchmark 1: DOCUSAURUS_FASTER=false yarn build:website
  Time (mean ± σ):     15.677 s ±  1.331 s    [User: 26.425 s, System: 5.220 s]
  Range (min … max):   14.732 s … 17.199 s    3 runs

Benchmark 2: DOCUSAURUS_FASTER=true yarn build:website
  Time (mean ± σ):      4.714 s ±  0.558 s    [User: 7.375 s, System: 1.040 s]
  Range (min … max):    4.185 s …  5.297 s    3 runs

Summary
  DOCUSAURUS_FASTER=true yarn build:website ran
    3.33 ± 0.48 times faster than DOCUSAURUS_FASTER=false yarn build:website

Warn builds - almost the same:

DOCUSAURUS_FASTER=false yarn build:website
hyperfine --runs 3 'DOCUSAURUS_FASTER=false yarn build:website' 'DOCUSAURUS_FASTER=true yarn build:website'

Benchmark 1: DOCUSAURUS_FASTER=false yarn build:website
  Time (mean ± σ):      4.637 s ±  0.308 s    [User: 5.878 s, System: 0.614 s]
  Range (min … max):    4.282 s …  4.842 s    3 runs

Benchmark 2: DOCUSAURUS_FASTER=true yarn build:website
  Time (mean ± σ):      4.230 s ±  0.139 s    [User: 6.986 s, System: 1.055 s]
  Range (min … max):    4.075 s …  4.346 s    3 runs

Summary
  DOCUSAURUS_FASTER=true yarn build:website ran
    1.10 ± 0.08 times faster than DOCUSAURUS_FASTER=false yarn build:website

Tests

Note: I'd recommend testing in particular Prism code blocks because I had weird SSG errors that I fixed with facebook/docusaurus#10618

Copy link

changeset-bot bot commented Oct 25, 2024

🦋 Changeset detected

Latest commit: 2c78273

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
docusaurus-theme-redoc Minor
redocusaurus Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Oct 25, 2024

@slorber is attempting to deploy a commit to the Rohit Gohri's projects Team on Vercel.

A member of the Team first needs to authorize it.

@slorber slorber marked this pull request as draft October 25, 2024 15:28
Copy link

vercel bot commented Oct 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
redocusaurus ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2024 9:02am

Copy link
Contributor Author

@slorber slorber left a comment

Choose a reason for hiding this comment

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

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

PR is ready to review.

Since this plugin is not compatible with Rspack out of the box, I'd recommend releasing a new version in the near future.

packages/docusaurus-theme-redoc/src/index.ts Show resolved Hide resolved
@slorber slorber marked this pull request as ready for review November 4, 2024 14:06
@wilhelmer
Copy link

Thank you for this! Would love to see this released in the near future 👌

website/package.json Outdated Show resolved Hide resolved
@rohit-gohri rohit-gohri added the dependencies Pull requests that update a dependency file label Nov 8, 2024
@rohit-gohri rohit-gohri merged commit a986be6 into rohit-gohri:main Nov 8, 2024
5 of 6 checks passed
@github-actions github-actions bot mentioned this pull request Nov 8, 2024
@rohit-gohri
Copy link
Owner

Should be out in 2.2.0 (after CI runs)

@slorber
Copy link
Contributor Author

slorber commented Nov 8, 2024

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants