Skip to content

Conversation

@FGoessler
Copy link
Contributor

@FGoessler FGoessler commented Oct 2, 2025

This PR expands the section about how imports with the new prisma-client generator work.

Summary by CodeRabbit

  • Documentation
    • Reorganized generator docs: replaced the old "output-splitting-and-importing-types" narrative with a dedicated "Importing types" section.
    • Documented a new multi-file generated output layout with per-file usage notes and clearer server vs. browser import guidance.
    • Added cautions about import explicitness and preserved guidance for packaging generated code.
    • Updated breaking changes: generator now requires an output path; recommends TypeScript’s satisfies for type validation.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 2, 2025

Warning

Rate limit exceeded

@nikolasburk has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 18 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between fd41de6 and 69de745.

📒 Files selected for processing (2)
  • content/200-orm/100-prisma-schema/10-overview/02-data-sources.mdx (0 hunks)
  • content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (3 hunks)

Walkthrough

Reframes Prisma Client generator docs from a single-file narrative to a multi-file generated output layout, replacing the prior "output splitting" note with an "Importing types" section, adding per-file explanations (client.ts, browser.ts, enums.ts, models.ts, models/.ts, commonInputTypes.ts, internal/*) and updating breaking-change notes.

Changes

Cohort / File(s) Summary
Docs — Prisma Client generator
content/200-orm/100-prisma-schema/10-overview/03-generators.mdx
Replaces previous "Output splitting and importing types" content with an "Importing types" section and refactors the Prisma Client generator doc into a multi-file description. Adds per-file explanations and usage examples for client.ts, browser.ts, enums.ts, models.ts, models/<ModelName>.ts, commonInputTypes.ts, and internal/*. Updates example output layout, browser vs. server import guidance, caution about explicit imports/export maps, and breaking changes (generator now requires an output path; removes Prisma.validator in favor of TypeScript satisfies).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer code
  participant Gen as Generated output (multi-file)
  participant Runtime as Runtime (Node/Browser)

  rect rgba(200,230,255,0.4)
    Dev->>Gen: import { PrismaClient } from './generated/prisma/client' 
    Dev->>Gen: import { PrismaClient } from './generated/prisma/browser' 
    note right of Gen #ccffcc: Files: client.ts, browser.ts, enums.ts, models.ts, models/<Model>.ts, commonInputTypes.ts, internal/*
  end

  rect rgba(220,255,220,0.3)
    Dev->>Runtime: run (server uses client.ts import)
    Dev->>Runtime: run (browser uses browser.ts import)
    Runtime-->>Dev: execute with appropriate build/import resolution
  end

  note over Dev,Runtime #ffd9b3: Explicit import paths recommended due to removal of package.json/export maps
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • mhessdev
  • ankur-arch

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 succinctly indicates that the pull request improves documentation around Prisma Client imports, which matches the changes made to reorganize and expand import guidance. It is concise, clear, and free of extraneous information, making it easy for team members to understand the main purpose at a glance. Therefore, it satisfies the criteria for a well-formed pull request title.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

Dangerous URL check

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

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.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 2, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 69de745
Status: ✅  Deploy successful!
Preview URL: https://73fdbb47.docs-51g.pages.dev
Branch Preview URL: https://prisma-client-imports.docs-51g.pages.dev

View logs

@FGoessler FGoessler requested a review from nikolasburk October 2, 2025 12:58
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 7, 2025
@nikolasburk nikolasburk marked this pull request as ready for review October 7, 2025 07:54
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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 111a505 and 9370375.

📒 Files selected for processing (1)
  • content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (3 hunks)
🧰 Additional context used
🪛 GitHub Actions: Check all content (MDX) links
content/200-orm/100-prisma-schema/10-overview/03-generators.mdx

[error] 318-318: MDX compilation failed: Expected a closing tag for (318:94-318:105) before the end of paragraph. This caused the Client bundle build to fail. Command: npm run build (Docusaurus build).

🪛 GitHub Actions: Lost Pixel
content/200-orm/100-prisma-schema/10-overview/03-generators.mdx

[error] 318-318: MDX compilation failed. Expected a closing tag for (318:94-318:105) before the end of paragraph. End-tag-mismatch (mdast-util-mdx-jsx).

⏰ 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). (1)
  • GitHub Check: runner / linkspector

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: 3

♻️ Duplicate comments (1)
content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (1)

318-341: Close the inline code ticks around <ModelName>UpdateInput.

The inline code span still lacks its closing backtick, so MDX parses <ModelName> as a tag and the build fails—same issue flagged previously.

Apply this diff:

-- Contains all models including their derived utility types like `<ModelName>WhereInput` or `<ModelName>UpdateInput>`.
+- Contains all models including their derived utility types like `<ModelName>WhereInput` or `<ModelName>UpdateInput`.
...
-- Contains the models including its derived utility types like `<ModelName>WhereInput` or `<ModelName>UpdateInput>`.
+- Contains the models including its derived utility types like `<ModelName>WhereInput` or `<ModelName>UpdateInput`.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9370375 and 83fb9b4.

📒 Files selected for processing (1)
  • content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (3 hunks)
🧰 Additional context used
🪛 GitHub Actions: Documentation Checks
content/200-orm/100-prisma-schema/10-overview/03-generators.mdx

[error] 367-367: CSpell: Unknown word 'warnin'. fix: 'warning'.

⏰ 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). (4)
  • GitHub Check: runner / linkspector
  • GitHub Check: Check internal links
  • GitHub Check: Lost Pixel
  • GitHub Check: Cloudflare Pages

nikolasburk and others added 3 commits October 7, 2025 10:11
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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: 2

♻️ Duplicate comments (1)
content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (1)

272-274: Quote import specifiers instead of using template literals.

These examples still use backtick template literals for import specifiers, which won't compile when copied into TypeScript/ESM code. Please switch them—and the other import snippets below—to normal string literals (e.g. from "./generated/prisma/client").

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83fb9b4 and c25dc35.

📒 Files selected for processing (1)
  • content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (3 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). (2)
  • GitHub Check: runner / linkspector
  • GitHub Check: Lost Pixel

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 7, 2025
@nikolasburk nikolasburk merged commit 54544c2 into main Oct 7, 2025
9 checks passed
@nikolasburk nikolasburk deleted the prisma-client-imports branch October 7, 2025 08:41
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.

3 participants