From 782db11c89af03544d0bb629e9fe3065da492c71 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 17 Feb 2023 15:05:31 +0100 Subject: [PATCH] hot module replacement --- apps/remix-ide/.babelrc | 2 +- apps/remix-ide/project.json | 9 ++++++--- apps/remix-ide/src/app.js | 1 - apps/remix-ide/tsconfig.app.json | 1 - babel.config.js | 2 +- libs/remix-core-plugin/package.json | 1 - libs/remix-core-plugin/tsconfig.lib.json | 5 ----- .../home-tab/src/lib/components/homeTabTitle.tsx | 1 - libs/remix-ws-templates/package.json | 1 - libs/remixd/tsconfig.lib.json | 2 +- package.json | 3 +++ 11 files changed, 12 insertions(+), 16 deletions(-) diff --git a/apps/remix-ide/.babelrc b/apps/remix-ide/.babelrc index 9123728aa1..34aaeb3268 100644 --- a/apps/remix-ide/.babelrc +++ b/apps/remix-ide/.babelrc @@ -1,5 +1,5 @@ { - "presets": ["@babel/preset-env", ["@babel/preset-react", + "presets": ["@babel/preset-env", ["@nrwl/react/babel", {"runtime": "automatic"} ]], "plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-transform-runtime", "@babel/plugin-proposal-nullish-coalescing-operator"], diff --git a/apps/remix-ide/project.json b/apps/remix-ide/project.json index 7775e520c2..e118e366a7 100644 --- a/apps/remix-ide/project.json +++ b/apps/remix-ide/project.json @@ -48,15 +48,18 @@ "defaultConfiguration": "development", "options": { "buildTarget": "remix-ide:build", - "watch": true, - "liveReload": true, - "hmr": false + }, "configurations": { "development": { "buildTarget": "remix-ide:build:development", "port": 8080 }, + "hot":{ + "buildTarget": "remix-ide:build:development", + "port": 8080, + "hmr": true + }, "production": { "buildTarget": "remix-ide:build:production", "port": 8080 diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index d53d7ed75c..57a5140159 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -247,7 +247,6 @@ class AppComponent { const codeParser = new CodeParser(new AstWalker()) - this.notification = new NotificationPlugin() const configPlugin = new ConfigPlugin() diff --git a/apps/remix-ide/tsconfig.app.json b/apps/remix-ide/tsconfig.app.json index 499c767595..b45165141e 100644 --- a/apps/remix-ide/tsconfig.app.json +++ b/apps/remix-ide/tsconfig.app.json @@ -3,7 +3,6 @@ "compilerOptions": { "outDir": "../../dist/out-tsc", "types": ["node"], - "module": "es2020" }, "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "./src/assets/**/*"], "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] diff --git a/babel.config.js b/babel.config.js index ad32f7a9d0..16d8ca5cea 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,5 @@ module.exports = { - "presets": ["@babel/preset-typescript", "@babel/preset-env", "@babel/preset-react"], + "presets": ["@babel/preset-typescript", "@babel/preset-env", "@nrwl/react/babel"], "plugins": [ "babel-plugin-replace-ts-export-assignment", "@babel/plugin-transform-modules-commonjs", diff --git a/libs/remix-core-plugin/package.json b/libs/remix-core-plugin/package.json index 727b1981a8..3ea38618cc 100644 --- a/libs/remix-core-plugin/package.json +++ b/libs/remix-core-plugin/package.json @@ -3,7 +3,6 @@ "version": "0.0.1", "description": "This library was generated with [Nx](https://nx.dev).", "main": "src/index.js", - "type": "module", "author": "Remix Team", "license": "ISC" } diff --git a/libs/remix-core-plugin/tsconfig.lib.json b/libs/remix-core-plugin/tsconfig.lib.json index d1f4736244..87520f83f8 100644 --- a/libs/remix-core-plugin/tsconfig.lib.json +++ b/libs/remix-core-plugin/tsconfig.lib.json @@ -1,11 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs", - "outDir": "../../dist/out-tsc", - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "declaration": true, "types": ["node"] }, "exclude": [ diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx index 93808e3e00..e689c9c95d 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx @@ -52,7 +52,6 @@ function HomeTabTitle() { return (
-
Remix diff --git a/libs/remix-ws-templates/package.json b/libs/remix-ws-templates/package.json index 8f4058b563..f9a71a64dd 100644 --- a/libs/remix-ws-templates/package.json +++ b/libs/remix-ws-templates/package.json @@ -4,7 +4,6 @@ "description": "Create a Remix IDE workspace using different templates", "main": "src/index.js", "types": "src/index.d.ts", - "type": "module", "publishConfig": { "access": "public" }, diff --git a/libs/remixd/tsconfig.lib.json b/libs/remixd/tsconfig.lib.json index f367bc8051..c251b41e7e 100644 --- a/libs/remixd/tsconfig.lib.json +++ b/libs/remixd/tsconfig.lib.json @@ -1,7 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "target": "es6", + "target": "ES6", "module": "commonjs", "outDir": "../../dist/out-tsc", "declaration": true, diff --git a/package.json b/package.json index 1bb34a3c05..b3c176c823 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "nx": "nx", "start": "nx start", "serve": "nx serve remix-ide --configuration=development", + "hot": "nx serve remix-ide --configuration=hot", "build": "nx build", "test": "nx test", "lint": "nx lint", @@ -234,6 +235,7 @@ "@nrwl/web": "15.7.1", "@nrwl/webpack": "15.7.1", "@nrwl/workspace": "^15.7.1", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10", "@svgr/webpack": "^6.5.1", "@testing-library/react": "13.4.0", "@types/axios": "^0.14.0", @@ -332,6 +334,7 @@ "onchange": "^3.2.1", "os-browserify": "^0.3.0", "process": "^0.11.10", + "react-refresh": "^0.14.0", "react-test-renderer": "^17.0.2", "request": "^2.83.0", "rimraf": "^2.6.1",