Skip to content

Commit

Permalink
Use native node fetch (#1875)
Browse files Browse the repository at this point in the history
Ref #1191

- dropped undici (installed one)
- dropped isomorphic-fetch
- dropped node-fetch
  • Loading branch information
TrySound authored Jun 29, 2023
1 parent 5be5abf commit 06a311c
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 49 deletions.
1 change: 0 additions & 1 deletion packages/css-data/bin/property-value-descriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import * as fs from "node:fs";
import * as path from "node:path";
import type { CreateChatCompletionResponse } from "openai";
import { fetch } from "undici";
import { keywordValues } from "../src/__generated__/keyword-values";

const propertiesPrompt = fs.readFileSync(
Expand Down
1 change: 0 additions & 1 deletion packages/css-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"css-tree": "^2.3.1",
"hyphenate-style-name": "^1.0.4",
"openai": "^3.2.1",
"undici": "^5.22.1",
"warn-once": "^0.1.1"
}
}
4 changes: 0 additions & 4 deletions packages/http-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
},
"devDependencies": {
"@jest/globals": "^29.3.1",
"@types/isomorphic-fetch": "^0.0.36",
"@webstudio-is/jest-config": "workspace:^",
"@webstudio-is/prisma-client": "workspace:^",
"@webstudio-is/react-sdk": "workspace:^",
Expand All @@ -24,9 +23,6 @@
"jest": "^29.3.1",
"typescript": "5.1.3"
},
"dependencies": {
"isomorphic-fetch": "^3.0.0"
},
"exports": {
"source": "./src/index.ts",
"types": "./lib/types/index.d.ts",
Expand Down
1 change: 0 additions & 1 deletion packages/http-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import fetch from "isomorphic-fetch";
import type { Data } from "@webstudio-is/react-sdk";

export const loadProject = async ({
Expand Down
1 change: 0 additions & 1 deletion packages/trpc-interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@trpc/client": "^10.9.0",
"@trpc/server": "^10.9.0",
"@webstudio-is/prisma-client": "workspace:^",
"node-fetch": "2",
"ts-custom-error": "^3.3.1",
"uuid": "^9.0.0",
"zod": "^3.21.4"
Expand Down
4 changes: 0 additions & 4 deletions packages/trpc-interface/src/shared/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import fetch from "node-fetch";
import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";
import {
sharedRouter,
Expand All @@ -20,9 +19,6 @@ export const createTrpcProxyServiceClient = (
const remoteClient = createTRPCProxyClient<SharedRouter>({
links: [
httpBatchLink({
// httpBatchLink uses lib.dom.d.ts's fetch type
// which is incompatible with node fetch type.
fetch: fetch as never,
url: options.url,
headers: () => ({
Authorization: options.token,
Expand Down
39 changes: 2 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 06a311c

Please sign in to comment.