Skip to content

Conversation

@genu
Copy link
Contributor

@genu genu commented Nov 30, 2025

This PR imports setResponseStatus directly from h3.

Importing from nuxt/app will fail in Nuxt 4.x because there are stronger separation of aliases between client and server runtimes

nuxt/app should NOT be used in server/ routes - it's meant for client-side and SSR rendering context only.

Summary by CodeRabbit

  • Chores
    • Improved internal code organization and maintainability by consolidating imports and type usage.
    • No changes to public interfaces or runtime behavior; no user-facing impact.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 30, 2025

Walkthrough

Grouped multiple imports from 'h3' into a single consolidated import in the Nuxt handler file; no runtime logic, control flow, exported signatures, or type-usage changes were made.

Changes

Cohort / File(s) Summary
Import consolidation
packages/server/src/adapter/nuxt/handler.ts
Replaced separate imports with one grouped import from 'h3' including defineEventHandler, getQuery, getRouterParams, readBody, setResponseStatus, type H3Event, and type EventHandlerRequest. No other code changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single-file, cosmetic import reorganization; verify no accidental symbol removals or type-only import changes.

Possibly related PRs

Poem

🐰 I hopped through imports, tidy and spry,

Collected symbols under one sky,
Neat lines align where chaos once stood,
A cleaner burrow, code feels good,
🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: moving setResponseStatus import from nuxt/app to h3 to fix server runtime compatibility issues in Nuxt 4.x.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7935534 and 01589c0.

📒 Files selected for processing (1)
  • packages/server/src/adapter/nuxt/handler.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Implement plugin hooks at ORM, Kysely, and entity mutation levels for query interception and customization

Applied to files:

  • packages/server/src/adapter/nuxt/handler.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Use Kysely as the query builder interface for low-level database queries, avoiding raw SQL when possible

Applied to files:

  • packages/server/src/adapter/nuxt/handler.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). (2)
  • GitHub Check: build-test (20.x, postgresql)
  • GitHub Check: build-test (20.x, sqlite)
🔇 Additional comments (1)
packages/server/src/adapter/nuxt/handler.ts (1)

3-11: Import consolidation is correct and Nuxt 4.x compatible.

The import of setResponseStatus from h3 v1.15.4 is valid. h3 exports this function from its response utilities with the signature setResponseStatus(event, code?, text?). The consolidation of all h3 imports in lines 3-11 properly aligns with the PR objective to fix Nuxt 4.x compatibility by moving away from nuxt/app in server contexts.


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
Member

@ymc9 ymc9 left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@ymc9 ymc9 merged commit 3406956 into zenstackhq:dev Dec 1, 2025
4 of 5 checks passed
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