Skip to content

Commit

Permalink
refactor: use native Blob class (#7217)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Brophy <[email protected]>
  • Loading branch information
MichaelDeBoey and brophdawg11 authored Aug 30, 2023
1 parent 10d95f0 commit a9edc94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/use-native-blob.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/node": patch
---

Use native `Blob` cleass instead of polyfill
2 changes: 1 addition & 1 deletion packages/remix-node/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "@remix-run/web-fetch";
export { FormData } from "@remix-run/web-fetch";
// @ts-ignore
export { File, Blob } from "@remix-run/web-file";
export { File } from "@remix-run/web-file";

type NodeHeadersInit = ConstructorParameters<typeof WebHeaders>[0];
type NodeResponseInfo = ConstructorParameters<typeof WebResponse>[0];
Expand Down
3 changes: 0 additions & 3 deletions packages/remix-node/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {

import { atob, btoa } from "./base64";
import {
Blob as NodeBlob,
File as NodeFile,
FormData as NodeFormData,
Headers as NodeHeaders,
Expand All @@ -24,7 +23,6 @@ declare global {
atob: typeof atob;
btoa: typeof btoa;

Blob: typeof Blob;
File: typeof File;

Headers: typeof Headers;
Expand All @@ -43,7 +41,6 @@ export function installGlobals() {
global.atob = atob;
global.btoa = btoa;

global.Blob = NodeBlob;
global.File = NodeFile;

global.Headers = NodeHeaders as typeof Headers;
Expand Down

0 comments on commit a9edc94

Please sign in to comment.