diff --git a/packages/edge-bundler/README.md b/packages/edge-bundler/README.md index d9762acba9..a55294f8dc 100644 --- a/packages/edge-bundler/README.md +++ b/packages/edge-bundler/README.md @@ -38,12 +38,11 @@ Intelligently prepare Netlify Edge Functions for deployment. To avoid pulling in additional dependencies at runtime, this package vendors some Deno modules in the `deno/vendor` directory. -You can recreate this directory by running `npm run vendor`. +This will go away soon as we move away from the ESZIP format. > [!WARNING] -> At the time of writing, the underlying Deno CLI command doesn't correctly pull the WASM binary required by the ESZIP -> module. If you run the command to update the list of vendores modules, please ensure you're not deleting -> `eszip_wasm_bg.wasm`. +> The `eszip` module contains a set of custom changes that diverge from the upstream. If you need to update this module, +> make sure to backport them. ## Contributors diff --git a/packages/edge-bundler/deno/vendor/deno.land/x/eszip@v0.55.2/eszip.ts b/packages/edge-bundler/deno/vendor/deno.land/x/eszip@v0.55.2/eszip.ts index 23a1935fcb..6ddc547603 100644 --- a/packages/edge-bundler/deno/vendor/deno.land/x/eszip@v0.55.2/eszip.ts +++ b/packages/edge-bundler/deno/vendor/deno.land/x/eszip@v0.55.2/eszip.ts @@ -81,6 +81,11 @@ class V2 { const imports: Record = {}; for (const specifier of this.specifiers) { + // NOTE: This is specific to Netlify, to address the fact that we can't + // unpack remote URL specifiers to paths on disk. + // https://github.com/netlify/build/pull/6716 + // https://github.com/netlify/build/pull/6720 + // https://github.com/netlify/build/pull/6722 if (new URL(specifier).protocol !== "file:") continue const module = await this.parser.getModuleSource(specifier); await write(join(dest, "source", url2path(specifier)), module); diff --git a/packages/edge-bundler/node/bundler.ts b/packages/edge-bundler/node/bundler.ts index 52ce09334a..6faa437141 100644 --- a/packages/edge-bundler/node/bundler.ts +++ b/packages/edge-bundler/node/bundler.ts @@ -250,6 +250,10 @@ const getFunctionConfigs = async ({ throw err } + log.user( + 'WARNING: Import assertions are deprecated and will be removed soon. Refer to https://ntl.fyi/import-assert for more information.', + ) + try { // We failed to extract the configuration because there is an import assert // in the function code, a deprecated feature that we used to support with diff --git a/packages/edge-bundler/package.json b/packages/edge-bundler/package.json index 38bc9cc457..9f4f2e113a 100644 --- a/packages/edge-bundler/package.json +++ b/packages/edge-bundler/package.json @@ -24,8 +24,7 @@ "test:dev:deno": "deno test --allow-all deno", "test:ci:vitest": "vitest run --coverage", "test:ci:deno": "deno test --allow-all deno", - "test:integration": "node --experimental-modules test/integration/test.js", - "vendor": "deno vendor --force --output deno/vendor https://deno.land/x/eszip@v0.55.2/mod.ts https://deno.land/x/retry@v2.0.0/mod.ts https://deno.land/x/std@0.177.0/path/mod.ts" + "test:integration": "node --experimental-modules test/integration/test.js" }, "keywords": [], "license": "MIT",