-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat(kit): support async constructor for adding plugins #33619
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
base: main
Are you sure you want to change the base?
Conversation
|
|
WalkthroughThis PR converts several build-plugin APIs in packages/kit/src/build.ts to support asynchronous resolution. It adds local utility types Arrayable and Thenable, and changes signatures and internal flows to accept/return Thenable values. Updated members include extendViteConfig, extendWebpackCompatibleConfig, addVitePlugin, addWebpackPlugin, addRspackPlugin, AddBuildPluginFactory, and the internal wiring that awaits plugin getters and config mutation hooks. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (4)📓 Common learnings📚 Learning: 2024-11-28T21:22:40.496ZApplied to files:
📚 Learning: 2024-11-11T12:34:22.648ZApplied to files:
📚 Learning: 2024-11-05T15:22:54.759ZApplied to files:
🧬 Code graph analysis (1)packages/kit/src/build.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
🔇 Additional comments (5)
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. Comment |
@nuxt/kit
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
CodSpeed Performance ReportMerging #33619 will not alter performanceComparing Summary
|
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.
👌
(need to investigate lint failure)
I think it's a common use case to install plugins lazily, imagine:
The current workaround is:
But this would defeat the point of the factory function to lazy load, as
would result in loading unnecessary code.
This PR makes those utility support async usages.
Not sure if there are any performance concerns on this tho.