A couple of months ago, we started migrating our Edge Functions platform to use Deno 2.1. Deno 2 bridges the gap between Node and Deno by supporting Node's built-in APIs, npm modules, and package.json. This would make it easy to migrate existing Node apps to run in the Edge Functions platform.
Previously, we announced that you can start testing Deno 2.1 locally for your Edge Functions. Thanks to everyone who tried and gave us feedback.
Today, we give you the option to preview Deno 2.1 on our hosted platform. You should try running your existing Edge Functions with Deno 2.1 and report any bugs/issues.
You can first run deno lint locally on your Edge Functions code with no-deprecated-deno-api rule to find any breaking changes in Deno 2.
Once you have updated your functions, you can test them in our hosted platform as follows:
There are two ways to force your functions to run on the Deno 2 preview cluster.
- Add query parameter
forceDenoVersion=2 to your function requests
_10https://project-ref.supabase.co/functions/v1/hello-world?forceDenoVersion=2
- Add
x-deno-version: 2 header in requests
_10 --url https://project-ref.supabase.co/functions/v1/hello-world \
_10 --header 'content-type: application/json' \
_10 --header 'x-deno-version: 2' \
Note: Deno 2 Preview cluster traffic will be served from us-east-2 region. You don't need to set the region explicitly.
Also, in the next couple of days, we will notify projects currently using deprecated APIs via email to update their functions to use Deno 2.
Based on the feedback and issues we discover in this preview, we will decide the timeline on making Deno 2.1 the default runtime in our hosted platform. Current ETA is within 3-6 weeks.