Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): prune generated dmmf #22962

Merged
merged 7 commits into from Feb 7, 2024
Merged

Conversation

millsp
Copy link
Member

@millsp millsp commented Feb 5, 2024

This PR prunes the generated dmmf in the client to its bare minimal version, and only does it when we are generating the wasm client. This improves gzip compression.

Copy link
Contributor

github-actions bot commented Feb 5, 2024

size-limit report 📦

Path Size
packages/client/runtime/library.js 193.76 KB (0%)
packages/client/runtime/library.d.ts 81 B (0%)
packages/client/runtime/binary.js 604.84 KB (0%)
packages/client/runtime/binary.d.ts 26 B (0%)
packages/client/runtime/edge.js 182.45 KB (0%)
packages/client/runtime/edge-esm.js 182.35 KB (0%)
packages/client/runtime/wasm.js 204.7 KB (+0.01% 🔺)
packages/client/runtime/index-browser.js 33.5 KB (0%)
packages/client/runtime/index-browser.d.ts 89 B (0%)
packages/cli/build/index.js 2.71 MB (0%)
packages/client/prisma-client-0.0.0.tgz 1.43 MB (+0.02% 🔺)
packages/cli/prisma-0.0.0.tgz 3.9 MB (+0.01% 🔺)
packages/bundle-size/da-workers-libsql/output.tgz 963.63 KB (-0.35% 🔽)
packages/bundle-size/da-workers-neon/output.tgz 987.92 KB (-0.34% 🔽)
packages/bundle-size/da-workers-pg/output.tgz 1009.65 KB (-0.34% 🔽)
packages/bundle-size/da-workers-planetscale/output.tgz 938.08 KB (-0.36% 🔽)
packages/bundle-size/da-workers-d1/output.tgz 933.47 KB (-0.36% 🔽)

@millsp millsp self-assigned this Feb 5, 2024
@millsp millsp added this to the 5.10.0 milestone Feb 5, 2024
@millsp millsp marked this pull request as ready for review February 6, 2024 00:04
@millsp millsp requested a review from a team as a code owner February 6, 2024 00:05
@millsp millsp requested review from Jolg42 and jkomyno and removed request for a team February 6, 2024 00:05
@SevInf
Copy link
Contributor

SevInf commented Feb 6, 2024

Do we know if that will affect any of the third party projects? runtimeDataModel itself is private, but is also used to re-create Prisma.dmmf.

@millsp
Copy link
Member Author

millsp commented Feb 6, 2024

This change only targets wasm build. So to your point, I think we should at least throw an error for Prisma.dmmf there, as it may only be partially true otherwise?

@SevInf
Copy link
Contributor

SevInf commented Feb 6, 2024

Yes, i think error for Prisma.dmmf would be an ok way to go, if it is only about wasm build

@millsp millsp force-pushed the fix/client/prune-generated-dmmf branch from 234ab24 to ed6d358 Compare February 6, 2024 20:58
@millsp millsp force-pushed the fix/client/prune-generated-dmmf branch from d416c2a to 33bfaa9 Compare February 6, 2024 21:19
@millsp millsp requested a review from SevInf February 6, 2024 21:23
@millsp millsp merged commit 2861346 into main Feb 7, 2024
153 of 155 checks passed
@millsp millsp deleted the fix/client/prune-generated-dmmf branch February 7, 2024 16:37
@alexdoan102
Copy link

@millsp @SevInf @hayes since prisma now support cloudflare
==> https://www.prisma.io/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare

we need the Prisma.dmmf to use with 3rd party [@pothos/plugin-prisma] plugin.
==> this is the issue: hayes/pothos#1190

can you  please put this property back, so that the graphql plugins will work for edge./cloudflare?

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.

None yet

3 participants