-
-
Notifications
You must be signed in to change notification settings - Fork 69
enhance(hmr): improve hmr when create new file then import #303
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
✅ Deploy Preview for vue-vine ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Caution Review failedThe pull request is closed. WalkthroughRefactors Vine HMR into a dedicated manager with dependency analysis, updates Vite plugin hot-update flow to delegate to the manager, and adds ts-morph support for newly created files. E2E tests gain file-creation/deletion helpers and a new scenario covering HMR when introducing new Vine files. Changes
Sequence Diagram(s)sequenceDiagram
participant Vite as Vite Dev Server
participant HMR as VineHMRManager
participant Analyzer as ComponentDependencyAnalyzer
participant Compiler as Vine Compiler
participant Graph as Vite Module Graph
Vite->>HMR: handleHMR(ctx, compilerCtx, hooks)
HMR->>Compiler: Re-parse/reanalyze Vine file(s)
HMR->>Analyzer: analyzeDependencies(fileCtx)
Analyzer-->>HMR: Dependency graph/topo order
HMR->>Graph: Invalidate/ensure modules (incl. new files)
HMR-->>Vite: Modules to update or full reload
sequenceDiagram
participant Vite as Vite handleHotUpdate
participant TS as ts-morph Project
participant Graph as Vite Module Graph
Vite->>TS: get SourceFile(ctx.file)?
alt exists
Vite->>TS: replaceWithText(updatedContent)
else
Vite->>TS: createSourceFile(ctx.file, updatedContent)
Vite->>Graph: ensureEntryFromUrl(ctx.file)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
✨ 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 (
|
@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: |
I found that using a component in template after importing a component from a new
.vine.ts
file doesn't trigger HMR.So this is a fix with E2E test.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Tests