Skip to content

fix(vite-plugin-nitro): update nitro to 3.0.260415-beta#2300

Merged
brandonroberts merged 4 commits into
alphafrom
update-nitro-3.0.260415
Apr 17, 2026
Merged

fix(vite-plugin-nitro): update nitro to 3.0.260415-beta#2300
brandonroberts merged 4 commits into
alphafrom
update-nitro-3.0.260415

Conversation

@brandonroberts

Copy link
Copy Markdown
Member

PR Checklist

Closes #

Affected scope

  • Primary scope: vite-plugin-nitro
  • Secondary scopes: none

Recommended merge strategy for maintainer [optional]

  • Squash merge
  • Rebase merge
  • Other

Commit preservation note [optional]

What is the new behavior?

Updates Nitro from 3.0.260311-beta to 3.0.260415-beta. Removes workarounds that are now handled upstream by Nitro:

  • OXC tsconfig resolution workaround (ensureSsrTsconfig)
  • Vercel build config validation (assertValidVercelBuildConfig)
  • Vercel function config generation (ensureVercelFunctionConfig)
  • moduleSideEffects for zone.js

Test plan

  • nx build analog-app
  • pnpm build
  • pnpm test

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

🤖 Generated with Claude Code

Remove workarounds for OXC tsconfig resolution, Vercel build config
validation, and Vercel function config that are now handled by Nitro
itself. Remove moduleSideEffects for zone.js.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Apr 17, 2026

Copy link
Copy Markdown

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit 88c7033
🔍 Latest deploy log https://app.netlify.com/projects/analog-blog/deploys/69e2331bb3d6dd00081b31ba
😎 Deploy Preview https://deploy-preview-2300--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Apr 17, 2026

Copy link
Copy Markdown

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit 88c7033
🔍 Latest deploy log https://app.netlify.com/projects/analog-app/deploys/69e2331b139a800008936a37
😎 Deploy Preview https://deploy-preview-2300--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added scope:repo Repository metadata and tooling scope:vite-plugin-nitro Changes in @analogjs/vite-plugin-nitro labels Apr 17, 2026
@coderabbitai

coderabbitai Bot commented Apr 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d982a4f1-8c8a-4631-b963-f92b6c81e245

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Removed Vercel-specific build-output checks and .vc-config.json generation and deleted helper logic that created a minimal tsconfig.json in SSR output directories. Simplified buildServer control flow to omit those helpers while keeping Rollup selection, prerendering, route source file writing, and nitro.close() intact. Deleted a moduleSideEffects entry for zone.js in the Nitro SSR/prerender branch. Updated workspace catalog Nitro version from 3.0.260311-beta to 3.0.260415-beta. Several tests were adjusted or removed (notably Vercel build tests and multiple i18n tests); other test mocks were extended.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Key observations for review

  1. Vercel handling: Vercel-specific validation and .vc-config.json generation were removed from build-server — verify deployments relying on this behavior still work or that Nitro upstream covers it now.
  2. SSR tsconfig: Removal of automatic tsconfig.json creation in SSR output may affect downstream TypeScript tools or IDEs that expected it; confirm no regressions.
  3. zone.js side effects: Deleting moduleSideEffects for zone.js may change initialization semantics in zone-dependent apps (e.g., Angular); run relevant integration tests.
  4. Nitro version bump: Confirm changes in 3.0.260415-beta correspond to removed responsibilities and that no functionality was unintentionally lost by the local removals.
  5. Tests: Several tests were weakened/removed (i18n clearing, component def registry, Vercel error case). Ensure coverage remains adequate or add tests for any uncovered behavior.
  6. BuildServer behavior: Signature unchanged, but internal control flow changed — validate nitro creation arguments, bundler choice, prerender paths, and that buildServer completes in common scenarios.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title follows Conventional Commit style with a supported scope (vite-plugin-nitro) and clearly summarizes the primary change: updating Nitro to a new beta version.
Description check ✅ Passed The PR description is comprehensive and directly related to the changeset, detailing which Nitro workarounds are being removed and why, along with test coverage details.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-nitro-3.0.260415

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/vite-plugin-nitro/src/lib/build-server.ts (1)

19-106: ⚠️ Potential issue | 🔴 Critical

Test regression: build-server.spec.ts expects a Vercel validation error that is no longer thrown by buildServer().

This test was added in commit 07504a4c alongside removal of assertValidVercelBuildConfig. The commit message states validation is "now handled by Nitro itself," but the test still expects buildServer() to reject with the error message Nitro generated an empty Vercel build output config at "...".

The current implementation has no validation—it simply awaits build(nitro) and then await nitro.close(). The mocked build() writes an empty config file, but nothing validates or throws on that condition. When pnpm test runs, this test will fail because the expected error is never thrown.

Either delete this test (if Nitro's own build flow now validates upstream) or rewrite it to assert against Nitro's error if the validation was intentionally delegated.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vite-plugin-nitro/src/lib/build-server.ts` around lines 19 - 106,
The test regression is caused because buildServer (function buildServer) no
longer performs Vercel config validation and so the spec expecting the
Vercel-specific error fails; fix by updating the test (build-server.spec.ts) to
either remove the old expectation for "Nitro generated an empty Vercel build
output config at ..." or rewrite the assertion to match the new behavior —
specifically, have the test stub/mock build() to throw or reject and assert that
buildServer rejects with that Nitro/build error (or assert that build() was
invoked and nitro.close() is reached/fails as appropriate); alternatively, if
you intentionally want to preserve the original validation inside buildServer,
reintroduce a validation step after await build(nitro) that checks the generated
Vercel config and throws the original message to satisfy the existing test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/vite-plugin-nitro/src/lib/build-server.ts`:
- Around line 19-106: The test regression is caused because buildServer
(function buildServer) no longer performs Vercel config validation and so the
spec expecting the Vercel-specific error fails; fix by updating the test
(build-server.spec.ts) to either remove the old expectation for "Nitro generated
an empty Vercel build output config at ..." or rewrite the assertion to match
the new behavior — specifically, have the test stub/mock build() to throw or
reject and assert that buildServer rejects with that Nitro/build error (or
assert that build() was invoked and nitro.close() is reached/fails as
appropriate); alternatively, if you intentionally want to preserve the original
validation inside buildServer, reintroduce a validation step after await
build(nitro) that checks the generated Vercel config and throws the original
message to satisfy the existing test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a08e766e-4c85-45be-8e77-9dc73a2e944e

📥 Commits

Reviewing files that changed from the base of the PR and between dcf064c and 07504a4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by none
📒 Files selected for processing (3)
  • packages/vite-plugin-nitro/src/lib/build-server.ts
  • packages/vite-plugin-nitro/src/lib/vite-plugin-nitro.ts
  • pnpm-workspace.yaml
💤 Files with no reviewable changes (1)
  • packages/vite-plugin-nitro/src/lib/vite-plugin-nitro.ts

brandonroberts and others added 2 commits April 17, 2026 08:05
…alidation

Replace the test for assertValidVercelBuildConfig (now handled by Nitro
upstream) with a test verifying the rollup builder default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Pass test.css: true in JIT plugin tests so preprocessCSS is called
- Add createPrinter and createSourceFile to TS mock in transform test
- Align i18n tests with current implementation (plain string translations,
  remove tests for unimplemented functions)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added scope:router Changes in @analogjs/router scope:vite-plugin-angular Changes in @analogjs/vite-plugin-angular labels Apr 17, 2026
@github-actions

github-actions Bot commented Apr 17, 2026

Copy link
Copy Markdown

This PR touches multiple package scopes: platform, router, vite-plugin-angular, vite-plugin-nitro.

Please confirm the changes are closely related. Squash merge is highly preferred. If you recommend a non-squash merge, add a brief note explaining why the commit boundaries matter and why this PR should bypass focused changes per package.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/router/src/lib/i18n/provide-i18n.spec.ts (1)

1-287: ⚠️ Potential issue | 🔴 Critical

Critical: Broken i18n registry API — platform plugin cannot build.

The platform plugin at packages/platform/src/lib/i18n-component-registry-plugin.ts (line 44) imports ɵregisterI18nComponentDef from @analogjs/router, but this symbol is not exported anywhere in the router package. A search of packages/router/src found zero occurrences of any of the four registry helpers (ɵregisterI18nComponentDef, ɵresetI18nComponentDefCache, getI18nComponentDefRegistrySize, clearI18nComponentDefRegistry).

This breaks the SSR i18n build for any app that enables the i18n option in the platform plugin configuration. Either:

  • Restore the registry exports and update the test suite with minimal smoke tests, or
  • Remove the i18n-component-registry-plugin and document the removal as a breaking change.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/router/src/lib/i18n/provide-i18n.spec.ts` around lines 1 - 287, The
platform plugin is importing missing registry APIs (ɵregisterI18nComponentDef,
ɵresetI18nComponentDefCache, getI18nComponentDefRegistrySize,
clearI18nComponentDefRegistry) that are not exported from the router package;
restore these exports from the router (implement or re-expose them from the i18n
module such as provide-i18n) and update the test suite (provide-i18n.spec.ts) to
include minimal smoke tests that import and call each registry helper to ensure
the symbols are exported and callable; ensure the exported function names
exactly match ɵregisterI18nComponentDef, ɵresetI18nComponentDefCache,
getI18nComponentDefRegistrySize, and clearI18nComponentDefRegistry so the
platform plugin build succeeds.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/router/src/lib/i18n/provide-i18n.spec.ts`:
- Around line 1-287: The platform plugin is importing missing registry APIs
(ɵregisterI18nComponentDef, ɵresetI18nComponentDefCache,
getI18nComponentDefRegistrySize, clearI18nComponentDefRegistry) that are not
exported from the router package; restore these exports from the router
(implement or re-expose them from the i18n module such as provide-i18n) and
update the test suite (provide-i18n.spec.ts) to include minimal smoke tests that
import and call each registry helper to ensure the symbols are exported and
callable; ensure the exported function names exactly match
ɵregisterI18nComponentDef, ɵresetI18nComponentDefCache,
getI18nComponentDefRegistrySize, and clearI18nComponentDefRegistry so the
platform plugin build succeeds.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1ade7b42-7332-4c68-b1fb-018c4574aaf3

📥 Commits

Reviewing files that changed from the base of the PR and between 07504a4 and 4dfa553.

📒 Files selected for processing (4)
  • packages/router/src/lib/i18n/provide-i18n.spec.ts
  • packages/vite-plugin-angular/src/lib/angular-jit-plugin.spec.ts
  • packages/vite-plugin-angular/src/lib/angular-vite-plugin-transform.spec.ts
  • packages/vite-plugin-nitro/src/lib/build-server.spec.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/vite-plugin-angular/src/lib/angular-jit-plugin.spec.ts

The beta merge (9167e96) brought in the updated i18n tests but kept
alpha's simpler provide-i18n.ts, causing 14 test failures. Restore the
full beta implementation:

- loadTranslationsRuntime uses @angular/localize's loadTranslations
- clearTranslationsRuntime clears translations between SSR requests
- initI18n clears before loading to prevent locale mixing
- Component def registry (ɵregisterI18nComponentDef, ɵresetI18nComponentDefCache)
  for resetting cached tViews between SSR renders
- i18nComponentRegistryPlugin wired into platform plugin
- render.ts resets tView cache before each render
- Add @angular/localize dependency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the scope:platform Changes in @analogjs/platform label Apr 17, 2026
@brandonroberts brandonroberts merged commit d351d28 into alpha Apr 17, 2026
35 of 36 checks passed
@brandonroberts brandonroberts deleted the update-nitro-3.0.260415 branch April 17, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:platform Changes in @analogjs/platform scope:repo Repository metadata and tooling scope:router Changes in @analogjs/router scope:vite-plugin-angular Changes in @analogjs/vite-plugin-angular scope:vite-plugin-nitro Changes in @analogjs/vite-plugin-nitro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant