Skip to content

fix(platform): qualify Nitro v3 services and deployment behavior - #2535

Closed
benpsnyder wants to merge 7 commits into
analogjs:alphafrom
benpsnyder:feat/nitro-v3-optimization
Closed

benpsnyder wants to merge 7 commits into
analogjs:alphafrom
benpsnyder:feat/nitro-v3-optimization

Conversation

@benpsnyder

@benpsnyder benpsnyder commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Checklist

Completes integration work around Nitro 3.0.260903-beta, which upstream alpha already pins. Replaces obsolete service/bundler assumptions and adds temporary dependency patches for runtime qualification. This remains a draft: the integration checks pass, but broader workspace and remote CI qualification is incomplete.

Tracks Nitro v3 integration qualification — analogjs/analog#2534.

Affected scope

  • Primary scope: platform
  • Secondary scopes: vite-plugin-nitro, vite-plugin-angular; supporting dependency pins, Node configuration, documentation and conformance CI.

Recommended merge strategy for maintainer [optional]

  • Squash merge
  • Rebase merge
  • Other

Commit preservation note [optional]

No commit preservation requirement. Squash is recommended.

What is the new behavior?

  • Use Nitro's shared SSR service graph for native development, production and prerendering; preserve explicit runners and builder settings and use default Rolldown bundling.
  • Preserve trusted SSR/streaming route policies, returned Responses, multiple cookies, status, cancellation and request-local same-origin credentials. GET/HEAD page endpoints use loaders.
  • Isolate the temporary prerender server from static output, preserve custom output paths and Workers/Pages layouts, and retain required runtime dependencies in portable output.
  • Declare standalone runtime dependencies and retain Vite 6–8 progressive compatibility. Native integration is qualified with Vite 7/8.
  • Fix the missing test-mode argument in both default and experimental Angular Rolldown compiler callers so client dependencies are linked during development.
  • Add reusable platform:nitro-conformance, platform:nitro-patches and platform:nitro-cloudflare targets plus Linux/Windows CI.

Temporary upstream patches

Dependency Issue Fix and regression coverage
[email protected] unjs/env-runner#46 Preserve Request method, headers, streamed body and signal, including RequestInit overrides, concurrent cookies and srvx NodeRequest inputs.
[email protected] h3js/srvx#302 Recognize promise-like responses after Zone.js replaces global Promise; cover both Node adapter paths, repeated requests, cross-realm promises, sync responses, streaming and rejections.

Both upstream issues include standalone samples, use cases and suggested AI implementation prompts. Patch hashes are locked. patches/README.md gives removal criteria and consumer configuration: publishing Analog does not propagate workspace pnpm patches to consumers.

Test plan

  • pnpm nx format:check --base=4225f45090a4cf4bdfb562a788e908787b6ec73c (changed-file Prettier also passed)
  • pnpm nx run-many --target build --all: 23 projects plus 8 dependent tasks, including after patch installation.
  • pnpm test: full equivalent under Xvfb passed 18/19 targets; docs-analog still has five syntax-failing suites.
  • Manual verification: repeated real Angular /about development SSR returns 200 with rendered content; Node portable production rendering and browser navigation; local Cloudflare Workers development/production conformance.
  • pnpm install --frozen-lockfile, including prepare/artifact verification, with both patches.
  • pnpm nx run platform:nitro-patches and pnpm nx run platform:nitro-cloudflare.
  • Native/standalone Node conformance and focused tests: 394 platform + 102 standalone passing, six existing skips.
  • Strict packed-consumer matrix before patches: native/standalone Vite 8.2.2 and 7.3.6; standalone Vite 6.4.3. This plain-renderer evidence does not qualify Angular hydration or propagate the new patches into published packages.

Draft exit checks still open

  • Docs test syntax errors; full lint failures in content/router Angular ESLint configuration; broad typecheck failures recorded in tools/nitro-v3-adoption.md.
  • Angular development browser now passes redirect and hydrated navigation without page errors after fixing two compiler-plugin callers; 847 Angular plugin tests pass (six existing skips). The full production-oriented E2E suite expects a generated sitemap unavailable in dev, so that check belongs to production qualification.
  • Remote CI is not green: the Angular 17.3.12 job fails during install/prepare because it cannot resolve @angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin.js. Linux/Windows Nitro conformance and other checks were still running at the latest readback.

Does this PR introduce a breaking change?

  • Yes
  • No

No intentional public API break beyond the existing alpha prerelease baseline. The documented supported runtime floor is aligned to Node 24.15.0 (or Node 26). Explicit settings and legacy Vite fallbacks remain supported. Temporary dependency patches must be applied separately by affected consumers.

Other information

Base is alpha, as requested for this work; targeting beta would include unrelated alpha history. The original checkout remains unchanged. No deployment has been performed.

tools/nitro-v3-adoption.md reviews every 2026 Nitro v3 release and records checks and measurements. There is no demonstrated build-speed improvement: median app-only build was 13.084s before and 14.702s after. Output grew primarily because the baseline omitted required Sharp/libvips runtime files; the portable baseline returned 500 while the final portable application returned 200.

[optional] What gif best describes this PR or how it makes you feel?

Not applicable.

Prepared with OpenAI Codex.

CI repair follow-up

  • Close the development Nitro instance with Vite so Windows conformance exits normally; remove stale Cypress agent setup and isolate compiler matrix installs from the workspace prepare script.
  • Normalize Windows entry imports in the existing env-runner patch. Its regression covers relative module loading alongside the existing request and Zone.js checks.
  • Complete the docs Angular/Nitro plugin and application-builder migration. Run sitemap, LLM indexes and broken-link validation after Nitro finishes; fail the build on prerender errors. Restore the i18n registry export, configured locale constants and handling of already-localized routes.
  • Local validation: 398 platform tests, 32 i18n tests and 18 docs tests pass; docs build renders 354 HTML pages with zero broken links. Frozen install, dependency patch probes, Linux Cloudflare conformance, platform lint and docs lint pass. Router lint retains the base's missing Angular ESLint config error and remains excluded by the existing CI workflow.
  • GitHub Actions passes on d0cb0dbcc, including Windows/Linux Nitro conformance and the full CI workflow.

benpsnyder and others added 2 commits September 7, 2026 15:27
Preserve explicit bundler settings, canonical route rules and HEAD loaders.
Use srvx for Node adaptation and close development resources on shutdown.

Co-Authored-By: OpenAI Codex <[email protected]>
Preserve request context, response metadata and isolated prerender output.
Add Node and Workers conformance, dependency regressions and release review.
Keep the submission in draft while broader qualification remains open.

Co-Authored-By: OpenAI Codex <[email protected]>
@netlify

netlify Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit d0cb0db
🔍 Latest deploy log https://app.netlify.com/projects/analog-blog/deploys/6a9ef553501cb20008755c21
😎 Deploy Preview https://deploy-preview-2535--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@netlify

netlify Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit d0cb0db
🔍 Latest deploy log https://app.netlify.com/projects/analog-app/deploys/6a9ef553e1a9870008551722
😎 Deploy Preview https://deploy-preview-2535--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@github-actions github-actions Bot added scope:ci GitHub workflow changes scope:docs Documentation changes scope:platform Changes in @analogjs/platform scope:repo Repository metadata and tooling scope:vite-plugin-nitro Changes in @analogjs/vite-plugin-nitro labels Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 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.

@nx-cloud

nx-cloud Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit b883a93

Command Status Duration Result
nx run-many --target e2e --projects=analog-app-... ✅ Succeeded 1m 47s View ↗
nx run-many --target test ✅ Succeeded 58s View ↗
nx run-many --target build --all --parallel=1 -... ✅ Succeeded 1m 36s View ↗
nx run-many --target lint --all --exclude=conte... ✅ Succeeded 1m 31s View ↗
nx-cloud record -- pnpm prettier:check ✅ Succeeded 14s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-07 17:40:34 UTC

… modes

Pass the test flag separately from transformer ownership in both compilers.
Qualify real Angular development redirects and hydrated navigation.

Co-Authored-By: OpenAI Codex <[email protected]>
@github-actions github-actions Bot added the scope:vite-plugin-angular Changes in @analogjs/vite-plugin-angular label Sep 7, 2026
@benpsnyder

Copy link
Copy Markdown
Contributor Author

Follow-up at 09ad763d2: Windows prerender output is fixed and the Windows application build passes. All native/standalone conformance HTTP and rendering assertions pass, but Windows still times out after completion with filesystem watchers/timers alive. Linux conformance passes. A minimal Nitro-only reproduction also shows Vite shutdown skipping Nitro’s build-time close hook; the Windows causal link remains unverified. Related: nitrojs/nitro#4586.

Upstream review fixes are pushed, with short replies on every finding and all four threads resolved: unjs/env-runner#47 (399 tests pass) and h3js/srvx#303 (1,478 tests pass). Their Actions runs need maintainer approval; srvx also needs Vercel team authorization.

This PR stays draft. Remaining CI failures are Windows conformance shutdown, the existing Angular 17.3 compiler-tooling mismatch, and the Nx coordinator cancellation. No checks were disabled.

Close the development Nitro instance once across Vite environment shutdown hooks.

Remove obsolete Cypress installation and isolate compiler-matrix setup.

Co-Authored-By: OpenAI Codex <[email protected]>

@nx-cloud nx-cloud Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

This CI failure appears to be related to the environment or external dependencies rather than your code changes.

No code changes were suggested for this issue.

You can trigger a rerun by pushing an empty commit:

git commit --allow-empty -m "chore: trigger rerun"
git push

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

Normalize Windows entry imports in the env-runner patch and verify relative module loading.
Complete the docs plugin and builder migration, run output checks after Nitro finishes,
and restore i18n runtime exports and locale configuration.

Co-Authored-By: OpenAI Codex <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0 scope:ci GitHub workflow changes scope:docs Documentation changes 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.

2 participants