diff --git a/packages/primitives/package.json b/packages/primitives/package.json index c7052925..4b50415b 100644 --- a/packages/primitives/package.json +++ b/packages/primitives/package.json @@ -24,7 +24,6 @@ ], "devDependencies": { "@edge-runtime/format": "workspace:*", - "blob-polyfill": "7.0.20220408", "esbuild": "0.24.0", "esbuild-plugin-alias": "latest", "event-target-shim": "6.0.2", @@ -42,7 +41,7 @@ ], "scripts": { "build": "ts-node scripts/build.ts", - "clean:build": "rm -rf dist abort-controller blob console crypto events fetch streams url", + "clean:build": "rm -rf dist abort-controller console crypto events fetch streams url", "clean:node": "rm -rf node_modules", "prebuild": "pnpm run clean:build" }, diff --git a/packages/primitives/src/primitives/blob.js b/packages/primitives/src/primitives/blob.js deleted file mode 100644 index f18716c0..00000000 --- a/packages/primitives/src/primitives/blob.js +++ /dev/null @@ -1 +0,0 @@ -export { Blob } from 'blob-polyfill' diff --git a/packages/primitives/src/primitives/load.js b/packages/primitives/src/primitives/load.js index ec32a43c..046ba99f 100644 --- a/packages/primitives/src/primitives/load.js +++ b/packages/primitives/src/primitives/load.js @@ -155,35 +155,7 @@ export function load(scopedContext = {}) { URLSearchParams, URLPattern: urlImpl.URLPattern, }) - - /** @type {import('../../type-definitions/blob')} */ - const blobImpl = (() => { - if (typeof scopedContext.Blob === 'function') { - return { Blob: scopedContext.Blob } - } - - if (typeof Blob === 'function') { - return { Blob } - } - - /** @type {any} */ - const global = { ...streamsImpl, ...scopedContext } - - const globalGlobal = { ...global, Blob: undefined } - Object.setPrototypeOf(globalGlobal, globalThis) - - global.global = globalGlobal - return requireWithFakeGlobalScope({ - context, - id: 'blob.js', - sourceCode: injectSourceCode('./blob.js'), - scopedContext: global, - }) - })() - assign(context, { - Blob: blobImpl.Blob, - }) - assign(context, { structuredClone }) + assign(context, { Blob, structuredClone }) /** @type {import('../../type-definitions/fetch')} */ const fetchImpl = requireWithFakeGlobalScope({ context, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 59f03e52..ac77a41e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -217,9 +217,6 @@ importers: '@edge-runtime/format': specifier: workspace:* version: link:../format - blob-polyfill: - specifier: 7.0.20220408 - version: 7.0.20220408 esbuild: specifier: 0.24.0 version: 0.24.0 @@ -1663,9 +1660,6 @@ packages: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} - blob-polyfill@7.0.20220408: - resolution: {integrity: sha512-oD8Ydw+5lNoqq+en24iuPt1QixdPpe/nUF8azTHnviCZYu9zUC+TwdzIp5orpblJosNlgNbVmmAb//c6d6ImUQ==} - brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -5965,8 +5959,6 @@ snapshots: binary-extensions@2.2.0: {} - blob-polyfill@7.0.20220408: {} - brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 diff --git a/turbo.json b/turbo.json index 74acf98a..0f821ead 100644 --- a/turbo.json +++ b/turbo.json @@ -15,7 +15,6 @@ "dependsOn": ["^build"], "outputs": [ "abort-controller/**", - "blob/**", "cache/**", "console/**", "crypto/**",