Skip to content

fix(runtime): add multi-app support for global var __NUXT__ - #858

Open
nicolaspayot wants to merge 8 commits into
nuxt:mainfrom
nicolaspayot:feat/multi-app-support
Open

fix(runtime): add multi-app support for global var __NUXT__#858
nicolaspayot wants to merge 8 commits into
nuxt:mainfrom
nicolaspayot:feat/multi-app-support

Conversation

@nicolaspayot

@nicolaspayot nicolaspayot commented May 21, 2024

Copy link
Copy Markdown

resolves #1521

This PR adds multi-app support for global variable win.__NUXT__.

These changes are related to the multi-app issue in nuxt: nuxt/nuxt#21635 and required for the following draft PR: nuxt/nuxt#27263.

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request vitest-environment labels May 21, 2024
@yamachi4416
yamachi4416 requested a review from danielroe as a code owner August 1, 2026 05:14
@pkg-pr-new

pkg-pr-new Bot commented Aug 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/test-utils@858
npm i https://pkg.pr.new/vitest-environment-nuxt@858

commit: 4774ab9

@yamachi4416 yamachi4416 changed the title feat: add multi-app support for global var __NUXT__ fix(runtime): add multi-app support for global var __NUXT__ Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: aa92a3e1-9c95-4709-a060-0146f362faaa

📥 Commits

Reviewing files that changed from the base of the PR and between d84d63a and 4774ab9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • examples/app-vitest-workspace/app3/test/browser/render.spec.ts
  • examples/multi-app/package.json
  • src/config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/multi-app/package.json

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The change adds multi-app Nuxt runtime state handling through nuxtAppId and nuxtFuture environment options. It adds a multi-app example with a counter page, composable, Vitest configuration, and Nuxt and browser tests. It also adds application shells and corrects app.vue import aliases in the workspace example.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 4774a

This change adds multi-app support for the test environment’s Nuxt global state without introducing an actionable merge-blocking risk. It is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding multi-app support for the global __NUXT__ runtime variable.
Description check ✅ Passed The description directly explains the multi-app win.__NUXT__ change and links it to the related Nuxt issue and follow-up work.
Linked Issues check ✅ Passed The changes address issue #1521 by passing multi-app configuration into the test environment, storing the runtime object under the configured app ID, and adding multi-app Nuxt and browser test coverag…
Out of Scope Changes check ✅ Passed The source changes, configuration updates, examples, and tests are related to multi-app runtime support and Vitest integration. No unrelated code changes are evident.
Full details: Linked Issues check

Explanation

The changes address issue #1521 by passing multi-app configuration into the test environment, storing the runtime object under the configured app ID, and adding multi-app Nuxt and browser test coverage.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files. vitest-environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nuxt multiApp breaks nuxt/test-utils

2 participants