-
-
Notifications
You must be signed in to change notification settings - Fork 69
enhance: more robust try-catch on HMR ts-morph actions #305
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
Caution Review failedThe pull request is closed. WalkthroughAdds try-catch around ts-morph updates in handleHotUpdate for TypeScript files. On errors, reports via this.error. Keeps existing behavior: create new SourceFile and ensure Vite module graph entry for new files; replace content for existing files. No public API changes. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Vite as Vite HMR
participant Plugin as Vite Plugin
participant TS as ts-morph
Dev->>Vite: Save TS file
Vite->>Plugin: handleHotUpdate(file, content)
Plugin->>Plugin: try { ... }
alt New TS file
Plugin->>TS: createSourceFile(path, content)
Plugin->>Vite: ensure module graph entry
else Existing TS file
Plugin->>TS: replace text with content
end
Plugin-->>Vite: continue HMR pipeline
opt Error
Plugin->>Plugin: catch(e)
Plugin->>Vite: this.error(formatted message)
end
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 selected for processing (1)
✨ 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 (
|
✅ Deploy Preview for vue-vine ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@vue-vine/compiler
create-vue-vine
@vue-vine/eslint-config
@vue-vine/eslint-parser
@vue-vine/eslint-plugin
@vue-vine/language-server
@vue-vine/language-service
@vue-vine/nuxt
vue-vine-tsc
@vue-vine/vite-plugin
vue-vine
commit: |
Since ts-morph action may cause panic on HMR, it's more robust to add a try-catch here.
Summary by CodeRabbit