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

[WIP] Upgrade Docusaurus to v3.7.0 #6851

Merged
merged 23 commits into from
Feb 3, 2025
Merged

[WIP] Upgrade Docusaurus to v3.7.0 #6851

merged 23 commits into from
Feb 3, 2025

Conversation

JKarlavige
Copy link
Collaborator

@JKarlavige JKarlavige commented Jan 29, 2025

What are you changing in this pull request and why?

This upgrades Docusaurus to v3.7.0. The primary goal for the upgrade is to access new Docusaurus Faster features, which will hopefully improve the build times, and reduce the bundle sizes.

Preview

Click through the site and verify pages working correctly:

Notes

I was unable to get the rspackBundler working due to us using the @stoplight/elements package in our api pages. Rspack replaces Webpack for bundling the site, but we have a custom webpack config plugin which sets a Node polyfill to allow this package to work.

This webpack config is supposed to continue to work when using the Rspack bundler, but i haven't been able to figure it out. Will save that to try again on a rainy day... When it comes time to try enabling rspackBundler again, we can follow these steps:

  1. Set rspackBundler: true in docusaurus.config.js
  2. Upgrade node-polyfill-webpack-plugin to latest version (or at least >= v3)
  3. Resolve errors occurring on /dbt-cloud/api-v2 and /dbt-cloud/api-v3 pages.

More deets in this Git thread.

Copy link

vercel bot commented Jan 29, 2025

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

Name Status Preview Updated (UTC)
docs-getdbt-com ✅ Ready (Inspect) Visit Preview Feb 3, 2025 2:25pm

@github-actions github-actions bot added the size: large This change will more than a week to address and might require more than one person label Jan 29, 2025
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is currently redirected, so opted to delete rather than update to support it in the new Docusaurus version.

@JKarlavige JKarlavige marked this pull request as ready for review January 30, 2025 16:03
@JKarlavige JKarlavige requested a review from a team as a code owner January 30, 2025 16:03
@@ -270,7 +268,6 @@ var siteSettings = {
],
plugins: [
[path.resolve("plugins/insertMetaTags"), { metatags }],
path.resolve("plugins/svg"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This custom svg plugin was created during the initial Docusaurus setup. It didn't feel necessary, and svgs still appear to work after removing this plugin.

@JKarlavige
Copy link
Collaborator Author

Re: the rspackBundler issue noted in the description - the Docusaurus maintainer helped me resolve the current webpack bug I was running into. But now after updating the polyfill package, i'm running into a separate error. I'll keep digging into it.

@john-rock feel free to hold off on the review for this for now.

@JKarlavige
Copy link
Collaborator Author

@john-rock Okay I gave up on trying to make the rspackBundler feature work for now, so this is ready for review.

@slorber
Copy link

slorber commented Jan 31, 2025

You give up fast 😅

If you can't upgrade to v4 due to the documented breaking changes, v3 is also compatible and works:

"node-polyfill-webpack-plugin": "^3.0.0",

Your site now bundles in 15s instead of 60s

@JKarlavige
Copy link
Collaborator Author

You give up fast 😅

@slorber I was doing my best to avoid the potential rabbit hole of getting stuck on this another day 😅

If you can't upgrade to v4 due to the documented breaking changes, v3 is also compatible and works:

"node-polyfill-webpack-plugin": "^3.0.0",

Your site now bundles in 15s instead of 60s

That did it. The process is undefined error went away after downgrading the polyfill package from v4 to v3. Our api pages still work without error.

That latest deploy was the fastest we've ever had for our Docs site. Again, thank you for your help with this and following up here with that suggestion!
image

Copy link
Contributor

@john-rock john-rock left a comment

Choose a reason for hiding this comment

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

lgtm, clicked through a variety of pages and everything seems to be working as expected. Love to see the faster build times.

Just dropped a comment about a {} inside package.json.

package.json Outdated
@@ -0,0 +1 @@
{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Leftover artifact?

@JKarlavige JKarlavige merged commit ab8ad86 into current Feb 3, 2025
7 checks passed
@JKarlavige JKarlavige deleted the upgrade-docusaurus branch February 3, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: large This change will more than a week to address and might require more than one person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants