Skip to content

Commit

Permalink
build: drop blob-polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Nov 26, 2024
1 parent f4f1e28 commit 81557dc
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 41 deletions.
3 changes: 1 addition & 2 deletions packages/primitives/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
},
Expand Down
1 change: 0 additions & 1 deletion packages/primitives/src/primitives/blob.js

This file was deleted.

30 changes: 1 addition & 29 deletions packages/primitives/src/primitives/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 0 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"dependsOn": ["^build"],
"outputs": [
"abort-controller/**",
"blob/**",
"cache/**",
"console/**",
"crypto/**",
Expand Down

0 comments on commit 81557dc

Please sign in to comment.