From 8793cbfe8abddc8758517633d0b1a5e5cfffacad Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Mon, 16 Dec 2024 11:44:59 +0000 Subject: [PATCH 1/3] Use Undici 7 --- .changeset/serious-eels-rule.md | 5 +++++ packages/platform-node/package.json | 2 +- .../platform-node/src/internal/httpClientUndici.ts | 3 +-- pnpm-lock.yaml | 12 ++++++------ 4 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 .changeset/serious-eels-rule.md diff --git a/.changeset/serious-eels-rule.md b/.changeset/serious-eels-rule.md new file mode 100644 index 00000000000..f9f339e7f92 --- /dev/null +++ b/.changeset/serious-eels-rule.md @@ -0,0 +1,5 @@ +--- +"@effect/platform-node": patch +--- + +Use Undici 7 diff --git a/packages/platform-node/package.json b/packages/platform-node/package.json index b62ac278b2b..9082aca1766 100644 --- a/packages/platform-node/package.json +++ b/packages/platform-node/package.json @@ -46,7 +46,7 @@ "dependencies": { "@effect/platform-node-shared": "workspace:^", "mime": "^3.0.0", - "undici": "^6.19.7", + "undici": "^7.1.0", "ws": "^8.18.0" }, "peerDependencies": { diff --git a/packages/platform-node/src/internal/httpClientUndici.ts b/packages/platform-node/src/internal/httpClientUndici.ts index 2a86be633ab..244bc2a5682 100644 --- a/packages/platform-node/src/internal/httpClientUndici.ts +++ b/packages/platform-node/src/internal/httpClientUndici.ts @@ -58,8 +58,7 @@ export const make = (dispatcher: Undici.Dispatcher): Client.HttpClient => body, // leave timeouts to Effect.timeout etc headersTimeout: 60 * 60 * 1000, - bodyTimeout: 0, - throwOnError: false + bodyTimeout: 0 }), catch: (cause) => new Error.RequestError({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d9dc40a6fd1..5da23097396 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -468,8 +468,8 @@ importers: specifier: ^3.0.0 version: 3.0.0 undici: - specifier: ^6.19.7 - version: 6.19.7 + specifier: ^7.1.0 + version: 7.1.0 ws: specifier: ^8.18.0 version: 8.18.0 @@ -7196,9 +7196,9 @@ packages: resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} engines: {node: '>=14.0'} - undici@6.19.7: - resolution: {integrity: sha512-HR3W/bMGPSr90i8AAp2C4DM3wChFdJPLrWYpIS++LxS8K+W535qftjt+4MyjNYHeWabMj1nvtmLIi7l++iq91A==} - engines: {node: '>=18.17'} + undici@7.1.0: + resolution: {integrity: sha512-3+mdX2R31khuLCm2mKExSlMdJsfol7bJkIMH80tdXA74W34rT1jKemUTlYR7WY3TqsV4wfOgpatWmmB2Jl1+5g==} + engines: {node: '>=20.18.1'} unicode-canonical-property-names-ecmascript@2.0.1: resolution: {integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==} @@ -15537,7 +15537,7 @@ snapshots: dependencies: '@fastify/busboy': 2.1.1 - undici@6.19.7: {} + undici@7.1.0: {} unicode-canonical-property-names-ecmascript@2.0.1: {} From ab4dd0ad6a7e6e83839cd82d6fff3845e198b36c Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 17 Dec 2024 10:07:02 +1300 Subject: [PATCH 2/3] move to peerDependencies --- .changeset/serious-eels-rule.md | 4 ++-- packages/platform-node/package.json | 7 ++++--- pnpm-lock.yaml | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.changeset/serious-eels-rule.md b/.changeset/serious-eels-rule.md index f9f339e7f92..af0ad388cb1 100644 --- a/.changeset/serious-eels-rule.md +++ b/.changeset/serious-eels-rule.md @@ -1,5 +1,5 @@ --- -"@effect/platform-node": patch +"@effect/platform-node": minor --- -Use Undici 7 +upgrade undici to 7.x and move to peerDependencies diff --git a/packages/platform-node/package.json b/packages/platform-node/package.json index 9082aca1766..70d4c662df6 100644 --- a/packages/platform-node/package.json +++ b/packages/platform-node/package.json @@ -46,17 +46,18 @@ "dependencies": { "@effect/platform-node-shared": "workspace:^", "mime": "^3.0.0", - "undici": "^7.1.0", "ws": "^8.18.0" }, "peerDependencies": { "@effect/platform": "workspace:^", - "effect": "workspace:^" + "effect": "workspace:^", + "undici": "^7.1.0" }, "devDependencies": { "@effect/platform": "workspace:^", "@types/mime": "^3.0.4", "@types/ws": "^8.5.12", - "effect": "workspace:^" + "effect": "workspace:^", + "undici": "^7.1.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5da23097396..0b413b0f7a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -467,9 +467,6 @@ importers: mime: specifier: ^3.0.0 version: 3.0.0 - undici: - specifier: ^7.1.0 - version: 7.1.0 ws: specifier: ^8.18.0 version: 8.18.0 @@ -486,6 +483,9 @@ importers: effect: specifier: workspace:^ version: link:../effect/dist + undici: + specifier: ^7.1.0 + version: 7.1.0 publishDirectory: dist packages/platform-node-shared: @@ -5523,7 +5523,6 @@ packages: libsql@0.4.5: resolution: {integrity: sha512-sorTJV6PNt94Wap27Sai5gtVLIea4Otb2LUiAUyr3p6BPOScGMKGt5F1b5X/XgkNtcsDKeX5qfeBDj+PdShclQ==} - cpu: [x64, arm64, wasm32] os: [darwin, linux, win32] libsql@0.4.6: @@ -6928,6 +6927,7 @@ packages: sudo-prompt@9.2.1: resolution: {integrity: sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} From 0da47949ec10fb1bac0fa7fada7bb065ae0a03f2 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 17 Dec 2024 11:55:39 +1300 Subject: [PATCH 3/3] use re-exports strategy --- .changeset/serious-eels-rule.md | 2 +- packages/platform-node/package.json | 7 +++---- packages/platform-node/src/NodeHttpClient.ts | 2 +- packages/platform-node/src/Undici.ts | 9 +++++++++ packages/platform-node/src/index.ts | 5 +++++ packages/platform-node/src/internal/httpClientUndici.ts | 2 +- pnpm-lock.yaml | 6 +++--- 7 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 packages/platform-node/src/Undici.ts diff --git a/.changeset/serious-eels-rule.md b/.changeset/serious-eels-rule.md index af0ad388cb1..57cb915e011 100644 --- a/.changeset/serious-eels-rule.md +++ b/.changeset/serious-eels-rule.md @@ -2,4 +2,4 @@ "@effect/platform-node": minor --- -upgrade undici to 7.x and move to peerDependencies +upgrade undici to 7.x and expose re-exports in Undici module diff --git a/packages/platform-node/package.json b/packages/platform-node/package.json index 70d4c662df6..9082aca1766 100644 --- a/packages/platform-node/package.json +++ b/packages/platform-node/package.json @@ -46,18 +46,17 @@ "dependencies": { "@effect/platform-node-shared": "workspace:^", "mime": "^3.0.0", + "undici": "^7.1.0", "ws": "^8.18.0" }, "peerDependencies": { "@effect/platform": "workspace:^", - "effect": "workspace:^", - "undici": "^7.1.0" + "effect": "workspace:^" }, "devDependencies": { "@effect/platform": "workspace:^", "@types/mime": "^3.0.4", "@types/ws": "^8.5.12", - "effect": "workspace:^", - "undici": "^7.1.0" + "effect": "workspace:^" } } diff --git a/packages/platform-node/src/NodeHttpClient.ts b/packages/platform-node/src/NodeHttpClient.ts index 9260de4b68e..98943ce6a63 100644 --- a/packages/platform-node/src/NodeHttpClient.ts +++ b/packages/platform-node/src/NodeHttpClient.ts @@ -8,9 +8,9 @@ import type * as Layer from "effect/Layer" import type * as Scope from "effect/Scope" import type * as Http from "node:http" import type * as Https from "node:https" -import type * as Undici from "undici" import * as internal from "./internal/httpClient.js" import * as internalUndici from "./internal/httpClientUndici.js" +import type * as Undici from "./Undici.js" /** * @since 1.0.0 diff --git a/packages/platform-node/src/Undici.ts b/packages/platform-node/src/Undici.ts new file mode 100644 index 00000000000..761047527dc --- /dev/null +++ b/packages/platform-node/src/Undici.ts @@ -0,0 +1,9 @@ +/** + * @since 1.0.0 + */ + +/** + * @since 1.0.0 + * @category undici + */ +export * from "undici" diff --git a/packages/platform-node/src/index.ts b/packages/platform-node/src/index.ts index 9aeae00efa3..3b31b5f93cd 100644 --- a/packages/platform-node/src/index.ts +++ b/packages/platform-node/src/index.ts @@ -82,3 +82,8 @@ export * as NodeWorker from "./NodeWorker.js" * @since 1.0.0 */ export * as NodeWorkerRunner from "./NodeWorkerRunner.js" + +/** + * @since 1.0.0 + */ +export * as Undici from "./Undici.js" diff --git a/packages/platform-node/src/internal/httpClientUndici.ts b/packages/platform-node/src/internal/httpClientUndici.ts index 244bc2a5682..fb67f4380b9 100644 --- a/packages/platform-node/src/internal/httpClientUndici.ts +++ b/packages/platform-node/src/internal/httpClientUndici.ts @@ -15,9 +15,9 @@ import * as Layer from "effect/Layer" import * as Option from "effect/Option" import type * as Scope from "effect/Scope" import type * as Stream from "effect/Stream" -import * as Undici from "undici" import type * as NodeClient from "../NodeHttpClient.js" import * as NodeStream from "../NodeStream.js" +import * as Undici from "../Undici.js" /** @internal */ export const Dispatcher = Context.GenericTag( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0b413b0f7a3..c650828767f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -467,6 +467,9 @@ importers: mime: specifier: ^3.0.0 version: 3.0.0 + undici: + specifier: ^7.1.0 + version: 7.1.0 ws: specifier: ^8.18.0 version: 8.18.0 @@ -483,9 +486,6 @@ importers: effect: specifier: workspace:^ version: link:../effect/dist - undici: - specifier: ^7.1.0 - version: 7.1.0 publishDirectory: dist packages/platform-node-shared: