Skip to content

Conversation

@nikolasburk
Copy link
Contributor

@nikolasburk nikolasburk commented Sep 10, 2025

Summary by CodeRabbit

  • New Features

    • Added a browser-specific module for generated exports (exports Role; PrismaClient not included).
    • Introduced optional engineType configuration for the generator.
  • Documentation

    • Updated examples to new provider name and output path.
    • Documented browser imports and clarified limitations.
    • Added new enum (User) and updated model/type import paths without .js extensions.
    • Clarified public exports and normalized import paths for client, models, and enums.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 10, 2025

Walkthrough

Updates Prisma generator documentation: provider switched to prisma-client, output path adjusted, engineType option added. Example imports updated to extensionless paths. New browser-specific module and files documented, including browser.ts and prismaNamespaceBrowser.ts. Enums now include User. Clarifies browser exports exclude PrismaClient.

Changes

Cohort / File(s) Summary
Prisma generator docs updates
content/200-orm/100-prisma-schema/10-overview/03-generators.mdx
- Generator: provider from prisma-client-js → prisma-client; output from ./generated/prisma-client-js → ../generated/prisma; adds engineType = "client"
- Generated layout: documents new browser outputs (generated/prisma/browser.ts, prismaNamespaceBrowser.ts)
- Imports: switch to extensionless paths for client/models/enums
- Public API: enums export adds User; models import UserModel and PostModel; notes browser module exports (e.g., Role) and that PrismaClient is not exported from browser

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • mhessdev
  • ankur-arch

Pre-merge checks (3 passed)

✅ 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 “update import docs for prisma-client generator” succinctly captures the main purpose of this changeset, which is to revise how import paths are documented for the Prisma client generator. It is concise, clearly focused on the documentation aspect, and avoids unnecessary detail or noise, making it easy for teammates to understand the primary change at a glance. Although the PR also introduces browser‐specific imports and minor generator configuration updates, the core intent centers on updating import documentation, which the title conveys.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/browser-imports

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@github-actions
Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

@github-actions
Copy link
Contributor

@cloudflare-workers-and-pages
Copy link

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6d7483d
Status: ✅  Deploy successful!
Preview URL: https://d26d44ef.docs-51g.pages.dev
Branch Preview URL: https://docs-browser-imports.docs-51g.pages.dev

View logs

Copy link
Contributor

@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: 0

🧹 Nitpick comments (3)
content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (3)

11-12: Align output path with later examples for consistency

Later sections use ../src/generated/prisma; mirror that here.

 generator client {
-  provider = "prisma-client"
-  output   = "../generated/prisma"
+  provider = "prisma-client"
+  output   = "../src/generated/prisma"
 }

195-204: Clarify the browser module’s export surface

Explicitly state that the browser entry only exposes types and not any runtime (no PrismaClient, no query engine).

 Note that `./generated/prisma/browser` does not expose a `PrismaClient`.
+It only exports types intended for frontend usage (no runtime code or query engine).

216-216: Add engineType to the options table

You show engineType in the code sample, but it’s missing from the table. Add an entry and confirm the default/behavior.

 | `importFileExtension`    | Inferred from environment | File extension used in **import statements**. Can be `ts`, `mts`, `cts`, `js`, `mjs`, `cjs`, or empty (for bare imports).                                              |
+| `engineType`             |                           | Controls engine runtime. Set to `"client"` to generate a client that does not rely on the Rust query engine (see note above).                                          |
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3172159 and 6d7483d.

📒 Files selected for processing (1)
  • content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (5 hunks)
⏰ 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). (3)
  • GitHub Check: runner / linkspector
  • GitHub Check: Check internal links
  • GitHub Check: Lost Pixel
🔇 Additional comments (4)
content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (4)

171-173: Extensionless import path looks correct

Matches the configured ../src/generated/prisma output and keeps imports consistent.


184-185: Models import path update looks good

Consistent with the new split output structure.


192-193: Verify “User” is actually an enum in this example

Using User here suggests it’s an enum, which is uncommon and likely confusing. Prefer a clearly-enum example or drop User.

-import { Role, User } from "./generated/prisma/enums";
+import { Role } from "./generated/prisma/enums";

261-269: File tree updates LGTM

Adding browser.ts and prismaNamespaceBrowser.ts accurately reflects the new browser entry.

@nikolasburk nikolasburk merged commit 6b776c2 into main Sep 11, 2025
9 of 11 checks passed
@nikolasburk nikolasburk deleted the docs/browser-imports branch September 11, 2025 07:15
This was referenced Sep 11, 2025
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