Skip to content

Commit d18cc32

Browse files
authored
fix: add an option that suppresses eszip migration warning (#583)
1 parent 29d3743 commit d18cc32

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ext/runtime/js/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ globalThis.bootstrapSBEdge = (opts, ctx) => {
590590
setLanguage("en");
591591

592592
core.addMainModuleHandler((main) => {
593-
if (migrated) {
593+
if (migrated && !ctx?.suppressEszipMigrationWarning) {
594594
globalThis.console.warn(
595595
"It appears this function was deployed using an older version of Supabase CLI.\n",
596596
"For best performance and compatibility we recommend re-deploying the function using the latest version of the CLI.",

types/global.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ interface PermissionsOptions {
4343
allow_import?: string[] | null;
4444
}
4545

46+
interface UserWorkerCreateContext {
47+
sourceMap?: boolean | null;
48+
importMapPath?: string | null;
49+
shouldBootstrapMockFnThrowError?: boolean | null;
50+
suppressEszipMigrationWarning?: boolean | null;
51+
useReadSyncFileAPI?: boolean | null;
52+
}
53+
4654
interface UserWorkerCreateOptions {
4755
servicePath?: string | null;
4856
envVars?: string[][] | [string, string][] | null;
@@ -67,7 +75,7 @@ interface UserWorkerCreateOptions {
6775
s3FsConfig?: S3FsConfig | null;
6876
tmpFsConfig?: TmpFsConfig | null;
6977

70-
context?: { [key: string]: unknown } | null;
78+
context?: UserWorkerCreateContext | null;
7179
}
7280

7381
interface HeapStatistics {
@@ -178,5 +186,6 @@ declare namespace Supabase {
178186
declare namespace Deno {
179187
export namespace errors {
180188
class WorkerRequestCancelled extends Error {}
189+
class WorkerAlreadyRetired extends Error {}
181190
}
182191
}

0 commit comments

Comments
 (0)