feat(client): remove DataProxyEngine, remove /edge import - #28345
Conversation
/edge import
/edge importDataProxyEngine, remove /edge import
|
Client memory tests, node 24, library: ✅ Success |
size-limit report 📦
|
Amp-Thread-ID: https://ampcode.com/threads/T-dd0e788f-9e76-4afb-acb8-8fa7c6b16698 Co-authored-by: Amp <amp@ampcode.com>
|
I'm curious about what will happen to the accelerate extension after the removal of I've noticed that Prisma has been actively collaborating with Cloudflare, but currently, compatibility with the workerd environment is the worst.
I upgrade to Prisma as soon as a new version is released, to reduce the workload of upgrading to Prisma 7 in the future. I watch two hours of Prisma Issues and PR content every day, and the recent Prisma work has me very worried. |
|
Hey @medz ! 👋 Really appreciate the thoughtful feedback. Could you please check your DMs on X? We reached out there about today’s AMA on our X account It would be great if you could bring up some of these insights and questions in the thread. I think they’d add a lot of value to the discussion. |
This PR introduces a new way to configure the Accelerate URL in
preparation to removing `url` from PSL:
```ts
new PrismaClient({
accelerateUrl: "prisma://...",
})
```
This property is mutually exclusive with `adapter`, and exactly one of
them needs to be provided when using `engineType = "client"`.
It also makes a few related changes along the way or as a side effect:
- Contributes towards
[TML-1459](https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prisma-cli-and-prismaclient):
the logic related to environment variables was completely removed from
the `RemoteExecutor` code path, along with the `resolveDatasourceUrl`
function.
- Fixes the `@prisma/extension-accelerate` extension which was
inadvertently broken in #28345:
while most of `accelerateUtils` (which were meant to be used by the
removed `AccelerateEngine`) were indeed never used, one specific method
is actually currently used:
`_accelerateEngineConfig.accelerateUtils.resolveDatasourceUrl`. This PR
now restores this function and re-implements it in a different way.
- As a result of this, we now have a new validation and a DX improvement
we didn't use to: now if you apply the Accelerate extension to a client
that's not actually configured to use Accelerate, you will get a very
clear error with a code suggestion.
- Removes `null` support for the `adapter` constructor option, which was
introduced in #21315. It was the
only option that required `null` instead of `undefined` to disable it
explicitly and it was inconsistent with the others. The [motivation for
introducing `null` and making it different from
`undefined`](#21163 (comment))
made total sense for the `LibraryEngine` (where accidentally setting the
`adapter` to `undefined` meant silently using completely different
drivers before that change) but is now obsolete for the `ClientEngine`.
Since we are removing `LibraryEngine` in
#28375, we don't need this
distinction anymore since there are no longer any pitfalls from using
`adapter: undefined`, and removing it here in this PR made the
validation around the combinations of `adapter` and `accelerateUrl`
easier.
- Fixed the incorrect error message when Accelerate URL cannot be
parsed.
Closes:
https://linear.app/prisma-company/issue/TML-1507/env-less-accelerate-url-configuration
This PR: - is built on top of #28342 - removes `DataProxyEngine` - removes `AccelerateEngine` - removes `@prisma/accelerate-contract` - removes `/edge` from `@prisma/client` - removes `in-memory` tests (which were using `library` query engine) - removes support for `wasm-engine-edge` and `edge` from `TARGET_BUILD_TYPE` - adjusts some functional tests so that we no longer have to care about the line numbers in snapshot tests - closes [TML-1535](https://linear.app/prisma-company/issue/TML-1535/get-rid-of-dataproxyengine-studio) --------- Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com>
This PR introduces a new way to configure the Accelerate URL in
preparation to removing `url` from PSL:
```ts
new PrismaClient({
accelerateUrl: "prisma://...",
})
```
This property is mutually exclusive with `adapter`, and exactly one of
them needs to be provided when using `engineType = "client"`.
It also makes a few related changes along the way or as a side effect:
- Contributes towards
[TML-1459](https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prisma-cli-and-prismaclient):
the logic related to environment variables was completely removed from
the `RemoteExecutor` code path, along with the `resolveDatasourceUrl`
function.
- Fixes the `@prisma/extension-accelerate` extension which was
inadvertently broken in #28345:
while most of `accelerateUtils` (which were meant to be used by the
removed `AccelerateEngine`) were indeed never used, one specific method
is actually currently used:
`_accelerateEngineConfig.accelerateUtils.resolveDatasourceUrl`. This PR
now restores this function and re-implements it in a different way.
- As a result of this, we now have a new validation and a DX improvement
we didn't use to: now if you apply the Accelerate extension to a client
that's not actually configured to use Accelerate, you will get a very
clear error with a code suggestion.
- Removes `null` support for the `adapter` constructor option, which was
introduced in #21315. It was the
only option that required `null` instead of `undefined` to disable it
explicitly and it was inconsistent with the others. The [motivation for
introducing `null` and making it different from
`undefined`](#21163 (comment))
made total sense for the `LibraryEngine` (where accidentally setting the
`adapter` to `undefined` meant silently using completely different
drivers before that change) but is now obsolete for the `ClientEngine`.
Since we are removing `LibraryEngine` in
#28375, we don't need this
distinction anymore since there are no longer any pitfalls from using
`adapter: undefined`, and removing it here in this PR made the
validation around the combinations of `adapter` and `accelerateUrl`
easier.
- Fixed the incorrect error message when Accelerate URL cannot be
parsed.
Closes:
https://linear.app/prisma-company/issue/TML-1507/env-less-accelerate-url-configuration
This PR: - is built on top of #28342 - removes `DataProxyEngine` - removes `AccelerateEngine` - removes `@prisma/accelerate-contract` - removes `/edge` from `@prisma/client` - removes `in-memory` tests (which were using `library` query engine) - removes support for `wasm-engine-edge` and `edge` from `TARGET_BUILD_TYPE` - adjusts some functional tests so that we no longer have to care about the line numbers in snapshot tests - closes [TML-1535](https://linear.app/prisma-company/issue/TML-1535/get-rid-of-dataproxyengine-studio) --------- Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com>
This PR introduces a new way to configure the Accelerate URL in
preparation to removing `url` from PSL:
```ts
new PrismaClient({
accelerateUrl: "prisma://...",
})
```
This property is mutually exclusive with `adapter`, and exactly one of
them needs to be provided when using `engineType = "client"`.
It also makes a few related changes along the way or as a side effect:
- Contributes towards
[TML-1459](https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prisma-cli-and-prismaclient):
the logic related to environment variables was completely removed from
the `RemoteExecutor` code path, along with the `resolveDatasourceUrl`
function.
- Fixes the `@prisma/extension-accelerate` extension which was
inadvertently broken in #28345:
while most of `accelerateUtils` (which were meant to be used by the
removed `AccelerateEngine`) were indeed never used, one specific method
is actually currently used:
`_accelerateEngineConfig.accelerateUtils.resolveDatasourceUrl`. This PR
now restores this function and re-implements it in a different way.
- As a result of this, we now have a new validation and a DX improvement
we didn't use to: now if you apply the Accelerate extension to a client
that's not actually configured to use Accelerate, you will get a very
clear error with a code suggestion.
- Removes `null` support for the `adapter` constructor option, which was
introduced in #21315. It was the
only option that required `null` instead of `undefined` to disable it
explicitly and it was inconsistent with the others. The [motivation for
introducing `null` and making it different from
`undefined`](#21163 (comment))
made total sense for the `LibraryEngine` (where accidentally setting the
`adapter` to `undefined` meant silently using completely different
drivers before that change) but is now obsolete for the `ClientEngine`.
Since we are removing `LibraryEngine` in
#28375, we don't need this
distinction anymore since there are no longer any pitfalls from using
`adapter: undefined`, and removing it here in this PR made the
validation around the combinations of `adapter` and `accelerateUrl`
easier.
- Fixed the incorrect error message when Accelerate URL cannot be
parsed.
Closes:
https://linear.app/prisma-company/issue/TML-1507/env-less-accelerate-url-configuration
This PR: - is built on top of #28342 - removes `DataProxyEngine` - removes `AccelerateEngine` - removes `@prisma/accelerate-contract` - removes `/edge` from `@prisma/client` - removes `in-memory` tests (which were using `library` query engine) - removes support for `wasm-engine-edge` and `edge` from `TARGET_BUILD_TYPE` - adjusts some functional tests so that we no longer have to care about the line numbers in snapshot tests - closes [TML-1535](https://linear.app/prisma-company/issue/TML-1535/get-rid-of-dataproxyengine-studio) --------- Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com>
This PR introduces a new way to configure the Accelerate URL in
preparation to removing `url` from PSL:
```ts
new PrismaClient({
accelerateUrl: "prisma://...",
})
```
This property is mutually exclusive with `adapter`, and exactly one of
them needs to be provided when using `engineType = "client"`.
It also makes a few related changes along the way or as a side effect:
- Contributes towards
[TML-1459](https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prisma-cli-and-prismaclient):
the logic related to environment variables was completely removed from
the `RemoteExecutor` code path, along with the `resolveDatasourceUrl`
function.
- Fixes the `@prisma/extension-accelerate` extension which was
inadvertently broken in #28345:
while most of `accelerateUtils` (which were meant to be used by the
removed `AccelerateEngine`) were indeed never used, one specific method
is actually currently used:
`_accelerateEngineConfig.accelerateUtils.resolveDatasourceUrl`. This PR
now restores this function and re-implements it in a different way.
- As a result of this, we now have a new validation and a DX improvement
we didn't use to: now if you apply the Accelerate extension to a client
that's not actually configured to use Accelerate, you will get a very
clear error with a code suggestion.
- Removes `null` support for the `adapter` constructor option, which was
introduced in #21315. It was the
only option that required `null` instead of `undefined` to disable it
explicitly and it was inconsistent with the others. The [motivation for
introducing `null` and making it different from
`undefined`](#21163 (comment))
made total sense for the `LibraryEngine` (where accidentally setting the
`adapter` to `undefined` meant silently using completely different
drivers before that change) but is now obsolete for the `ClientEngine`.
Since we are removing `LibraryEngine` in
#28375, we don't need this
distinction anymore since there are no longer any pitfalls from using
`adapter: undefined`, and removing it here in this PR made the
validation around the combinations of `adapter` and `accelerateUrl`
easier.
- Fixed the incorrect error message when Accelerate URL cannot be
parsed.
Closes:
https://linear.app/prisma-company/issue/TML-1507/env-less-accelerate-url-configuration
This PR:
DataProxyEngineAccelerateEngine@prisma/accelerate-contract/edgefrom@prisma/clientin-memorytests (which were usinglibraryquery engine)wasm-engine-edgeandedgefromTARGET_BUILD_TYPE