Repository navigation
perf(kit,nuxt): use lazy imports to improve parsing speed - #35901
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
WalkthroughSelected Kit and Nuxt dependencies are changed from static to dynamic imports. Jiti creation is cached per Nuxt instance, schema loading is initialised lazily, and typed-router utilities load during type preparation. The development-log plugin lazily loads Consola and Devalue and only emits parsed SSR logs when log content is present. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/kit/src/module/install.ts`:
- Around line 287-298: Cache in-flight lazy-loader promises to prevent duplicate
initialization during concurrent calls. In packages/kit/src/module/install.ts
lines 287-298, change _jitiCache to store Promise<Jiti>, create and store the
promise immediately after a cache miss, then await and return it. In
packages/nuxt/src/core/schema.ts lines 21-37, make _resolveSchema promise-backed
and share the pending initialization using the same pattern.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f0a298c1-3e5f-432e-9d6f-ed384181c28b
📒 Files selected for processing (5)
packages/kit/src/module/define.tspackages/kit/src/module/install.tspackages/nuxt/src/app/plugins/dev-server-logs.tspackages/nuxt/src/core/schema.tspackages/nuxt/src/pages/module.ts
@nuxt/kit
@nuxt/nitro-server
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
Merging this PR will not alter performance
Comparing Footnotes
|
1d818d5 to
cd3271f
Compare
🔗 Linked issue
📚 Description
noticed when doing some perf testing that the cost of importing
jitianduntyped/babel-pluginare considerable in terms of parsing, when they might not be needed