From 09bb48935d4b1e2e3c29454ac3f703298b681267 Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Thu, 14 Mar 2024 16:48:58 -0700 Subject: [PATCH] =?UTF-8?q?[=E2=9A=A0=EF=B8=8F]=20Use=20vite=20swc=20react?= =?UTF-8?q?=20(#7845)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 73 ++++++++++++++++++++----------------- packages/web/.gitignore | 1 + packages/web/package.json | 4 +- packages/web/vite.config.ts | 7 +--- 4 files changed, 44 insertions(+), 41 deletions(-) diff --git a/package-lock.json b/package-lock.json index 367c4817dc0..aac2a1618aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19477,34 +19477,6 @@ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, - "node_modules/@redux-devtools/extension": { - "version": "3.2.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.23.2", - "immutable": "^4.3.4" - }, - "peerDependencies": { - "redux": "^3.1.0 || ^4.0.0" - } - }, - "node_modules/@redux-devtools/extension/node_modules/@babel/runtime": { - "version": "7.23.2", - "dev": true, - "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@redux-devtools/extension/node_modules/regenerator-runtime": { - "version": "0.14.0", - "dev": true, - "license": "MIT" - }, "node_modules/@redux-devtools/inspector-monitor": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@redux-devtools/inspector-monitor/-/inspector-monitor-6.0.0.tgz", @@ -41496,9 +41468,10 @@ } }, "node_modules/@swc/counter": { - "version": "0.1.2", - "dev": true, - "license": "Apache-2.0" + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "dev": true }, "node_modules/@swc/jest": { "version": "0.2.29", @@ -46465,8 +46438,9 @@ }, "node_modules/@vitejs/plugin-react-swc": { "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react-swc/-/plugin-react-swc-3.5.0.tgz", + "integrity": "sha512-1PrOvAaDpqlCV+Up8RkAh9qaiUjoDUcjtttyhXDKw53XA6Ve16SOp6cCOpRs8Dj8DqUQs6eTW5YkLcLJjrXAig==", "dev": true, - "license": "MIT", "dependencies": { "@swc/core": "^1.3.96" }, @@ -155212,7 +155186,7 @@ "@electron/notarize": "2.2.0", "@esbuild-plugins/node-globals-polyfill": "0.2.3", "@pinata/sdk": "1.1.13", - "@redux-devtools/extension": "^3.2.4", + "@redux-devtools/extension": "3.2.4", "@testing-library/react": "12.0.0", "@types/amplitude-js": "8.0.2", "@types/bn.js": "5.1.0", @@ -155238,7 +155212,7 @@ "@types/react-virtualized": "9.21.21", "@types/redux-sentry-middleware": "0.2.1", "@types/resize-observer-browser": "0.1.7", - "@vitejs/plugin-react": "4.1.0", + "@vitejs/plugin-react-swc": "3.5.0", "abort-controller": "3.0.0", "armada-cli": "0.4.0", "assert": "^2.0.0", @@ -155282,6 +155256,24 @@ "vitest": "0.34.6" } }, + "packages/web/node_modules/@babel/runtime": { + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.0.tgz", + "integrity": "sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/web/node_modules/@babel/runtime/node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true + }, "packages/web/node_modules/@cloudflare/kv-asset-handler": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.2.0.tgz", @@ -156446,6 +156438,19 @@ } } }, + "packages/web/node_modules/@redux-devtools/extension": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@redux-devtools/extension/-/extension-3.2.4.tgz", + "integrity": "sha512-fKh6zQiwbn8cd/rXmG1WQmm0YwIJifkBQ5oI0SeavldvT/wVD9OTPdBSW2NSYFjVvqCg/OiTzjrdfzxbE6neLQ==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.20.7", + "immutable": "^4.2.2" + }, + "peerDependencies": { + "redux": "^3.1.0 || ^4.0.0" + } + }, "packages/web/node_modules/@types/classnames": { "version": "2.2.10", "dev": true, diff --git a/packages/web/.gitignore b/packages/web/.gitignore index fa2b70f4695..f641c6ea719 100644 --- a/packages/web/.gitignore +++ b/packages/web/.gitignore @@ -14,6 +14,7 @@ env/.env.dev.local /coverage # build +.swc /sourcemaps /build /build-development diff --git a/packages/web/package.json b/packages/web/package.json index beb673d8283..826c4d13901 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -208,7 +208,7 @@ "@electron/notarize": "2.2.0", "@esbuild-plugins/node-globals-polyfill": "0.2.3", "@pinata/sdk": "1.1.13", - "@redux-devtools/extension": "^3.2.4", + "@redux-devtools/extension": "3.2.4", "@testing-library/react": "12.0.0", "@types/amplitude-js": "8.0.2", "@types/bn.js": "5.1.0", @@ -234,7 +234,7 @@ "@types/react-virtualized": "9.21.21", "@types/redux-sentry-middleware": "0.2.1", "@types/resize-observer-browser": "0.1.7", - "@vitejs/plugin-react": "4.1.0", + "@vitejs/plugin-react-swc": "3.5.0", "abort-controller": "3.0.0", "armada-cli": "0.4.0", "assert": "^2.0.0", diff --git a/packages/web/vite.config.ts b/packages/web/vite.config.ts index 8df2fb065ad..932640c5656 100644 --- a/packages/web/vite.config.ts +++ b/packages/web/vite.config.ts @@ -3,7 +3,7 @@ import path from 'path' import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill' -import react from '@vitejs/plugin-react' +import react from '@vitejs/plugin-react-swc' import { visualizer } from 'rollup-plugin-visualizer' import vike from 'vike/plugin' import { defineConfig, loadEnv } from 'vite' @@ -127,10 +127,7 @@ export default defineConfig(async ({ mode }) => { } }, react({ - jsxImportSource: '@emotion/react', - babel: { - plugins: ['@emotion/babel-plugin'] - } + jsxImportSource: '@emotion/react' }), ...(ssr ? [vike()] : []), ...((analyze