Skip to content

[Feature Request] Compatibility with Edge Runtime #785

@ymc9

Description

@ymc9

Background

Prisma didn't support running in the edge environment (Vercel, CloudFlare, etc.) in older versions, so it wasn't a design goal for ZenStack either. However, things have been changing fast in the past few months:

  • The Accelerate cloud offering is fully edge compatible
  • The Driver Adapters feature now leverages HTTP protocol to talk to PlanetScale and Neon. It's not edge-compatible yet, but I believe it's not far. We should confirm this with the Prisma team, though.

Proposed Solution

The main obstacle to running ZenStack on the edge today is the environment doesn't allow dynamic require calls. ZenStack uses it to dynamically load generated code (for evaluating access policies) and determine Prisma version (for compatibility with both v4 and v5), and a few other less important occasions.

However, if we go ahead and make the enhance API generated as well, the dynamicity mentioned above can be determined at zenstack generate time instead of runtime. I believe it's doable but requires careful backward compatibility testing and verification in different edge environments.

Question

What are the main edge runtime providers that people care about besides Vercel and CloudFlare?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions