ProjectEvergreen / greenwood

Greenwood is your workbench for the web, embracing web standards from the ground up to empower your stack from front to back.
https://www.greenwoodjs.io
MIT License
96 stars 9 forks source link

Edge Runtime support for Adapter plugins #1141

Open thescientist13 opened 1 year ago

thescientist13 commented 1 year ago

Type of Change

Feature

Summary

Coming out of #1008 , Greenwood now has support for the following serverless hosting providers

With additional support coming soon for

Most of these platforms also support edge runtimes, so for these and upcoming adapter plugins, so we will want to look into adding Edge support as well. Something to keep in mind though is reproducing the "edge" runtime locally, since there will be geographic and custom context only available at runtime on the hosting platform.

Details

Based on reading done so far, I think there will likely just need to be an option to opt-in per file (or maybe a top level project wide config?) to determine if something should run at the edge or not, e.g.

// src/api/greeting
export async function handler(request, context) {
  // ...
}

export const runtime = 'edge';

Integrating with local hosting platform CLIs would probably be super helpful here.

thescientist13 commented 9 months ago

I'm thinking this may need / want to be a post 1.x feature? Not sure which is more important, more adapters, or deeper integration with current adapters? 🤔