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

1592
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -63,6 +63,7 @@
"happy-dom": "7.7.2",
"nano-staged": "0.8.0",
"playwright": "1.27.1",
"rollup-plugin-visualizer": "^5.8.3",
"sass": "^1.56.1",
"simple-git-hooks": "2.8.1",
"stylelint": "^14.16.0",
@ -78,6 +79,10 @@
"vitest": "0.25.3"
},
"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/dates": "^5.9.2",
"@mantine/dropzone": "^5.9.2",
@ -89,8 +94,6 @@
"@tanstack/react-query": "^4.19.1",
"@tanstack/react-query-devtools": "^4.19.1",
"@vitejs/plugin-react": "^2.2.0",
"ag-grid-community": "^28.2.1",
"ag-grid-react": "^28.2.1",
"electron-localshortcut": "^3.2.1",
"electron-store": "^8.1.0",
"electron-updater": "5.3.0",

View File

@ -1,4 +1,6 @@
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 { ModalsProvider } from '@mantine/modals';
import { NotificationsProvider } from '@mantine/notifications';
@ -10,7 +12,9 @@ import { queryClient } from './lib/react-query';
import { AppRouter } from './router/app-router';
import { useSettingsStore } from './store/settings.store';
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);

View File

@ -1,5 +1,5 @@
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 { Link } from 'react-router-dom';
import type { AlbumArtist, Artist } from '/@/api/types';

View File

@ -1,5 +1,5 @@
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 { Link } from 'react-router-dom';
import type { AlbumArtist, Artist } from '/@/api/types';

View File

@ -1,5 +1,5 @@
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 { generatePath } from 'react-router';
import { Link } from 'react-router-dom';

View File

@ -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 styled from 'styled-components';
import { Text } from '/@/components/text';

View File

@ -1,5 +1,5 @@
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 type { AlbumArtist, Artist } from '/@/api/types';
import { Text } from '/@/components/text';

View File

@ -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';
export interface ICustomHeaderParams extends IHeaderParams {

View File

@ -1,5 +1,5 @@
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 { FiClock } from 'react-icons/fi';
import styled from 'styled-components';

View File

@ -7,10 +7,10 @@ import type {
IHeaderParams,
ValueFormatterParams,
ColDef,
} from 'ag-grid-community';
import type { AgGridReactProps } from 'ag-grid-react';
import { AgGridReact } from 'ag-grid-react';
import type { AgGridReact as AgGridReactType } from 'ag-grid-react/lib/agGridReact';
} from '@ag-grid-community/core';
import type { AgGridReactProps } from '@ag-grid-community/react';
import { AgGridReact } from '@ag-grid-community/react';
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
import formatDuration from 'format-duration';
import { generatePath } from 'react-router';
import styled from 'styled-components';

View File

@ -4,8 +4,8 @@ import type {
ColDef,
RowClassRules,
RowDragEvent,
} from 'ag-grid-community';
import 'ag-grid-community/styles/ag-theme-alpine.css';
} from '@ag-grid-community/core';
import '@ag-grid-community/styles/ag-theme-alpine.css';
import {
VirtualGridAutoSizerContainer,
VirtualGridContainer,