Open-Source Wikis

/

Prisma

/

Background

/

The two generators

prisma/prisma

The two generators

Why prisma-client (TS) and prisma-client-js (JS) coexist in the workspace, and what you need to know to keep them in sync.

The packages

  • packages/client-generator-ts — backs provider = "prisma-client". New, recommended.
  • packages/client-generator-js — backs provider = "prisma-client-js". Legacy. Still maintained.

Both are built and tested in every release. Both register with @prisma/client-generator-registry.

Why both ship simultaneously

Prisma 7 introduced a new generator with cleaner output, ESM-first emission, and strong support for tree-shaking and modern bundlers. But the old generator (prisma-client-js) is still used in every existing user project. Removing it would break all of them.

The path is incremental:

  1. Both generators ship.
  2. Users migrate at their own pace by changing their generator block.
  3. The old generator stays in maintenance: bug fixes only, new features land in client-generator-ts first.

There is no announced removal date. The legacy generator persists as long as it's needed.

Synchronization rules

When changing anything user-visible, both generators usually need updates. The most common case is PrismaClient constructor options. Per AGENTS.md:

Update both packages/client-generator-js/src/TSClient/PrismaClient.ts (buildClientOptions method) and packages/client-generator-ts/src/TSClient/file-generators/PrismaNamespaceFile.ts (buildClientOptions function).

Reviewers watch for diffs that touch one and not the other.

Other places worth keeping in mind:

  • New generated types should be emitted by both
  • Changes to the Prisma namespace shape need to land in both
  • Client extension types are emitted from both

Differences in output

The generators produce semantically equivalent clients but differ in:

  • Module format — JS-flavored output is CJS-first; TS-flavored output is ESM-first
  • Type emission style — both use @prisma/ts-builders, but the file structure and re-exports differ
  • Default output path — JS-flavored historically defaults to node_modules/.prisma/client; TS-flavored expects an explicit output = "../generated" and lives next to user code

Runtime imports come from the same @prisma/client package — what differs is the generated TypeScript surface.

Operational implications

  • A change to PrismaClientOptions requires touching five files (see @prisma/client runtime)
  • CI tests both generators in client-packages (in .github/workflows/test-template.yml)
  • Bundle size limits track outputs from both

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

The two generators – Prisma wiki | Factory