From fc7327e199490607e9ab2513641fa9a57cf8fd9a Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 2 Jun 2025 20:17:16 +0200 Subject: [PATCH 1/6] build: target ES6 Support all browsers starting at ES6/ES2015. Include polyfills for older browsers. Closes #78. --- apps/web/package.json | 1 + apps/web/src/root.tsx | 1 + apps/web/tsconfig.node.json | 4 ++-- apps/web/tsconfig.vite.json | 2 +- packages/typescript-config/base.json | 3 --- packages/vite-plugin-process-env/tsconfig.json | 4 ++++ pnpm-lock.yaml | 8 ++++++++ 7 files changed, 17 insertions(+), 6 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index 25f74838..bfbe138c 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -26,6 +26,7 @@ "@tanstack/react-query-persist-client": "^5.75.4", "@types/uuid": "^10.0.0", "clsx": "^2.1.1", + "core-js": "3.42.0", "dexie": "^4.0.9", "dexie-react-hooks": "^1.1.7", "graphql": "^16.11.0", diff --git a/apps/web/src/root.tsx b/apps/web/src/root.tsx index bef40dd3..f39815e0 100644 --- a/apps/web/src/root.tsx +++ b/apps/web/src/root.tsx @@ -11,6 +11,7 @@ import { createQueryClient, createIDBPersister } from "./lib/react-query"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import { BlueprintProvider } from "@blueprintjs/core"; import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client"; +import "core-js/actual/array"; // Polyfill import type { Route } from "./+types/root"; import "normalize.css/normalize.css"; import "@blueprintjs/core/lib/css/blueprint.css"; diff --git a/apps/web/tsconfig.node.json b/apps/web/tsconfig.node.json index f57c3430..1f7b17ff 100644 --- a/apps/web/tsconfig.node.json +++ b/apps/web/tsconfig.node.json @@ -12,8 +12,8 @@ "compilerOptions": { "composite": true, "types": ["node"], - "target": "ES2022", - "module": "ES2022", + "target": "es2015", + "module": "esnext", "moduleResolution": "bundler", "noEmit": true, } diff --git a/apps/web/tsconfig.vite.json b/apps/web/tsconfig.vite.json index d948211b..045352b8 100644 --- a/apps/web/tsconfig.vite.json +++ b/apps/web/tsconfig.vite.json @@ -15,7 +15,7 @@ "types": ["@testing-library/jest-dom", "vite/client"], "rootDirs": [".", "./.react-router/types"], "target": "es2015", - "lib": ["es2023", "DOM", "WebWorker"], + "lib": ["ES2015", "ES2023.Array", "DOM", "WebWorker"], "useDefineForClassFields": true, "module": "ESNext", "sourceMap": true, diff --git a/packages/typescript-config/base.json b/packages/typescript-config/base.json index 0bc063ae..1dc9de6f 100644 --- a/packages/typescript-config/base.json +++ b/packages/typescript-config/base.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig", "display": "Default", "compilerOptions": { - "lib": ["es2023"], - "target": "es2015", "composite": false, "declaration": true, "declarationMap": true, @@ -11,7 +9,6 @@ "forceConsistentCasingInFileNames": true, "inlineSources": false, "isolatedModules": true, - "module": "NodeNext", "moduleResolution": "NodeNext", "noUnusedLocals": false, "noUnusedParameters": false, diff --git a/packages/vite-plugin-process-env/tsconfig.json b/packages/vite-plugin-process-env/tsconfig.json index 23d17c9c..fe0675f3 100644 --- a/packages/vite-plugin-process-env/tsconfig.json +++ b/packages/vite-plugin-process-env/tsconfig.json @@ -3,4 +3,8 @@ "extends": "@repo/typescript-config/base.json", "include": ["src", "tests"], "exclude": ["node_modules"], + "compilerOptions": { + "target": "esnext", + "module": "nodenext", + } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5508c656..10adfb42 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -170,6 +170,9 @@ importers: clsx: specifier: ^2.1.1 version: 2.1.1 + core-js: + specifier: 3.42.0 + version: 3.42.0 dexie: specifier: ^4.0.9 version: 4.0.9 @@ -3650,6 +3653,9 @@ packages: copy-anything@2.0.6: resolution: {integrity: sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==} + core-js@3.42.0: + resolution: {integrity: sha512-Sz4PP4ZA+Rq4II21qkNqOEDTDrCvcANId3xpIgB34NDkWc3UduWj2dqEtN9yZIq8Dk3HyPI33x9sqqU5C8sr0g==} + cors@2.8.5: resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} engines: {node: '>= 0.10'} @@ -11471,6 +11477,8 @@ snapshots: dependencies: is-what: 3.14.1 + core-js@3.42.0: {} + cors@2.8.5: dependencies: object-assign: 4.1.1 From 8d189c3cb841f6594745e8eaa78c8a26fec0e983 Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 2 Jun 2025 20:19:34 +0200 Subject: [PATCH 2/6] minor --- apps/web/tsconfig.node.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/tsconfig.node.json b/apps/web/tsconfig.node.json index 1f7b17ff..7ad7de9c 100644 --- a/apps/web/tsconfig.node.json +++ b/apps/web/tsconfig.node.json @@ -12,7 +12,7 @@ "compilerOptions": { "composite": true, "types": ["node"], - "target": "es2015", + "target": "esnext", "module": "esnext", "moduleResolution": "bundler", "noEmit": true, From 4031e36b35b3330147a84256421eae76ad103d4d Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 2 Jun 2025 20:21:59 +0200 Subject: [PATCH 3/6] minor --- apps/web/tsconfig.node.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/tsconfig.node.json b/apps/web/tsconfig.node.json index 7ad7de9c..461d6b45 100644 --- a/apps/web/tsconfig.node.json +++ b/apps/web/tsconfig.node.json @@ -13,7 +13,7 @@ "composite": true, "types": ["node"], "target": "esnext", - "module": "esnext", + "module": "nodenext", "moduleResolution": "bundler", "noEmit": true, } From 68343cefdd1e51e665ddd5997d6e974a3f48b0b4 Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 2 Jun 2025 20:22:45 +0200 Subject: [PATCH 4/6] comment --- apps/web/src/root.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/root.tsx b/apps/web/src/root.tsx index f39815e0..56655598 100644 --- a/apps/web/src/root.tsx +++ b/apps/web/src/root.tsx @@ -11,7 +11,7 @@ import { createQueryClient, createIDBPersister } from "./lib/react-query"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import { BlueprintProvider } from "@blueprintjs/core"; import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client"; -import "core-js/actual/array"; // Polyfill +import "core-js/actual/array"; // Polyfill for ES2023.Array import type { Route } from "./+types/root"; import "normalize.css/normalize.css"; import "@blueprintjs/core/lib/css/blueprint.css"; From c4e580ed57cc810cf3c34fe54e49c72de2a02771 Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 2 Jun 2025 20:25:24 +0200 Subject: [PATCH 5/6] fix --- apps/web/tsconfig.node.json | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/tsconfig.node.json b/apps/web/tsconfig.node.json index 461d6b45..09760d91 100644 --- a/apps/web/tsconfig.node.json +++ b/apps/web/tsconfig.node.json @@ -14,7 +14,6 @@ "types": ["node"], "target": "esnext", "module": "nodenext", - "moduleResolution": "bundler", "noEmit": true, } } \ No newline at end of file From 5fe06cd73a954ca7dbb65327888b0e3248baa147 Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 2 Jun 2025 20:26:51 +0200 Subject: [PATCH 6/6] simplify --- apps/web/tsconfig.node.json | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/tsconfig.node.json b/apps/web/tsconfig.node.json index 09760d91..0497970b 100644 --- a/apps/web/tsconfig.node.json +++ b/apps/web/tsconfig.node.json @@ -11,7 +11,6 @@ ], "compilerOptions": { "composite": true, - "types": ["node"], "target": "esnext", "module": "nodenext", "noEmit": true,