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

Support Next.js Edge Runtime #60

Open
angeloashmore opened this issue Feb 17, 2023 · 0 comments
Open

Support Next.js Edge Runtime #60

angeloashmore opened this issue Feb 17, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@angeloashmore
Copy link
Member

Is your feature request related to a problem? Please describe.

Next.js supports a runtime called Edge Runtime built upon Web APIs, unlike the default Node.js-based runtime.

Some @prismicio/next APIs are incompatible with Edge Runtime, such as setPreviewData(). setPreviewData() reads an API Route request and sets a Prismic-specific Preview Data property, but the function does not currently support reading a Web API Request object as used in Edge Runtime.

Describe the solution you'd like

The existing @prismicio/next APIs could be made universal to run in both the default non-Edge Runtime and Edge Runtime environments. This can probably be done using duck typing to test the received data.

Describe alternatives you've considered

  • 🚫 Provide a different set of helpers specific to a runtime.
  • 🚫 Only support one runtime.

Additional context

None.

@angeloashmore angeloashmore added the enhancement New feature or request label Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant