Code split ag-grid

This commit is contained in:
jeffvli
2022-12-09 19:00:09 -08:00
parent 2711fafb06
commit 71a591792a
12 changed files with 1380 additions and 251 deletions
+1357 -235
View File
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -63,6 +63,7 @@
"happy-dom": "7.7.2", "happy-dom": "7.7.2",
"nano-staged": "0.8.0", "nano-staged": "0.8.0",
"playwright": "1.27.1", "playwright": "1.27.1",
"rollup-plugin-visualizer": "^5.8.3",
"sass": "^1.56.1", "sass": "^1.56.1",
"simple-git-hooks": "2.8.1", "simple-git-hooks": "2.8.1",
"stylelint": "^14.16.0", "stylelint": "^14.16.0",
@@ -78,6 +79,10 @@
"vitest": "0.25.3" "vitest": "0.25.3"
}, },
"dependencies": { "dependencies": {
"@ag-grid-community/client-side-row-model": "^28.2.1",
"@ag-grid-community/core": "^28.2.1",
"@ag-grid-community/react": "^28.2.1",
"@ag-grid-community/styles": "^28.2.1",
"@mantine/core": "^5.9.2", "@mantine/core": "^5.9.2",
"@mantine/dates": "^5.9.2", "@mantine/dates": "^5.9.2",
"@mantine/dropzone": "^5.9.2", "@mantine/dropzone": "^5.9.2",
@@ -89,8 +94,6 @@
"@tanstack/react-query": "^4.19.1", "@tanstack/react-query": "^4.19.1",
"@tanstack/react-query-devtools": "^4.19.1", "@tanstack/react-query-devtools": "^4.19.1",
"@vitejs/plugin-react": "^2.2.0", "@vitejs/plugin-react": "^2.2.0",
"ag-grid-community": "^28.2.1",
"ag-grid-react": "^28.2.1",
"electron-localshortcut": "^3.2.1", "electron-localshortcut": "^3.2.1",
"electron-store": "^8.1.0", "electron-store": "^8.1.0",
"electron-updater": "5.3.0", "electron-updater": "5.3.0",
+5 -1
View File
@@ -1,4 +1,6 @@
import { useEffect } from 'react'; import { useEffect } from 'react';
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
import { ModuleRegistry } from '@ag-grid-community/core';
import { MantineProvider } from '@mantine/core'; import { MantineProvider } from '@mantine/core';
import { ModalsProvider } from '@mantine/modals'; import { ModalsProvider } from '@mantine/modals';
import { NotificationsProvider } from '@mantine/notifications'; import { NotificationsProvider } from '@mantine/notifications';
@@ -10,7 +12,9 @@ import { queryClient } from './lib/react-query';
import { AppRouter } from './router/app-router'; import { AppRouter } from './router/app-router';
import { useSettingsStore } from './store/settings.store'; import { useSettingsStore } from './store/settings.store';
import './styles/global.scss'; import './styles/global.scss';
import 'ag-grid-community/styles/ag-grid.css'; import '@ag-grid-community/styles/ag-grid.css';
ModuleRegistry.registerModules([ClientSideRowModelModule]);
initSimpleImg({ threshold: 0.05 }, true); initSimpleImg({ threshold: 0.05 }, true);
@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import type { ICellRendererParams } from 'ag-grid-community'; import type { ICellRendererParams } from '@ag-grid-community/core';
import { generatePath } from 'react-router'; import { generatePath } from 'react-router';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import type { AlbumArtist, Artist } from '/@/api/types'; import type { AlbumArtist, Artist } from '/@/api/types';
@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import type { ICellRendererParams } from 'ag-grid-community'; import type { ICellRendererParams } from '@ag-grid-community/core';
import { generatePath } from 'react-router'; import { generatePath } from 'react-router';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import type { AlbumArtist, Artist } from '/@/api/types'; import type { AlbumArtist, Artist } from '/@/api/types';
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import type { ICellRendererParams } from 'ag-grid-community'; import type { ICellRendererParams } from '@ag-grid-community/core';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { generatePath } from 'react-router'; import { generatePath } from 'react-router';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
@@ -1,4 +1,4 @@
import type { ICellRendererParams } from 'ag-grid-community'; import type { ICellRendererParams } from '@ag-grid-community/core';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import styled from 'styled-components'; import styled from 'styled-components';
import { Text } from '/@/components/text'; import { Text } from '/@/components/text';
@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import type { ICellRendererParams } from 'ag-grid-community'; import type { ICellRendererParams } from '@ag-grid-community/core';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import type { AlbumArtist, Artist } from '/@/api/types'; import type { AlbumArtist, Artist } from '/@/api/types';
import { Text } from '/@/components/text'; import { Text } from '/@/components/text';
@@ -1,4 +1,4 @@
import type { IHeaderParams } from 'ag-grid-community'; import type { IHeaderParams } from '@ag-grid-community/core';
import { FiClock } from 'react-icons/fi'; import { FiClock } from 'react-icons/fi';
export interface ICustomHeaderParams extends IHeaderParams { export interface ICustomHeaderParams extends IHeaderParams {
@@ -1,5 +1,5 @@
import type { ReactNode } from 'react'; import type { ReactNode } from 'react';
import type { IHeaderParams } from 'ag-grid-community'; import type { IHeaderParams } from '@ag-grid-community/core';
import { AiOutlineNumber } from 'react-icons/ai'; import { AiOutlineNumber } from 'react-icons/ai';
import { FiClock } from 'react-icons/fi'; import { FiClock } from 'react-icons/fi';
import styled from 'styled-components'; import styled from 'styled-components';
@@ -7,10 +7,10 @@ import type {
IHeaderParams, IHeaderParams,
ValueFormatterParams, ValueFormatterParams,
ColDef, ColDef,
} from 'ag-grid-community'; } from '@ag-grid-community/core';
import type { AgGridReactProps } from 'ag-grid-react'; import type { AgGridReactProps } from '@ag-grid-community/react';
import { AgGridReact } from 'ag-grid-react'; import { AgGridReact } from '@ag-grid-community/react';
import type { AgGridReact as AgGridReactType } from 'ag-grid-react/lib/agGridReact'; import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
import formatDuration from 'format-duration'; import formatDuration from 'format-duration';
import { generatePath } from 'react-router'; import { generatePath } from 'react-router';
import styled from 'styled-components'; import styled from 'styled-components';
@@ -4,8 +4,8 @@ import type {
ColDef, ColDef,
RowClassRules, RowClassRules,
RowDragEvent, RowDragEvent,
} from 'ag-grid-community'; } from '@ag-grid-community/core';
import 'ag-grid-community/styles/ag-theme-alpine.css'; import '@ag-grid-community/styles/ag-theme-alpine.css';
import { import {
VirtualGridAutoSizerContainer, VirtualGridAutoSizerContainer,
VirtualGridContainer, VirtualGridContainer,