-
-
Notifications
You must be signed in to change notification settings - Fork 31
fix(types): change definePage to global scope
#229
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
WalkthroughUpdated TypeScript global augmentation for definePage in packages/core/client.d.ts, switching from globalThis namespace augmentation to a declare global block. The DefinePage type import path is unchanged. Other declarations remain intact, and the file still ends with export {}. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 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. ✨ 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 (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/core/client.d.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/core/client.d.ts (2)
packages/core/src/index.ts (1)
transform(86-143)packages/core/src/page.ts (2)
Page(14-73)hasChanged(34-37)
🔇 Additional comments (2)
packages/core/client.d.ts (2)
9-11: Macro is now truly global; matches Vue’s macros pattern.
declare global { const definePage: import('.').DefinePage }is the right shape for a global macro and avoids import requirements in user code. Good alignment with@vue/runtime-core’s declarations.
13-13: Keepexport {}to ensure module context fordeclare global.Required so the file is treated as a module; otherwise global augmentation won’t apply reliably.
|
那这样的话, |
|
有这个文件那 tsconfig 就可以不加 client 了,没注意看到这个 🙃 |
Description 描述
修复
definePage全局声明错误,原来的写法需要import使用。参考
@vue/runtime-core:Summary by CodeRabbit