Skip to content

feat(vite): auto-detect client entry#4059

Open
RihanArfan wants to merge 1 commit intomainfrom
feat/client-entrypoint
Open

feat(vite): auto-detect client entry#4059
RihanArfan wants to merge 1 commit intomainfrom
feat/client-entrypoint

Conversation

@RihanArfan
Copy link
Member

@RihanArfan RihanArfan commented Feb 26, 2026

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Automatically use [src/app]/client-entry.[ts/js/mts/mjs/tsx/jsx] as the client entrypoint.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel
Copy link

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nitro.build Ready Ready Preview, Comment Feb 27, 2026 2:24pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

Adds comprehensive SSR documentation and implements client entry auto-detection in the Nitro Vite plugin. Removes explicit environments.client configuration blocks from example projects while updating their documentation and dependencies accordingly.

Changes

Cohort / File(s) Summary
SSR Documentation
docs/1.docs/4.renderer.md
Added comprehensive SSR documentation including entry file examples, auto-detection logic, asset management with merged manifests, framework examples, and detailed usage workflow.
Framework Example Guides
examples/vite-ssr-*/GUIDE.md
Removed explicit environments.client configuration guidance; simplified Vite config documentation to focus on plugin setup only.
Framework Example READMEs
examples/vite-ssr-*/README.md
Updated devDependency versions, removed environments.client config blocks from examples, added/revised SSR setup documentation with framework-specific guidance.
Vite Config Examples
examples/vite-ssr-*/vite.config.mjs
Removed explicit environments.client.build.rollupOptions.input configuration blocks; relying on auto-detection instead.
Core Plugin Implementation
src/build/vite/plugin.ts, src/build/vite/types.ts
Added _clientEntry?: string field to NitroPluginContext; implemented automatic client entry detection and registration with fallback to cached entry; broadened SSR entry resolution with rolldownOptions/rollupOptions fallback handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(vite): auto-detect client entry' follows conventional commits format with a type, scope, and clear description of the feature.
Description check ✅ Passed The description clearly explains the change (automatic client entrypoint detection) and indicates documentation updates; it is directly related to the changeset.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/client-entrypoint

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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nitro@4059

commit: 178468f

@pi0
Copy link
Member

pi0 commented Feb 26, 2026

Please revert unrelated changes

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
examples/vite-ssr-tsr-react/README.md (1)

59-61: ⚠️ Potential issue | 🟡 Minor

Typo in tsconfig paths alias.

The path alias "sec/*" appears to be a typo and should be "src/*".

Proposed fix
     "paths": {
-      "@/*": ["sec/*"]
+      "@/*": ["src/*"]
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/vite-ssr-tsr-react/README.md` around lines 59 - 61, The tsconfig
"paths" mapping has a typo: the alias entry "@/*": ["sec/*"] should point to
"src/*"; update the paths object so the alias reads "@/*": ["src/*"] (i.e.,
replace "sec/*" with "src/*") to restore the correct source folder mapping used
by the build and imports.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/1.docs/4.renderer.md`:
- Around line 190-204: Two fenced code blocks (the directory listing block
starting with "app/" and the log output block starting with "ℹ Using
app/entry-server.ts") lack language specifiers; update both opening fences from
"```" to "```text" so the blocks explicitly declare plain-text for syntax
highlighting and to satisfy the markdown linter (edit the block that contains
"app/ entry-server.ts entry-client.ts routes/ api/hello.ts" and the adjacent tip
block that lists the "ℹ Using app/entry-server.ts..." lines).

---

Outside diff comments:
In `@examples/vite-ssr-tsr-react/README.md`:
- Around line 59-61: The tsconfig "paths" mapping has a typo: the alias entry
"@/*": ["sec/*"] should point to "src/*"; update the paths object so the alias
reads "@/*": ["src/*"] (i.e., replace "sec/*" with "src/*") to restore the
correct source folder mapping used by the build and imports.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ccf672 and d25b45e.

📒 Files selected for processing (17)
  • docs/1.docs/4.renderer.md
  • examples/vite-ssr-preact/GUIDE.md
  • examples/vite-ssr-preact/README.md
  • examples/vite-ssr-preact/vite.config.mjs
  • examples/vite-ssr-react/GUIDE.md
  • examples/vite-ssr-react/README.md
  • examples/vite-ssr-react/vite.config.mjs
  • examples/vite-ssr-solid/GUIDE.md
  • examples/vite-ssr-solid/README.md
  • examples/vite-ssr-solid/vite.config.mjs
  • examples/vite-ssr-tsr-react/README.md
  • examples/vite-ssr-tss-react/README.md
  • examples/vite-ssr-vue-router/GUIDE.md
  • examples/vite-ssr-vue-router/README.md
  • examples/vite-ssr-vue-router/vite.config.mjs
  • src/build/vite/plugin.ts
  • src/build/vite/types.ts
💤 Files with no reviewable changes (4)
  • examples/vite-ssr-preact/vite.config.mjs
  • examples/vite-ssr-solid/vite.config.mjs
  • examples/vite-ssr-vue-router/vite.config.mjs
  • examples/vite-ssr-react/vite.config.mjs

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants