-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
refactor: downgrade to nitro v2 #32252
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
|
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.
Pull Request Overview
This PR refactors the Nuxt codebase to downgrade support from Nitro to NitroPack v2. The changes replace package and import references throughout the codebase and update related documentation and configuration files.
- Replace import paths from 'nitro' to 'nitropack'
- Update package.json dependencies to use nitropack v2
- Adjust configuration settings and module aliases to support NitroPack
Reviewed Changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/nuxt/src/core/runtime/nitro/utils/cache.ts | Update storage import from nitro/runtime to nitropack/runtime |
packages/nuxt/src/core/runtime/nitro/plugins/dev-server-logs.ts | Update type imports from nitro/types to nitropack/types |
packages/nuxt/src/core/runtime/nitro/handlers/*.ts | Update various handler imports to use nitropack/runtime and types |
packages/nuxt/src/core/plugins/resolved-externals.ts | Adjust external resolution to reference nitropack/runtime/meta |
packages/nuxt/src/core/nuxt.ts | Update VirtualFSPlugin aliases and add new alias mappings for nitropack/runtime |
packages/nuxt/src/core/nitro.ts | Replace import paths and add appConfig and priority configuration for useAppConfig |
packages/nuxt/src/app/*.ts | Update various type imports from nitro/types to nitropack/types |
packages/kit/src/pages.ts, packages/kit/src/nitro.ts | Update type imports from nitro/types to nitropack/types |
package.json files and docs | Replace dependency versions from nitro to nitropack and update documentation accordingly |
Comments suppressed due to low confidence (1)
packages/nuxt/src/core/nitro.ts:248
- The addition of 'priority: -1' may affect the ordering of import execution. Please verify that a negative priority is intentional and that its behavior is well-documented in the configuration context.
priority: -1,
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
WalkthroughThis set of changes systematically updates import paths, type declarations, and module augmentations throughout the codebase, shifting references from the 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (20)
✨ Finishing Touches
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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
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: 0
🧹 Nitpick comments (1)
packages/nuxt/types.d.ts (1)
18-43
: Consider consolidating duplicate module declarations.There are now two module declarations with identical interface definitions - one for
'nitropack'
(lines 18-43) and one for'nitropack/types'
(lines 44-69). This duplication might lead to maintenance issues and confusion.Consider whether both module declarations are necessary, or if they can be consolidated to reduce duplication:
-declare module 'nitropack' { - interface NitroRuntimeConfigApp { - buildAssetsDir: string - cdnURL: string - } - // ... other interfaces -} declare module 'nitropack/types' { interface NitroRuntimeConfigApp { buildAssetsDir: string cdnURL: string } // ... other interfaces }Also applies to: 44-69
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (7)
package.json
is excluded by!package.json
,!**/package.json
packages/kit/package.json
is excluded by!**/package.json
packages/nuxt/package.json
is excluded by!**/package.json
packages/schema/package.json
is excluded by!**/package.json
packages/vite/package.json
is excluded by!**/package.json
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
,!pnpm-lock.yaml
test/fixtures/basic/package.json
is excluded by!**/package.json
📒 Files selected for processing (43)
docs/2.guide/3.going-further/1.events.md
(1 hunks)docs/2.guide/3.going-further/3.modules.md
(1 hunks)docs/3.api/5.kit/11.nitro.md
(1 hunks)packages/kit/src/nitro.ts
(2 hunks)packages/kit/src/pages.ts
(1 hunks)packages/nuxt/src/app/composables/fetch.ts
(1 hunks)packages/nuxt/src/app/composables/manifest.ts
(1 hunks)packages/nuxt/src/app/composables/ssr.ts
(1 hunks)packages/nuxt/src/app/nuxt.ts
(1 hunks)packages/nuxt/src/core/nitro.ts
(3 hunks)packages/nuxt/src/core/nuxt.ts
(1 hunks)packages/nuxt/src/core/plugins/resolved-externals.ts
(2 hunks)packages/nuxt/src/core/runtime/nitro/handlers/error.ts
(1 hunks)packages/nuxt/src/core/runtime/nitro/handlers/island.ts
(1 hunks)packages/nuxt/src/core/runtime/nitro/handlers/renderer.ts
(1 hunks)packages/nuxt/src/core/runtime/nitro/plugins/dev-server-logs.ts
(1 hunks)packages/nuxt/src/core/runtime/nitro/utils/cache.ts
(1 hunks)packages/nuxt/src/core/runtime/nitro/utils/paths.ts
(1 hunks)packages/nuxt/src/core/runtime/nitro/utils/renderer/app.ts
(1 hunks)packages/nuxt/src/core/runtime/nitro/utils/renderer/build-files.ts
(1 hunks)packages/nuxt/src/core/runtime/nitro/utils/renderer/payload.ts
(1 hunks)packages/nuxt/src/core/templates.ts
(3 hunks)packages/nuxt/src/pages/module.ts
(3 hunks)packages/nuxt/src/pages/route-rules.ts
(1 hunks)packages/nuxt/src/pages/runtime/composables.ts
(1 hunks)packages/nuxt/test/nitro/render-index.ts
(1 hunks)packages/nuxt/types.d.mts
(2 hunks)packages/nuxt/types.d.ts
(2 hunks)packages/schema/src/config/nitro.ts
(3 hunks)packages/schema/src/config/typescript.ts
(1 hunks)packages/schema/src/types/config.ts
(1 hunks)packages/schema/src/types/debug.ts
(1 hunks)packages/schema/src/types/hooks.ts
(1 hunks)packages/schema/src/types/schema.ts
(1 hunks)packages/vite/src/client.ts
(1 hunks)packages/vite/src/server.ts
(4 hunks)packages/webpack/src/configs/server.ts
(1 hunks)packages/webpack/src/presets/base.ts
(1 hunks)packages/webpack/src/webpack.ts
(1 hunks)test/bundle.test.ts
(3 hunks)test/fixtures/basic-types/types.ts
(1 hunks)test/fixtures/basic/nuxt.config.ts
(1 hunks)test/fixtures/basic/postcss/plugin.ts
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
test/fixtures/basic/postcss/plugin.ts (1)
packages/nuxt/src/app/nuxt.ts (1)
Plugin
(226-230)
packages/vite/src/server.ts (1)
packages/vite/src/vite-node.ts (1)
initViteNodeServer
(176-199)
packages/nuxt/src/core/nuxt.ts (1)
packages/nuxt/src/core/plugins/virtual.ts (1)
VirtualFSPlugin
(15-92)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: build
- GitHub Check: lint-docs
- GitHub Check: code
- GitHub Check: lint-docs
🔇 Additional comments (58)
test/fixtures/basic/nuxt.config.ts (1)
207-211
: LGTM! PostCSS configuration correctly added.The PostCSS plugin configuration syntax is correct and properly references the custom plugin with appropriate empty options.
test/fixtures/basic/postcss/plugin.ts (1)
1-11
: LGTM! Well-structured PostCSS plugin implementation.The plugin correctly follows PostCSS conventions:
- Proper TypeScript typing with the
Plugin
interface- Standard function signature with options parameter
- Required
postcssPlugin
property in return object- Compatibility marker
postcss = true
correctly setThe minimal implementation is appropriate for a test fixture.
packages/nuxt/src/core/runtime/nitro/plugins/dev-server-logs.ts (1)
12-12
: Consistent type import update
The import has been correctly switched tonitropack/types
forNitroApp
, aligning with the downgrade to Nitro v2.packages/nuxt/src/core/runtime/nitro/utils/renderer/build-files.ts (1)
8-8
: Updated runtime config import
TheuseRuntimeConfig
import has been adjusted tonitropack/runtime
, ensuring compatibility with the v2 namespace.packages/nuxt/src/app/composables/ssr.ts (1)
4-4
: Fetch event type import adjusted
TheH3Event$Fetch
type is now imported fromnitropack/types
, matching the overall Nitro v2 migration.packages/nuxt/src/core/runtime/nitro/utils/cache.ts (1)
1-1
: Storage util import updated
TheuseStorage
import has been updated fromnitro/runtime
tonitropack/runtime
, consistent with the refactor.packages/nuxt/src/core/runtime/nitro/utils/renderer/payload.ts (1)
1-1
: RenderResponse type import switched
TheRenderResponse
type is now sourced fromnitropack/types
, aligning with the Nitro v2 refactoring.packages/schema/src/types/debug.ts (1)
1-1
: Switch import path tonitropack/types
TheNitroOptions
type import has been correctly updated to reflect the newnitropack
namespace.packages/nuxt/src/core/runtime/nitro/utils/renderer/app.ts (1)
2-2
: Usenitropack/runtime
for runtime config
TheuseRuntimeConfig
import has been updated to thenitropack/runtime
entrypoint, matching the PR's migration strategy.packages/nuxt/src/core/runtime/nitro/utils/paths.ts (1)
2-2
: Update runtime import tonitropack/runtime
UpdateduseRuntimeConfig
import to use thenitropack
package. This ensures consistent resolution of runtime config across the codebase.packages/nuxt/src/app/nuxt.ts (1)
10-10
: AdjustRenderResponse
type import namespace
Switched theRenderResponse
type import fromnitro/types
tonitropack/types
to align with the downgraded Nitro version.packages/nuxt/src/app/composables/manifest.ts (1)
5-5
: ImportNitroRouteRules
fromnitropack/types
TheNitroRouteRules
type import now reflects thenitropack
namespace, maintaining consistency in route rules typing.packages/nuxt/src/pages/route-rules.ts (1)
3-3
: Consistent import path migrationThe
NitroRouteConfig
import has been correctly updated fromnitro/types
tonitropack/types
, aligning with the PR’s goal of switching to Nitropack v2.packages/kit/src/pages.ts (1)
2-2
: Aligning type import with Nitropack v2The
NitroRouteConfig
type is now imported fromnitropack/types
instead ofnitro/types
, which matches the overall migration strategy.packages/nuxt/src/pages/runtime/composables.ts (1)
5-5
: Update composable’s Nitro type importThe import of
NitroRouteConfig
has been correctly switched tonitropack/types
, ensuring consistency with the other route rules updates.packages/schema/src/types/hooks.ts (1)
9-9
: Migrate Nitro hooks types to NitropackThis change accurately replaces the import of
Nitro
andNitroConfig
fromnitro/types
tonitropack/types
, in line with the refactor to Nitropack v2.packages/schema/src/types/config.ts (1)
6-6
: Switch Nitro config types to Nitropack namespaceThe types
NitroConfig
,NitroRuntimeConfig
, andNitroRuntimeConfigApp
are now imported fromnitropack/types
, completing the namespace migration for runtime configuration.packages/nuxt/src/core/runtime/nitro/handlers/island.ts (1)
1-2
: Namespace migration: nitro → nitropack
Imports have been correctly updated to'nitropack/runtime'
and'nitropack/types'
. Ensure that thenitropack
package is declared as a dependency and that no stray'nitro'
imports remain in this handler.packages/nuxt/src/core/runtime/nitro/handlers/error.ts (2)
2-2
: Update NitroErrorHandler import
TheNitroErrorHandler
type import has been migrated to'nitropack/types'
, aligning with the refactor. Verify that error handler types resolve correctly under the new namespace.
5-5
: Migrate runtime functions to nitropack
Updated imports foruseNitroApp
anduseRuntimeConfig
from'nitro/runtime'
to'nitropack/runtime'
. Confirm that runtime configuration and hook behaviour remain intact after this change.test/fixtures/basic-types/types.ts (1)
6-7
: Test fixtures updated to use nitropack
Imports forgetRouteRules
and theNitroRouteRules
type now reference'nitropack/runtime'
and'nitropack/types'
. Ensure coverage for both the directgetRouteRules
and aliasedgetNitroRouteRules
paths in these tests.packages/nuxt/test/nitro/render-index.ts (2)
1-1
: Review TS suppression comment
The// @ts-expect-error untyped
before the polyfills import may no longer be necessary now that typings are in place. Please verify if this suppression is still required or remove it for clarity.
3-3
: NitroApp type import updated
TheNitroApp
type is now correctly imported from'nitropack/types'
. Double-check that this aligns with the expected interface used in the test harness.docs/2.guide/3.going-further/1.events.md (1)
77-81
: Documentation namespace update
The module augmentation forNitroRuntimeHooks
has been updated to reference'nitropack/types'
instead of'nitro/types'
. Ensure the documentation build and any example snippets are updated accordingly.docs/3.api/5.kit/11.nitro.md (1)
120-120
: Import path updated tonitropack/types
The import source has been correctly migrated from'nitro/types'
to'nitropack/types'
, keeping documentation in sync with the refactor.packages/schema/src/types/schema.ts (1)
15-15
: Align type imports withnitropack
namespace
The Nitro-related types are now imported from'nitropack/types'
, which matches the updated package structure across the codebase.packages/nuxt/src/app/composables/fetch.ts (1)
2-2
: Update fetch type imports tonitropack/types
The type imports for$Fetch
,H3Event$Fetch
,NitroFetchRequest
, and related types correctly reference'nitropack/types'
as part of the migration.docs/2.guide/3.going-further/3.modules.md (1)
617-620
: Module augmentation updated tonitropack/types
The module declaration has been rewritten to extend interfaces from'nitropack/types'
, in line with the broader migration from the original Nitro package.packages/nuxt/src/core/plugins/resolved-externals.ts (1)
4-4
: LGTM! Import paths correctly updated for nitropack migration.The import type and dynamic import path have been consistently updated from
nitro
tonitropack
, aligning with the broader package migration across the codebase.Also applies to: 17-17
packages/vite/src/client.ts (1)
123-125
: LGTM! Temporary aliases added for smooth nitropack migration.The addition of
#internal/nitro
andnitropack/runtime
aliases alongside the existingnitro/runtime
alias ensures compatibility during the migration period. The TODO comment clearly indicates these are temporary measures for removal in v5.packages/nuxt/types.d.ts (1)
1-1
: LGTM! Reference directive correctly updated.The reference directive has been properly updated from
"nitro/types"
to"nitropack/types"
to align with the package migration.packages/nuxt/src/core/runtime/nitro/handlers/renderer.ts (1)
8-8
: LGTM! Import paths correctly migrated to nitropack.Both the type import (
RenderResponse
) and runtime function imports (defineRenderHandler
,getRouteRules
,useNitroApp
) have been consistently updated fromnitro
tonitropack
, maintaining functionality while using the new package namespace.Also applies to: 14-14
packages/webpack/src/webpack.ts (1)
53-59
: LGTM: Improved plugin deduplication logic.The updated logic correctly prevents duplicate
dynamic-require
plugins by removing any existing instances before adding the new one. This defensive approach ensures consistent plugin application across bothprerenderRollupPlugins
androllupPlugins
arrays.packages/schema/src/config/typescript.ts (1)
49-52
: LGTM: Temporary hoisting support for nitropack transition.The addition of nitropack module names to the TypeScript hoisting configuration properly supports the migration to nitropack v2 whilst maintaining compatibility. The TODO comment correctly indicates these are temporary additions planned for removal in v5.
packages/schema/src/config/nitro.ts (4)
7-7
: LGTM: Consistent type reference updates for nitropack migration.The JSDoc type import path changes from
'nitro/types'
to'nitropack/types'
correctly align the documentation with the broader migration to nitropack v2. These updates ensure accurate TypeScript intellisense and maintain consistency across the codebase.
42-42
: LGTM: Consistent type reference updates for nitropack migration.The JSDoc type import path changes from
'nitro/types'
to'nitropack/types'
correctly align the documentation with the broader migration to nitropack v2.
65-65
: LGTM: Consistent type reference updates for nitropack migration.The JSDoc type import path changes from
'nitro/types'
to'nitropack/types'
correctly align the documentation with the broader migration to nitropack v2.
72-72
: LGTM: Consistent type reference updates for nitropack migration.The JSDoc type import path changes from
'nitro/types'
to'nitropack/types'
correctly align the documentation with the broader migration to nitropack v2.packages/webpack/src/presets/base.ts (1)
131-133
: LGTM: Transitional alias support for nitropack migration.The addition of
'#internal/nitro'
and'nitropack/runtime'
aliases alongside the existing'nitro/runtime'
alias properly supports the migration to nitropack v2 whilst maintaining backwards compatibility. All aliases correctly resolve to the samenitro.client.mjs
file, and the TODO comment appropriately indicates these are temporary additions for the transition period.packages/nuxt/src/core/nuxt.ts (1)
286-292
: Expansion of VirtualFS aliases supports the nitropack migration.The addition of
#internal/nitro
andnitropack/runtime
aliases alongside the existingnitro/runtime
alias ensures compatibility during the migration to nitropack v2. All three aliases correctly point to the same client build file.packages/webpack/src/configs/server.ts (1)
57-59
:✅ Verification successful
External dependencies properly updated for nitropack migration.
The addition of
nitropack/runtime
to the external set aligns with the migration to nitropack v2. The temporary#internal/nitro
alias with the TODO comment for v5 removal provides transitional compatibility.Verify that these external dependencies are consistently configured across all build tools:
🏁 Script executed:
#!/bin/bash # Description: Check for consistency of nitro/nitropack externals across build configurations echo "=== Checking Vite configurations ===" rg -A 3 -B 3 "nitro.*runtime|nitropack.*runtime" --type ts --glob "**/vite/**" echo -e "\n=== Checking Webpack configurations ===" rg -A 3 -B 3 "nitro.*runtime|nitropack.*runtime" --type ts --glob "**/webpack/**" echo -e "\n=== Checking for #internal/nitro usage ===" rg "#internal/nitro" --type tsLength of output: 4129
Consistency confirmed: Externals identical across build configurations
All instances of the external set and alias mappings now include the same entries for the nitro→nitropack migration, and the
// TODO: remove in v5
comment is present everywhere it should be:• packages/vite/src/server.ts
– SSR external:'nitro/runtime'
,'#internal/nitro'
,'#internal/nitro/utils'
– rollupOptions.external:'nitro/runtime'
,'#internal/nitro'
,'nitropack/runtime'
, …• packages/vite/src/client.ts
– alias:
•'nitro/runtime'
→nitro.client.mjs
•'#internal/nitro'
→nitro.client.mjs
•'nitropack/runtime'
→nitro.client.mjs
• packages/webpack/src/configs/server.ts
– external:'nitro/runtime'
,'#internal/nitro'
,'nitropack/runtime'
, …• packages/webpack/src/presets/base.ts
– alias: same three mappings as aboveNo discrepancies were found.
packages/nuxt/src/pages/module.ts (2)
13-13
: Import source correctly updated for nitropack migration.The
NitroRouteConfig
type import has been properly updated from'nitro/types'
to'nitropack/types'
, aligning with the broader migration to nitropack v2.
165-169
: Module declarations consistently updated for nitropack.Both TypeScript module declarations have been correctly updated from
'nitro/types'
to'nitropack'
, ensuring proper type augmentation for theNitroRouteConfig
interface in the new package namespace.Also applies to: 616-620
packages/nuxt/src/core/nitro.ts (3)
7-8
: Nitro imports correctly updated for nitropack migration.The import statements have been properly updated from the
nitro
package tonitropack
, maintaining the same functionality while aligning with the nitropack v2 migration.
132-135
: App configuration integration enhanced in Nitro setup.The addition of
appConfig
andappConfigFiles
properties explicitly integrates Nuxt's app configuration into the Nitro configuration, improving the integration between Nuxt layers and Nitro's app config handling.
248-248
: Import priority correctly set for useAppConfig.The
priority: -1
setting ensures proper import ordering for theuseAppConfig
function, likely preventing conflicts with user-defined imports or other auto-imports.packages/nuxt/types.d.mts (2)
1-1
: LGTM: Reference directive updated for nitropack migrationThe triple slash directive has been correctly updated to reference
nitropack/types
instead ofnitro/types
, aligning with the broader migration from nitro to nitropack namespace.
18-43
: LGTM: Module declaration updated with proper namespace migrationThe module declaration has been updated from
'nitro/types'
to'nitropack'
whilst maintaining identical interface definitions. The presence of both'nitropack'
and'nitropack/types'
module declarations provides backward compatibility during the migration.packages/nuxt/src/core/templates.ts (3)
11-11
: LGTM: Type import updated for nitropack migrationThe import of
Nitro
type has been correctly updated from'nitro/types'
to'nitropack/types'
, consistent with the systematic migration across the codebase.
359-383
: LGTM: Module declaration updated for nitropack namespaceThe module declaration has been updated from
'nitro/types'
to'nitropack'
whilst preserving all interface definitions. This maintains API compatibility during the migration to nitropack.
498-498
: LGTM: Runtime import updated for nitropack migrationThe conditional import of
useRuntimeConfig
has been updated from'nitro/runtime'
to'nitropack/runtime'
, maintaining the same functionality under the new package namespace.packages/kit/src/nitro.ts (2)
1-1
: LGTM: Type imports updated for nitropack migrationThe import statement has been correctly updated from
'nitro/types'
to'nitropack/types'
, consistent with the systematic migration across the codebase.
14-19
:❓ Verification inconclusive
Verify type assertion change for method property
The type assertion for the
method
property has been changed to exclude| undefined
, but the extraction logic still assignsundefined
as the default value when no match is found. This could be a breaking change if downstream code expects the method to potentially be undefined.
🏁 Script executed:
#!/bin/bash # Description: Check how the method property is used downstream to verify if undefined handling is still needed # Search for usage of normalizeHandlerMethod and how the method property is accessed rg -A 10 -B 5 "normalizeHandlerMethod|\.method\b" --type tsLength of output: 5404
🏁 Script executed:
#!/bin/bash # Locate the definition of NitroEventHandler to inspect its `method` property type rg -n "type NitroEventHandler" --type ts || rg -n "interface NitroEventHandler" --type tsLength of output: 90
🏁 Script executed:
#!/bin/bash # Locate the import of NitroEventHandler and inspect its definition context rg -n "import.*NitroEventHandler" --type ts # Show the first 50 lines of the file to see where the type comes from sed -n '1,50p' packages/kit/src/nitro.tsLength of output: 1849
Review
normalizeHandlerMethod
’smethod
assertionThe
method
variable still defaults toundefined
when the handler filename doesn’t matchHANDLER_METHOD_RE
, yet the cast omits| undefined
. This mismatch can lead to a runtimeundefined
slip through a stricter TypeScript signature.• File packages/kit/src/nitro.ts, function normalizeHandlerMethod (around lines 14–19):
- The destructuring
[, method = undefined]
can yieldundefined
.- The subsequent cast
method as 'get' | … | 'trace'
excludesundefined
.Please verify that all handler filenames always include a valid HTTP method suffix or adjust the type assertion (e.g. include
| undefined
) or provide a safe default before casting.packages/vite/src/server.ts (4)
9-9
: LGTM: Type import updated for nitropack migrationThe import of
Nitro
type has been correctly updated from'nitro/types'
to'nitropack/types'
, consistent with the systematic migration across the codebase.
66-69
: LGTM: Temporary SSR externals added for migrationNew SSR externals
'#internal/nitro'
and'#internal/nitro/utils'
have been added with appropriate TODO comments indicating they are temporary and planned for removal in v5. This supports the migration whilst maintaining compatibility.
89-92
: LGTM: Temporary Rollup externals added for migrationNew Rollup externals
'#internal/nitro'
and'nitropack/runtime'
have been added with appropriate TODO comments indicating they are temporary and planned for removal in v5. This supports the migration to nitropack whilst maintaining build compatibility.
198-198
: LGTM: Formatting improvementThe indentation of the
initViteNodeServer(ctx)
call has been corrected, improving code consistency.test/bundle.test.ts (1)
61-61
:✅ Verification successful
Verify that bundle size increases are expected for the nitro to nitropack migration.
The server bundle sizes have increased across all test scenarios:
- Default server bundle: 191k → 194k (+1.6%)
- Inlined Vue modules: 544k → 547k (+0.6%)
- Pages configuration: 283k → 289k (+2.1%)
Whilst these increases are relatively modest, bundle size is a critical performance metric. Please confirm that these size increases are expected consequences of migrating from nitro to nitropack v2 and that they fall within acceptable performance thresholds.
Also applies to: 98-98, 120-120
🏁 Script executed:
#!/bin/bash # Description: Compare package sizes and dependencies between nitro and nitropack # Expected: Understanding of what's causing the bundle size increases echo "Checking nitro package info..." npm view nitro version size dependencies --json echo -e "\nChecking nitropack package info..." npm view nitropack version size dependencies --json echo -e "\nChecking if nitropack has additional dependencies that might explain size increase..." npm view nitropack dependencies peerDependencies --jsonLength of output: 4630
Bundle size increases are expected after migrating to nitropack
The modest regressions (1.6%–2.1%) align with the extra dependencies introduced in nitropack v2.11.12 (e.g. multiple Rollup plugins and an
xml2js
peer dependency). These changes fall within acceptable performance thresholds, so updating the inline snapshots is appropriate.Files to update:
- test/bundle.test.ts: line 61
- test/bundle.test.ts: line 98
- test/bundle.test.ts: line 120
@nuxt/kit
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
CodSpeed Performance ReportMerging #32252 will degrade performances by 27.65%Comparing Summary
Benchmarks breakdown
|
Why? |
check back tomorrow 👀 |
🔗 Linked issue
📚 Description
this moves main branch to use nitropack v2.