Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/app/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@testing-library/user-event": "^12.2.0",
"@types/google-protobuf": "^3.7.2",
"@types/jest": "^25.2.3",
"@types/loadable__component": "^5.13.1",
"@types/react": "^16.9.35",
"@types/react-dom": "^16.9.8",
"@types/react-redux": "^7.1.9",
Expand Down Expand Up @@ -64,6 +65,7 @@
},
"dependencies": {
"@date-io/dayjs": "^1.3.13",
"@loadable/component": "^5.14.1",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
Expand Down
37 changes: 33 additions & 4 deletions pkg/app/web/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { EntityId } from "@reduxjs/toolkit";
import React, { FC, memo, useEffect } from "react";
import loadable from "@loadable/component";
import { useDispatch, useSelector } from "react-redux";
import { Route, Switch, Redirect } from "react-router-dom";
import { Header } from "../components/header";
Expand All @@ -21,13 +22,41 @@ import { fetchEnvironments } from "../modules/environments";
import { useMe } from "../modules/me";
import { fetchPipeds } from "../modules/pipeds";
import { useInterval } from "../hooks/use-interval";
import { ApplicationDetailPage } from "./applications/detail";
import { ApplicationIndexPage } from "./applications/index";
import { DeploymentDetailPage } from "./deployments/detail";
import { DeploymentIndexPage } from "./deployments/index";
import { InsightIndexPage } from "./insight";
import { LoginPage } from "./login";
import { SettingsIndexPage } from "./settings";

const SettingsIndexPage = loadable(
() => import(/* webpackChunkName: "settings" */ "./settings"),
{
resolveComponent: (components) => components.SettingsIndexPage,
}
);

const InsightIndexPage = loadable(
() => import(/* webpackChunkName: "insight" */ "./insight"),
{
resolveComponent: (components) => components.InsightIndexPage,
}
);

const DeploymentDetailPage = loadable(
() =>
import(/* webpackChunkName: "deployments-detail" */ "./deployments/detail"),
{
resolveComponent: (components) => components.DeploymentDetailPage,
}
);

const ApplicationDetailPage = loadable(
() =>
import(
/* webpackChunkName: "applications-detail" */ "./applications/detail"
),
{
resolveComponent: (components) => components.ApplicationDetailPage,
}
);

// Fetch commands detail periodically
const FETCH_COMMANDS_INTERVAL = 3000;
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"allowUnreachableCode": false,
"baseUrl": ".",
"module": "CommonJS",
"module": "esnext",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits, is it safe to use esnext over a specific version of js 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khanhtc1202 Yes, it's safe because we use webpack after compiling with typescript.
If it is broken, the webpack build should fail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, thanks for your explaining 🙆‍♀️

"moduleResolution": "node",
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
Expand Down
20 changes: 18 additions & 2 deletions pkg/app/web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,7 @@
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.6.0":
"@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.6.0", "@babel/runtime@^7.7.7":
version "7.12.5"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e"
integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==
Expand Down Expand Up @@ -2409,6 +2409,15 @@
"@types/yargs" "^15.0.0"
chalk "^4.0.0"

"@loadable/component@^5.14.1":
version "5.14.1"
resolved "https://registry.yarnpkg.com/@loadable/component/-/component-5.14.1.tgz#cacd807162430bb85ae085945318027a600adc85"
integrity sha512-UQBZfZrp1FLTf8RNhljXNHFNY4QhAA1L2+GOEeABBFre9TD0aFyQh3Sai5QxcOfy+FTbjIfti5iHaNRR7yUzEQ==
dependencies:
"@babel/runtime" "^7.7.7"
hoist-non-react-statics "^3.3.1"
react-is "^16.12.0"

"@material-ui/core@^4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@material-ui/core/-/core-4.11.0.tgz#b69b26e4553c9e53f2bfaf1053e216a0af9be15a"
Expand Down Expand Up @@ -3643,6 +3652,13 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0"
integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==

"@types/loadable__component@^5.13.1":
version "5.13.1"
resolved "https://registry.yarnpkg.com/@types/loadable__component/-/loadable__component-5.13.1.tgz#97c24081676a194b29722ff6e3c24a3676984f2e"
integrity sha512-Zb/Qkw3BnlRoFkL6FJwDvhFhOfeotXRCWd7dHdjVLusHZ3dZjKNi3ERngYBt3tffk2NF4roGVKA/oZMA1KdbCg==
dependencies:
"@types/react" "*"

"@types/long@^4.0.0":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9"
Expand Down Expand Up @@ -9000,7 +9016,7 @@ hmac-drbg@^1.0.0:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1"

hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2:
hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
Expand Down