Skip to content

Commit

Permalink
remove undici, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Aug 8, 2023
1 parent 688cf12 commit 71399df
Show file tree
Hide file tree
Showing 22 changed files with 977 additions and 1,143 deletions.
5 changes: 2 additions & 3 deletions examples/bare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
"@types/node": "^18.16.19",
"esbuild": "^0.14.54",
"postcss": "^8.4.26",
"solid-start-node": "^0.2.29",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"vite": "^4.4.6"
},
"dependencies": {
"@solidjs/meta": "^0.28.5",
"@solidjs/router": "^0.8.2",
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"undici": "^5.22.1"
"solid-start": "^0.3.0"
},
"engines": {
"node": ">=18"
Expand Down
5 changes: 2 additions & 3 deletions examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
"@types/babel__core": "^7.20.1",
"@types/node": "^18.16.19",
"esbuild": "^0.14.54",
"solid-start-node": "^0.2.29",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"vite": "^4.4.6"
},
"dependencies": {
"@solidjs/meta": "^0.28.5",
"@solidjs/router": "^0.8.2",
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"undici": "^5.22.1"
"solid-start": "^0.3.0"
},
"engines": {
"node": ">=18"
Expand Down
5 changes: 2 additions & 3 deletions examples/movies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"devDependencies": {
"@iconify/json": "^2.2.90",
"sass": "^1.63.6",
"solid-start-node": "^0.2.30",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"unplugin-icons": "^0.14.15",
"vite": "^4.4.6"
Expand All @@ -22,8 +22,7 @@
"solid-heroicons": "^3.2.4",
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"solid-start-netlify": "^0.2.30",
"undici": "^5.22.1"
"solid-start-netlify": "^0.3.0"
},
"engines": {
"node": ">=18"
Expand Down
1 change: 0 additions & 1 deletion examples/notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"string_decoder": "^1.3.0",
"undici": "^5.22.1",
"unplugin-icons": "^0.14.15",
"wrangler": "^2.20.0"
},
Expand Down
5 changes: 2 additions & 3 deletions examples/todomvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
"esbuild": "^0.14.54",
"postcss": "^8.4.26",
"rollup": "^3.26.2",
"solid-start-node": "^0.2.29",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"vite": "^4.4.6"
},
"dependencies": {
"@solidjs/meta": "^0.28.5",
"@solidjs/router": "^0.8.2",
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"undici": "^5.22.1"
"solid-start": "^0.3.0"
},
"engines": {
"node": ">=18"
Expand Down
5 changes: 2 additions & 3 deletions examples/with-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
"esbuild": "^0.14.54",
"postcss": "^8.4.26",
"rollup": "^3.26.2",
"solid-start-node": "^0.2.29",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"vite": "^4.4.6"
},
"dependencies": {
"@solidjs/meta": "^0.28.5",
"@solidjs/router": "^0.8.2",
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"undici": "^5.22.1"
"solid-start": "^0.3.0"
},
"engines": {
"node": ">=18"
Expand Down
5 changes: 2 additions & 3 deletions examples/with-authjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"esbuild": "^0.14.54",
"next-auth": "^4.22.1",
"postcss": "^8.4.26",
"solid-start-node": "^0.2.29",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"vite": "^4.4.6"
},
Expand All @@ -21,8 +21,7 @@
"@solidjs/meta": "^0.28.5",
"@solidjs/router": "^0.8.2",
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"undici": "^5.22.1"
"solid-start": "^0.3.0"
},
"engines": {
"node": ">=18"
Expand Down
5 changes: 2 additions & 3 deletions examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "module",
"devDependencies": {
"@mdx-js/rollup": "^2.3.0",
"solid-start-node": "^0.2.29",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"vite": "^4.4.6"
},
Expand All @@ -17,8 +17,7 @@
"@solidjs/router": "^0.8.2",
"solid-js": "^1.7.9",
"solid-mdx": "^0.0.6",
"solid-start": "^0.3.0",
"undici": "^5.22.1"
"solid-start": "^0.3.0"
},
"engines": {
"node": ">=18"
Expand Down
5 changes: 2 additions & 3 deletions examples/with-prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"type": "module",
"devDependencies": {
"solid-start-node": "^0.2.29",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"vite": "^4.4.6"
},
Expand All @@ -17,8 +17,7 @@
"@solidjs/router": "^0.8.2",
"prisma": "^4.16.2",
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"undici": "^5.22.1"
"solid-start": "^0.3.0"
},
"engines": {
"node": ">=18"
Expand Down
5 changes: 2 additions & 3 deletions examples/with-solid-styled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "module",
"devDependencies": {
"@types/babel__core": "^7.20.1",
"solid-start-node": "^0.2.29",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"vite": "^4.4.6",
"vite-plugin-solid-styled": "^0.8.3"
Expand All @@ -18,8 +18,7 @@
"@solidjs/router": "^0.8.2",
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"solid-styled": "^0.8.2",
"undici": "^5.22.1"
"solid-styled": "^0.8.2"
},
"engines": {
"node": ">=18"
Expand Down
5 changes: 2 additions & 3 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"devDependencies": {
"autoprefixer": "^10.4.14",
"postcss": "^8.4.26",
"solid-start-node": "^0.2.29",
"solid-start-node": "^0.3.0",
"tailwindcss": "^3.3.3",
"typescript": "^4.9.5",
"vite": "^4.4.6"
Expand All @@ -18,8 +18,7 @@
"@solidjs/meta": "^0.28.5",
"@solidjs/router": "^0.8.2",
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"undici": "^5.22.1"
"solid-start": "^0.3.0"
},
"engines": {
"node": "18"
Expand Down
3 changes: 1 addition & 2 deletions examples/with-trpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/node": "^18.16.19",
"esbuild": "^0.14.54",
"postcss": "^8.4.26",
"solid-start-node": "^0.2.29",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"vite": "^4.4.6"
},
Expand All @@ -24,7 +24,6 @@
"solid-start": "^0.3.0",
"solid-start-trpc": "^0.0.16",
"solid-trpc": "0.1.0-sssr.7",
"undici": "^5.22.1",
"zod": "^3.21.4"
},
"engines": {
Expand Down
5 changes: 2 additions & 3 deletions examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
"@vitest/ui": "^0.26.3",
"jsdom": "^20.0.3",
"solid-js": "^1.7.9",
"solid-start": "^0.2.29",
"solid-start-node": "^0.2.29",
"solid-start": "^0.3.0",
"solid-start-node": "^0.3.0",
"typescript": "^4.9.5",
"undici": "^5.22.1",
"vite": "^4.4.6",
"vitest": "^0.26.3"
}
Expand Down
5 changes: 2 additions & 3 deletions examples/with-websocket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"type": "module",
"devDependencies": {
"solid-start-cloudflare-workers": "^0.2.29",
"solid-start-cloudflare-workers": "^0.3.0",
"typescript": "^4.9.5",
"vite": "^4.4.6"
},
Expand All @@ -17,8 +17,7 @@
"@solidjs/meta": "^0.28.5",
"@solidjs/router": "^0.8.2",
"solid-js": "^1.7.9",
"solid-start": "^0.3.0",
"undici": "^5.22.1"
"solid-start": "^0.3.0"
},
"engines": {
"node": ">=18"
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"tippy.js": "^6.3.7",
"turbo": "^1.10.7",
"typescript": "4.7.4",
"undici": "^5.22.1",
"vite": "^4.4.6",
"zod": "^3.21.4"
},
Expand Down
2 changes: 0 additions & 2 deletions packages/start-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
},
"devDependencies": {
"solid-start": "workspace:*",
"undici": "^5.22.1",
"vite": "^4.4.6"
},
"peerDependencies": {
"solid-start": "*",
"undici": "^5.8.0",
"vite": "*"
}
}
2 changes: 1 addition & 1 deletion packages/start-static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function () {
}),
common({ strictRequires: true, ...config.build.commonjsOptions })
],
external: ["undici", "stream/web", ...ssrExternal]
external: ["stream/web", ...ssrExternal]
});
// or write the bundle to disk
await bundle.write({ format: "esm", dir: join(config.root, "dist") });
Expand Down
2 changes: 0 additions & 2 deletions packages/start-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
"devDependencies": {
"solid-start": "workspace:*",
"terser": "^5.19.0",
"undici": "^5.22.1",
"vite": "^4.4.6"
},
"peerDependencies": {
"solid-start": "*",
"undici": "^5.8.0",
"vite": "*"
}
}
10 changes: 5 additions & 5 deletions packages/start/node/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { once } from "events";
import multipart from "parse-multipart-data";
import { splitCookiesString } from "set-cookie-parser";
import { Readable } from "stream";
import { File, FormData, Headers, Request as BaseNodeRequest } from "undici";
import { File } from "undici";

function nodeToWeb(/** @type {NodeJS.ReadStream} */ nodeStream) {
var destroyed = false;
Expand Down Expand Up @@ -70,10 +70,10 @@ function createHeaders(/** @type {object} */ requestHeaders) {
return headers;
}

export class NodeRequest extends BaseNodeRequest {
export class NodeRequest extends Request {
constructor(
/** @type {import('undici').RequestInfo} */ input,
/** @type {import('undici').RequestInit & { data: any }} */ init
input,
init
) {
if (init && init.data && init.data.on) {
init = {
Expand Down Expand Up @@ -134,7 +134,7 @@ export class NodeRequest extends BaseNodeRequest {

// @ts-ignore
clone() {
/** @type {BaseNodeRequest & { buffer?: () => Promise<Buffer>; formData?: () => Promise<FormData> }} */
/** @type {Request & { buffer?: () => Promise<Buffer>; formData?: () => Promise<FormData> }} */
let el = super.clone();
el.buffer = this.buffer.bind(el);
el.formData = this.formData.bind(el);
Expand Down
8 changes: 1 addition & 7 deletions packages/start/node/globals.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import crypto from "crypto";
import Streams from "stream/web";
import { fetch, Headers, Request, Response } from "undici";

Object.assign(globalThis, Streams, {
Request,
Response,
fetch,
Headers,
});
Object.assign(globalThis, Streams);

if (globalThis.crypto != crypto.webcrypto) {
// @ts-ignore
Expand Down
Loading

0 comments on commit 71399df

Please sign in to comment.