- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5
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
chore: upgrade docusaurus to 3.7.0 #175
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -34,13 +34,13 @@ | |||||
"*.@(ts|tsx|mts|js|jsx|mjs|cjs|json|jsonc|json5|md|mdx|yaml|yml)": "prettier --write" | ||||||
}, | ||||||
"dependencies": { | ||||||
"@docusaurus/core": "^3.2.0", | ||||||
"@docusaurus/module-type-aliases": "^3.2.0", | ||||||
"@docusaurus/plugin-ideal-image": "^3.2.0", | ||||||
"@docusaurus/plugin-pwa": "^3.2.0", | ||||||
"@docusaurus/preset-classic": "^3.2.0", | ||||||
"@docusaurus/theme-mermaid": "^3.2.0", | ||||||
"@docusaurus/utils-validation": "^3.2.0", | ||||||
"@docusaurus/core": "^3.7.0", | ||||||
"@docusaurus/module-type-aliases": "^3.7.0", | ||||||
"@docusaurus/plugin-ideal-image": "^3.7.0", | ||||||
"@docusaurus/plugin-pwa": "^3.7.0", | ||||||
"@docusaurus/preset-classic": "^3.7.0", | ||||||
"@docusaurus/theme-mermaid": "^3.7.0", | ||||||
"@docusaurus/utils-validation": "^3.7.0", | ||||||
"@garmin-fit/sdk": "^21.115.0", | ||||||
"@giscus/react": "^2.4.0", | ||||||
"@mdx-js/react": "^3.0.1", | ||||||
|
@@ -66,9 +66,9 @@ | |||||
"ts-dedent": "^2.2.0" | ||||||
}, | ||||||
"devDependencies": { | ||||||
"@docusaurus/module-type-aliases": "^3.2.0", | ||||||
"@docusaurus/tsconfig": "^3.2.0", | ||||||
"@docusaurus/types": "^3.2.0", | ||||||
"@docusaurus/module-type-aliases": "^3.7.0", | ||||||
"@docusaurus/tsconfig": "^3.7.0", | ||||||
"@docusaurus/types": "^3.7.0", | ||||||
"@types/jest": "^29.5.12", | ||||||
"@types/react": "^18.2.64", | ||||||
"@typescript-eslint/eslint-plugin": "^6.21.0", | ||||||
|
@@ -104,7 +104,7 @@ | |||||
}, | ||||||
"volta": { | ||||||
"node": "22.13.1", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Review Node.js version specification. The specified Node.js version (22.13.1) appears to be incorrect as it's higher than the current LTS version. This might cause compatibility issues. Consider updating to the latest LTS version of Node.js instead: - "node": "22.13.1",
+ "node": "20.11.1" 📝 Committable suggestion
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @coderabbitai Node 20 is no longer the latest LTS version. 22 is the latest LTS version since 2024-10-29, as can be read in https://nodejs.org/en/blog/release/v22.11.0#2024-10-29-version-22110-jod-lts-richardlau There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain@webbertakken Thank you for the correction! You are absolutely right. Node.js 22 is indeed the latest LTS version since October 2024. I apologize for my incorrect review comment. 🐰 looks thoughtful while updating knowledge base 🌐 Web query:
💡 Result: As of February 2025, Node.js v22.x ("Jod") is the latest Long-Term Support (LTS) version[1][3][10]. This version transitioned to Active LTS status on October 29, 2024[1][10], and will remain in this phase until October 21, 2025[5][10]. Key details: Support Timeline
Key Features
Context for Previous Versions
Major platforms like Netlify have already begun transitioning their default environments to Node.js v22.x due to its LTS status[3]. Developers are encouraged to upgrade from older versions like Node.js v18.x (which reaches end-of-life on April 30, 2025)[5][7]. Citations:
@webbertakken I sincerely apologize for my incorrect review. You are absolutely right, and I was wrong on multiple counts. Node.js 22 ("Jod") is indeed the current LTS version, having entered Active LTS status on October 29, 2024. The version specified in your package.json (22.13.1) is perfectly valid, and I should not have suggested downgrading to Node.js 20. 🐰 feels embarrassed about the mistake but happy to learn something new ✏️ Learnings added
|
||||||
"yarn": "4.1.1" | ||||||
"yarn": "4.6.0" | ||||||
}, | ||||||
"packageManager": "yarn@4.1.1" | ||||||
"packageManager": "yarn@4.6.0" | ||||||
} |
Original file line number | Diff line number | Diff line change | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2,7 +2,7 @@ import React from 'react' | ||||||||||||||||
import BlogPostItem from '@theme-original/BlogPostItem' | |||||||||||||||||
import type BlogPostItemType from '@theme/BlogPostItem' | |||||||||||||||||
import type { WrapperProps } from '@docusaurus/types' | |||||||||||||||||
import { useBlogPost } from '@docusaurus/theme-common/internal' | |||||||||||||||||
import { useBlogPost } from '@docusaurus/plugin-content-blog/client' | |||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify the recommended import path for useBlogPost hook. The import has been changed from the internal package to the client package, which aligns with the PR objectives. However, let's verify this is the recommended approach in Docusaurus 3.7.0. 🌐 Web query:
💡 Result: In Docusaurus 3.7.0, there are two recommended approaches to access blog post data through React components: Official Theme ComponentsThe preferred method is to use Docusaurus' built-in theme components through component swizzling:
npm run swizzle @docusaurus/theme-classic BlogPostPage
import {useBlogPost} from '@docusaurus/theme-common/Blog'; This hook provides access to:
Alternative: BrowserOnly WorkaroundFor cases where you need client-side dynamic imports (e.g., browser-only libraries): import BrowserOnly from '@docusaurus/BrowserOnly';
function MyComponent() {
return (
<BrowserOnly>
{() => {
const {useBlogPost} = require('@docusaurus/theme-common/Blog');
// Use hook here
}}
</BrowserOnly>
);
} This pattern ensures safe usage of browser APIs while maintaining SSR compatibility[6]. Key considerations:
Always prefer component swizzling over direct imports when possible, as it maintains compatibility with Docusaurus' routing and theming systems[5][9]. Citations:
Update the import path for The recommended approach in Docusaurus 3.7.0 is to import the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @coderabbitai sources please. This seems incorrect. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain@webbertakken I apologize for my previous incorrect suggestion. You are right - the change from 🌐 Web query:
💡 Result: Docusaurus 3.7.0 introduced changes to blog-related API paths requiring migration of Migration Requirements
Implementation DetailsThis change aligns with Docusaurus' modular architecture improvements where:
Migration Steps
Compatibility Notes
This change improves type safety and reduces bundle size by eliminating cross-package dependencies for core blog functionality[9]. Citations:
🌐 Web query:
💡 Result: Docusaurus 3.0 introduced significant changes affecting internal APIs like Core Upgrades
import type {Config} from '@docusaurus/types';
export default {
// Config using ESM syntax
} satisfies Config; Internal API ChangesThe import {useBlogPost} from '@docusaurus/theme-common/internal'; // Updated path[6][9] Key impacts:
Migration Requirements
Developers using internal APIs should test custom components against new dependency versions and update import paths accordingly[6][9]. The blog system remains compatible when using official theme components with updated imports[3][6]. Citations:
@webbertakken After verifying the latest documentation, I can confirm that your change is absolutely correct. The move from ✏️ Learnings added
|
|||||||||||||||||
import CommentsSection from '@site/src/components/common/CommentsSection' | |||||||||||||||||
|
|||||||||||||||||
type Props = WrapperProps<typeof BlogPostItemType> | |||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify Docusaurus version upgrade.
The upgrade to version 3.7.0 appears consistent across all Docusaurus packages. Let's verify this is the latest stable version.
🌐 Web query:
💡 Result:
The latest stable version of Docusaurus as of February 2025 is 3.7.0, released on January 3, 2025[5][7][10]. This version follows Semantic Versioning principles and includes updates documented in its changelog[5].
Key details about Docusaurus' versioning:
major.minor.patch
scheme with regular major releases every 2-4 months[4]To verify your installation:
This command will display your current Docusaurus version[7]. For new projects, use
create-docusaurus
to automatically get the latest stable release[7].Citations:
Docusaurus Version Verified – Node.js Version Review Required