Skip to content

Conversation

Mini-ghost
Copy link
Member

🔗 Linked issue

N/A

📚 Description

<DevOnly> previously supported only the shorthand slot syntax #fallback. This PR extends support to the longform v-slot:fallback syntax.

@Mini-ghost Mini-ghost requested a review from danielroe as a code owner October 1, 2025 08:05
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

coderabbitai bot commented Oct 1, 2025

Walkthrough

The DevOnlyPlugin transform in packages/nuxt/src/core/plugins/dev-only.ts now recognises the fallback slot via three syntaxes: fallback, #fallback, and v-slot:fallback. It also changes how the replacement slice start is computed, using fallback.loc.at(-1).start instead of array length indexing. No other logic, control flow, or exported declarations were altered.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the primary change—adding support for the longform v-slot:fallback syntax in the <DevOnly> component—using a conventional commit format and clear language, which makes understanding the main change straightforward for reviewers.
Description Check ✅ Passed The pull request description clearly states the modification by contrasting the previous shorthand-only support with the newly added longform syntax support, which directly aligns with the changes in the code.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/dev-only-longform-slot

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be9706d and fd9ab8f.

📒 Files selected for processing (1)
  • packages/nuxt/src/core/plugins/dev-only.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Follow standard TypeScript conventions and best practices

Files:

  • packages/nuxt/src/core/plugins/dev-only.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: test-fixtures (windows-latest, built, webpack, async, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (windows-latest, built, rspack, async, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (windows-latest, built, vite, default, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (windows-latest, built, rspack, default, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (ubuntu-latest, built, rspack, default, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (windows-latest, dev, vite, default, manifest-off, json, lts/-1)
  • GitHub Check: test-fixtures (windows-latest, dev, vite, default, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (ubuntu-latest, built, rspack, async, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (windows-latest, dev, vite, async, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (ubuntu-latest, built, webpack, default, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (ubuntu-latest, built, vite, async, manifest-on, js, lts/-1)
  • GitHub Check: test-fixtures (ubuntu-latest, built, vite, async, manifest-off, json, lts/-1)
  • GitHub Check: test-fixtures (ubuntu-latest, dev, vite, default, manifest-off, json, lts/-1)
  • GitHub Check: test-fixtures (ubuntu-latest, dev, vite, async, manifest-off, json, lts/-1)
  • GitHub Check: test-fixtures (ubuntu-latest, dev, vite, async, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (ubuntu-latest, dev, vite, async, manifest-on, js, lts/-1)
  • GitHub Check: test-size
  • GitHub Check: typecheck (ubuntu-latest, bundler)
  • GitHub Check: typecheck (windows-latest, bundler)
  • GitHub Check: code
🔇 Additional comments (2)
packages/nuxt/src/core/plugins/dev-only.ts (2)

31-31: LGTM! Longform slot syntax support added correctly.

The addition of 'v-slot:fallback' extends the attribute detection to support Vue's longform slot syntax whilst maintaining backward compatibility with the existing 'fallback' and '#fallback' syntaxes.


33-33: .at() usage is safe under ES2022 target
The project’s tsconfig sets both target and lib to ES2022, which natively supports Array.prototype.at. No further changes required.


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.

Copy link

pkg-pr-new bot commented Oct 1, 2025

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@33368

nuxt

npm i https://pkg.pr.new/nuxt@33368

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@33368

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@33368

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@33368

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@33368

commit: fd9ab8f

Copy link

codspeed-hq bot commented Oct 1, 2025

CodSpeed Performance Report

Merging #33368 will not alter performance

Comparing fix/dev-only-longform-slot (fd9ab8f) with main (be9706d)

Summary

✅ 10 untouched

@danielroe danielroe merged commit 9bebe27 into main Oct 1, 2025
83 of 85 checks passed
@danielroe danielroe deleted the fix/dev-only-longform-slot branch October 1, 2025 08:54
@github-actions github-actions bot mentioned this pull request Oct 1, 2025
@github-actions github-actions bot mentioned this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants