diff --git a/package.json b/package.json index b1e47da5..01cc18eb 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "@types/react": "16.8.22", "@types/react-color": "^3.0.1", "@types/react-dom": "^16.8.4", - "@types/react-hot-loader": "^4.1.0", "@types/react-measure": "^2.0.5", "@types/react-outside-click-handler": "^1.2.0", "@types/react-router": "^5.0.2", @@ -76,7 +75,6 @@ "@types/throttle-debounce": "^1.1.1", "@types/webpack": "^4.4.33", "@types/webpack-dev-middleware": "^2.0.2", - "@types/webpack-hot-middleware": "^2.16.5", "@types/xxhashjs": "^0.2.1", "babel-loader": "^8.0.6", "caniuse-lite": "^1.0.30000983", @@ -99,7 +97,6 @@ "postcss-reporter": "6.0.1", "postcss-url": "^8.0.0", "raw-loader": "^3.0.0", - "react-hot-loader": "4.11.1", "react-svg-loader": "2.1.0", "rimraf": "^2.6.3", "seedrandom": "^3.0.1", @@ -115,8 +112,7 @@ "webpack": "^4.35.0", "webpack-cli": "^3.3.5", "webpack-dev-middleware": "^3.7.0", - "webpack-dev-server": "^3.7.2", - "webpack-hot-middleware": "^2.25.0" + "webpack-dev-server": "^3.7.2" }, "dependencies": { "binary": "^0.3.0", diff --git a/src/client/components/app/install.tsx b/src/client/components/app/install.tsx deleted file mode 100644 index 608bf791..00000000 --- a/src/client/components/app/install.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { NavigationConfiguration } from '../../navigation' -import { NUsightNetwork } from '../../network/nusight_network' -import { installChart } from '../chart/install' -import { installDashboard } from '../dashboard/install' -import { installLocalisation } from '../localisation/install' -import { withRobotSelectorMenuBar } from '../menu_bar/view' -import { installVision } from '../vision/install' -import { installVisualMesh } from '../visual_mesh/install' - -import { AppController } from './controller' -import { AppModel } from './model' -import { AppNetwork } from './network' - -export function installNav() { - const nav = NavigationConfiguration.of() - const appModel = AppModel.of() - const nusightNetwork = NUsightNetwork.of(appModel) - nusightNetwork.connect({ name: 'nusight' }) - - const appController = AppController.of() - AppNetwork.of(nusightNetwork, appModel) - const menu = withRobotSelectorMenuBar(appModel.robots, appController.toggleRobotEnabled) - - installDashboard({ nav, appModel, nusightNetwork, menu }) - installLocalisation({ nav, appModel, nusightNetwork, menu }) - installChart({ nav, appModel, nusightNetwork, menu }) - installVision({ nav, appModel, nusightNetwork, Menu: menu }) - installVisualMesh({ nav, appModel, nusightNetwork, Menu: menu }) - - return nav -} diff --git a/src/client/components/app/view.tsx b/src/client/components/app/view.tsx index eee679ed..8d107f3f 100644 --- a/src/client/components/app/view.tsx +++ b/src/client/components/app/view.tsx @@ -1,6 +1,5 @@ import { Component } from 'react' import React from 'react' -import { hot } from 'react-hot-loader' import { Switch } from 'react-router' import { Route } from 'react-router' import { BrowserRouter } from 'react-router-dom' @@ -8,21 +7,18 @@ import { BrowserRouter } from 'react-router-dom' import { NavigationConfiguration } from '../../navigation' import { NavigationView } from '../navigation/view' -import { installNav } from './install' import style from './style.css' -class AppView extends Component { - private readonly nav: NavigationConfiguration = installNav() - +export class AppView extends Component<{ nav: NavigationConfiguration }> { render() { return (
- +
- {...this.nav.getRoutes().map(config => , document.getElementById('root')) +ReactDOM.render(, document.getElementById('root')) diff --git a/src/server/dev.ts b/src/server/dev.ts index 3e5117a4..fd6cdf24 100644 --- a/src/server/dev.ts +++ b/src/server/dev.ts @@ -7,7 +7,6 @@ import favicon from 'serve-favicon' import sio from 'socket.io' import webpack from 'webpack' import webpackDevMiddleware from 'webpack-dev-middleware' -import webpackHotMiddleware from 'webpack-hot-middleware' import webpackConfig from '../../webpack.config' import * as NUClearNetProxyParser from '../shared/nuclearnet/nuclearnet_proxy_parser' @@ -52,7 +51,6 @@ app.use(compression()) app.use(devMiddleware) app.use(history()) app.use(devMiddleware) -app.use(webpackHotMiddleware(compiler)) app.use(favicon(`${__dirname}/../assets/favicon.ico`)) const port = process.env.PORT || 3000 diff --git a/webpack.config.ts b/webpack.config.ts index 9b50c1bc..224217e9 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -15,10 +15,7 @@ const config: webpack.Configuration = { context: sourcePath, devtool: isContinuousIntegration ? false : isProduction ? 'source-map' : 'eval-source-map', entry: { - main: [ - './client/main.tsx', - ...(isProduction ? [] : ['webpack-hot-middleware/client?reload=true']), - ], + main: './client/main.tsx', }, output: { path: outPath, @@ -146,7 +143,6 @@ const config: webpack.Configuration = { filename: 'index.html', chunks: ['main'], }), - ...(isProduction ? [] : [new webpack.HotModuleReplacementPlugin()]), ] as any as webpack.Plugin[], node: { // workaround for webpack-dev-server issue