Skip to content

Commit 0ffa1f6

Browse files
authored
Merge pull request #399
chore(21125): improve code splitting and loading performance * chore(21125): add code splitting to the Data Hub extension * chore(21481): add bundle viz script * chore(21481): update performance threshold
1 parent f4d4e00 commit 0ffa1f6

File tree

4 files changed

+11
-23
lines changed

4 files changed

+11
-23
lines changed

hivemq-edge/src/frontend/.lighthouserc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const TARGET_PERFORMANCE = 0.85
1+
const TARGET_PERFORMANCE = 0.95
22
const TARGET_ACCESSIBILITY = 1
33
const TARGET_BEST_PRACTICE = 1
44
const TARGET_SEO = 1

hivemq-edge/src/frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"test": "vitest",
2424
"test:coverage": "vitest run --coverage",
2525
"test:ui": "vitest --ui",
26+
"bundle:size": "npx vite-bundle-visualizer",
2627
"preview": "vite preview"
2728
},
2829
"dependencies": {

hivemq-edge/src/frontend/src/extensions/datahub/routes.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
/* eslint-disable react-refresh/only-export-components */
2+
import { lazy } from 'react'
13
import { RouteObject } from 'react-router-dom'
24

3-
import DataHubPage from './components/DataHubPage.tsx'
4-
import PropertyPanelController from './components/controls/PropertyPanelController.tsx'
5-
import DataHubListings from '@datahub/components/pages/DataHubListings.tsx'
6-
import PolicyEditorLoader from '@datahub/components/pages/PolicyEditorLoader.tsx'
5+
const DataHubPage = lazy(() => import('@/extensions/datahub/components/DataHubPage.tsx'))
6+
const PolicyEditorLoader = lazy(() => import('@datahub/components/pages/PolicyEditorLoader.tsx'))
7+
const DataHubListings = lazy(() => import('@datahub/components/pages/DataHubListings.tsx'))
8+
const PropertyPanelController = lazy(() => import('@datahub/components/controls/PropertyPanelController.tsx'))
79

810
export const dataHubRoutes: RouteObject = {
911
path: 'datahub/',

hivemq-edge/src/frontend/src/modules/App/routes.tsx

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
import { lazy } from 'react'
33
import { createBrowserRouter } from 'react-router-dom'
44

5-
import WelcomePage from '@/modules/Welcome/WelcomePage.tsx'
65
import LoginPage from '@/modules/Login/LoginPage.tsx'
6+
import Dashboard from '@/modules/Dashboard/Dashboard.tsx'
7+
import ErrorPage from '@/modules/App/components/ErrorPage.tsx'
78

9+
const WelcomePage = lazy(() => import('@/modules/Welcome/WelcomePage.tsx'))
810
const BridgePage = lazy(() => import('@/modules/Bridges/BridgePage.tsx'))
911
const BridgeEditor = lazy(() => import('@/modules/Bridges/components/panels/BridgeEditor.tsx'))
1012
const ProtocolAdapterPage = lazy(() => import('@/modules/ProtocolAdapters/ProtocolAdapterPage.tsx'))
@@ -15,14 +17,8 @@ const EdgeFlowPage = lazy(() => import('@/modules/Workspace/EdgeFlowPage.tsx'))
1517
const NodePanelController = lazy(() => import('@/modules/Workspace/components/controls/NodePanelController.tsx'))
1618
const EvenLogPage = lazy(() => import('@/modules/EventLog/EvenLogPage.tsx'))
1719

18-
// const DataHubPage = lazy(() => import('@/extensions/datahub/components/DataHubPage.tsx'))
19-
// const PolicyTable = lazy(() => import('@/extensions/datahub/components/PolicyTable.tsx'))
20-
2120
import { dataHubRoutes } from '@/extensions/datahub/routes.tsx'
2221

23-
import Dashboard from '../Dashboard/Dashboard.tsx'
24-
import ErrorPage from './components/ErrorPage.tsx'
25-
2622
export const routes = createBrowserRouter(
2723
[
2824
{
@@ -89,17 +85,6 @@ export const routes = createBrowserRouter(
8985
],
9086
},
9187
{ ...dataHubRoutes },
92-
// {
93-
// path: 'datahub/',
94-
// element: <DataHubPage />,
95-
// children: [
96-
// {
97-
// path: '',
98-
// index: true,
99-
// element: <PolicyTable />,
100-
// },
101-
// ],
102-
// },
10388
],
10489
},
10590
{

0 commit comments

Comments
 (0)