From b43871b24e018950a72fb0214088e69fa51716a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Mon, 21 Aug 2023 15:07:40 +0200 Subject: [PATCH 1/2] feat(remix-node): use built-in `atob` & `btoa` --- packages/remix-node/base64.ts | 7 ------- packages/remix-node/globals.ts | 7 ------- 2 files changed, 14 deletions(-) delete mode 100644 packages/remix-node/base64.ts diff --git a/packages/remix-node/base64.ts b/packages/remix-node/base64.ts deleted file mode 100644 index f4d2f50ffff..00000000000 --- a/packages/remix-node/base64.ts +++ /dev/null @@ -1,7 +0,0 @@ -export function atob(a: string): string { - return Buffer.from(a, "base64").toString("binary"); -} - -export function btoa(b: string): string { - return Buffer.from(b, "binary").toString("base64"); -} diff --git a/packages/remix-node/globals.ts b/packages/remix-node/globals.ts index aadae3533ce..a4e55bea42c 100644 --- a/packages/remix-node/globals.ts +++ b/packages/remix-node/globals.ts @@ -14,7 +14,6 @@ import { WritableStreamDefaultWriter as NodeWritableStreamDefaultWriter, } from "@remix-run/web-stream"; -import { atob, btoa } from "./base64"; import { Blob as NodeBlob, File as NodeFile, @@ -32,9 +31,6 @@ declare global { } interface Global { - atob: typeof atob; - btoa: typeof btoa; - Blob: typeof Blob; File: typeof File; @@ -51,9 +47,6 @@ declare global { } export function installGlobals() { - global.atob = atob; - global.btoa = btoa; - global.Blob = NodeBlob; global.File = NodeFile; From ecfdd23e870c2cd3538be3cfa3199573decd2fc7 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Fri, 1 Sep 2023 10:39:49 -0400 Subject: [PATCH 2/2] Add changeset --- .changeset/early-trains-fold.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/early-trains-fold.md diff --git a/.changeset/early-trains-fold.md b/.changeset/early-trains-fold.md new file mode 100644 index 00000000000..541665eb412 --- /dev/null +++ b/.changeset/early-trains-fold.md @@ -0,0 +1,5 @@ +--- +"@remix-run/node": patch +--- + +Remove `atob`/`btoa` polyfills in favor of built-in versions