-
Notifications
You must be signed in to change notification settings - Fork 2
fix: base is not included in pathname #152
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
Conversation
🦋 Changeset detectedLatest commit: 572559b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Caution Review failedThe pull request is closed. WalkthroughSwitch runtime data access from usePageData to useSite/usePage across several components, remove deprecated ESLint disables, tweak sidebar link resolution in theme.tsx, bump multiple dependencies, and add a changeset noting a patch fix for pathname base inclusion. No exported APIs changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Component (VersionsNav/ExternalSiteLink/OpenAPIRef/Layout)
participant R as @rspress/core/runtime
participant S as Site/Page Data
C->>R: useSite() / usePage()
R-->>C: { site } / { page }
C->>C: Read site.lang/title/themeConfig
C-->>C: Render UI / compute links
sequenceDiagram
autonumber
participant L as Layout (theme.tsx)
participant S as Site
participant U as URL Utils
L->>S: site = useSite().site
L->>U: sidebar.link || '' → cleanupUrlPath(...)
U-->>L: normalized sidebarLink
L->>U: withBase(pdfLink)
U-->>L: pdf href
L-->>L: Render with updated links
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Signed-off-by: JounQin <admin@1stg.me>
commit: |
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.
Pull Request Overview
This PR migrates from deprecated usePageData hook to the new usePage and useSite hooks from @rspress/core/runtime, while also updating package versions. The changes address the deprecation warnings and ensure compatibility with the updated @RsPress framework.
- Replace
usePageDatawithusePageanduseSitehooks across multiple components - Remove
withBaseusage in sidebar link processing - Update @RsPress packages from beta.26 to beta.27 and other dependency versions
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/theme.tsx | Replace usePageData with useSite and remove withBase from sidebar link processing |
| src/runtime/components/Overview.tsx | Remove deprecated comment about usePage not being exported |
| src/runtime/components/OpenAPIRef.tsx | Replace usePageData with usePage hook |
| src/runtime/components/ExternalSiteLink.tsx | Replace usePageData with useSite hook |
| src/global/VersionsNav/index.tsx | Replace usePageData with useSite hook and update variable references |
| src/global/SiteOverrides/index.tsx | Remove deprecated comment |
| package.json | Update @RsPress packages and other dependencies to newer versions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Summary by CodeRabbit
Bug Fixes
Refactor
Chores