Skip to content

chore: disable native node blob #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/blob/src/lib.node.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
export { TextEncoder, TextDecoder, ReadableStream } from "./package.js"
import { Blob as NodeBlob } from "./blob.node.js"
// import { Blob as NodeBlob } from "./blob.node.js"
import { Blob as WebBlob } from "./blob.js"

/** @type {typeof globalThis.Blob} */
// Our first choise is to use global `Blob` because it may be available e.g. in
// electron renderrer process. If not available fall back to node native
// implementation, if also not available use our implementation.
export const Blob = globalThis.Blob || NodeBlob || WebBlob
export const Blob =
globalThis.Blob ||
// Disable node native blob until impractical perf issue is fixed
// @see https://github.com/nodejs/node/issues/42108
// NodeBlob ||
WebBlob