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

Configure deployment as Vercel edge functions on a per-endpoint basis #6808

Closed
mquandalle opened this issue Sep 14, 2022 · 3 comments
Closed
Labels
feature / enhancement New feature or request pkg:adapter-vercel Pertaining to the Vercel adapter
Milestone

Comments

@mquandalle
Copy link

Describe the problem

In Next.js it is possible to deploy an endpoint as a Vercel edge function. Contrary to the global edge: boolean option of SvelteKit adapter-vercel, it is possible to choose the runtime (lambda or edge) on a per endpoint basis.

Describe the proposed solution

In +page.js export something similar to

export const config = {
  runtime: 'experimental-edge',
};

Alternatives considered

No response

Importance

would make my life easier

Additional Information

I have an application where I need this because some of my routes cannot be deployed to the edge (they use native NodeJs dependencies), and some of my routes need the ability to finish some async work after a response is returned (which is not possible in lambdas).

My current workaround is to amend the build output of SvelteKit by creating a .vercel/output/myedgefunc.func directory that follows the Vercel build output API. It works, but is complicated and fragile. It would make my life easier if this was supported by the framework.

@benmccann benmccann added feature / enhancement New feature or request pkg:adapter-vercel Pertaining to the Vercel adapter labels Sep 14, 2022
@Rich-Harris Rich-Harris added this to the post-1.0 milestone Sep 14, 2022
@Rich-Harris
Copy link
Member

This is definitely something we want to do post-1.0. The challenge is designing it in a sufficiently future-proof and framework-agnostic way (e.g. it would make sense to use the same approach for Netlify)

@benmccann benmccann changed the title Deploy an endpoint as a Vercel edge function Configure deployment as Vercel edge functions on a per-endpoint basis Nov 15, 2022
@enyo
Copy link
Contributor

enyo commented Dec 8, 2022

Would it make sense to be able to export it like export const edge = true; from page.ts and use it in the adapter?

@Rich-Harris
Copy link
Member

Closing in favour of #8383

@Rich-Harris Rich-Harris closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / enhancement New feature or request pkg:adapter-vercel Pertaining to the Vercel adapter
Projects
None yet
Development

No branches or pull requests

4 participants