From 680b6c496d17137c08edf1cb852cd84901ace922 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 25 Jul 2024 16:28:29 +0000 Subject: [PATCH] fix(compat): remove ReadableStream polyfill redundant since node v16 Note that this breaks streaming in Node v14, which has been unsupported since v4.0.0 of this library. --- package.json | 3 +-- src/_shims/node-runtime.ts | 4 +--- yarn.lock | 5 ----- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index a5baaa24..ee465f5a 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,7 @@ "formdata-node": "^4.3.2", "jose": "^4.14.4", "node-fetch": "^2.6.7", - "qs": "^6.10.3", - "web-streams-polyfill": "^3.2.1" + "qs": "^6.10.3" }, "devDependencies": { "@swc/core": "^1.3.102", diff --git a/src/_shims/node-runtime.ts b/src/_shims/node-runtime.ts index a9c42ebe..ab9f2ab5 100644 --- a/src/_shims/node-runtime.ts +++ b/src/_shims/node-runtime.ts @@ -13,9 +13,7 @@ import { Readable } from 'node:stream'; import { type RequestOptions } from '../core'; import { MultipartBody } from './MultipartBody'; import { type Shims } from './registry'; - -// @ts-ignore (this package does not have proper export maps for this export) -import { ReadableStream } from 'web-streams-polyfill/dist/ponyfill.es2018.js'; +import { ReadableStream } from 'node:stream/web'; type FileFromPathOptions = Omit; diff --git a/yarn.lock b/yarn.lock index 92851843..6a12803b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3523,11 +3523,6 @@ web-streams-polyfill@4.0.0-beta.1: resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.1.tgz#3b19b9817374b7cee06d374ba7eeb3aeb80e8c95" integrity sha512-3ux37gEX670UUphBF9AMCq8XM6iQ8Ac6A+DSRRjDoRBm1ufCkaCDdNVbaqq60PsEkdNlLKrGtv/YBP4EJXqNtQ== -web-streams-polyfill@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" - integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"