create-t3-turbo
create-t3-turbo copied to clipboard
Enable Prisma Client caching by Turbo and hoist Client artifacts
This PR addresses the error warn(prisma-client) There are already 10 instances of Prisma Client actively running
when adding Prisma to Next.js, as recommeded by Prisma on https://www.prisma.io/docs/guides/database/troubleshooting-orm/help-articles/nextjs-prisma-client-dev-practices.
Additionally, I've been able to restore turbo caching to the generate-db
script from packages/db
and hoist the generated artifacts from the client to the root of the project. This seems to solve the problem found with Next, where it doesn't play well with non-node_module dirs.
To reproduce and test caching behavior for the Prisma Client and applications:
- Clone the repo and install the dependencies.
- Run the
build
script on the root of the project. It should both generate the client, and build the@acme/nextjs
project. - Run the
build
script a second time. It should be a full Turbo cache of both the Prisma client and the Next.js application. - Modify something on
@acme/nextjs
to invalidate it's cache. Run thebuild
script again. The Prisma Client should be pulled from cache, while the application is rebuilt. - Modify something on the Prisma schema file. Run the
build
script again. Both the Prisma Client and the application should get rebuilt.
I can't say for sure how well these settings are going to play with Turbo's Remote caching, and my current environment also doesn't let me experiment with the Expo project very well.
@ernestoresende is attempting to deploy a commit to the t3-oss Team on Vercel.
A member of the Team first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
create-t3-turbo | ✅ Ready (Inspect) | Visit Preview | Oct 21, 2022 at 9:18AM (UTC) |