Skip to content

Commit 453e458

Browse files
authored
Merge branch 'main' into clarity
2 parents 4b4318b + dd8eb88 commit 453e458

25 files changed

+75
-246
lines changed

vite.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ export default defineConfig(
8888
target: 'react',
8989
generatedRouteTree: 'website/routeTree.gen.ts',
9090
routesDirectory: 'website/routes',
91-
autoCodeSplitting: true,
92-
verboseFileRoutes: false
91+
autoCodeSplitting: true
9392
}),
9493
react({
9594
exclude: ['./.cache/**/*', './node_modules/**/*', './website/routeTree.gen.ts']

website/root.tsx

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,9 @@ import './root.css';
22

33
import { StrictMode } from 'react';
44
import { createRoot } from 'react-dom/client';
5-
import {
6-
createHashHistory,
7-
createRouter,
8-
ErrorComponent,
9-
RouterProvider
10-
} from '@tanstack/react-router';
5+
import { RouterProvider } from '@tanstack/react-router';
116

12-
import { routeTree } from './routeTree.gen';
13-
14-
const router = createRouter({
15-
routeTree,
16-
history: createHashHistory(),
17-
caseSensitive: true,
18-
defaultErrorComponent: ErrorComponent,
19-
defaultNotFoundComponent: NotFound,
20-
defaultPendingMinMs: 0,
21-
defaultPreload: 'intent',
22-
defaultStructuralSharing: true,
23-
scrollRestoration: true
24-
});
25-
26-
// Register the router instance for type safety
27-
declare module '@tanstack/react-router' {
28-
interface Register {
29-
router: typeof router;
30-
}
31-
}
32-
33-
function NotFound() {
34-
return 'Nothing to see here';
35-
}
7+
import { router } from './router';
368

379
createRoot(document.getElementById('root')!).render(
3810
<StrictMode>

website/routeTree.gen.ts

Lines changed: 0 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// You should NOT make any changes in this file as it will be overwritten.
99
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
1010

11-
import type { CreateFileRoute, FileRoutesByPath } from '@tanstack/react-router'
12-
1311
import { Route as rootRouteImport } from './routes/__root'
1412
import { Route as VariableRowHeightRouteImport } from './routes/VariableRowHeight'
1513
import { Route as TreeViewRouteImport } from './routes/TreeView'
@@ -457,196 +455,6 @@ declare module '@tanstack/react-router' {
457455
}
458456
}
459457

460-
declare module './routes/index' {
461-
const createFileRoute: CreateFileRoute<
462-
'/',
463-
FileRoutesByPath['/']['parentRoute'],
464-
FileRoutesByPath['/']['id'],
465-
FileRoutesByPath['/']['path'],
466-
FileRoutesByPath['/']['fullPath']
467-
>
468-
}
469-
declare module './routes/AllFeatures' {
470-
const createFileRoute: CreateFileRoute<
471-
'/AllFeatures',
472-
FileRoutesByPath['/AllFeatures']['parentRoute'],
473-
FileRoutesByPath['/AllFeatures']['id'],
474-
FileRoutesByPath['/AllFeatures']['path'],
475-
FileRoutesByPath['/AllFeatures']['fullPath']
476-
>
477-
}
478-
declare module './routes/Animation' {
479-
const createFileRoute: CreateFileRoute<
480-
'/Animation',
481-
FileRoutesByPath['/Animation']['parentRoute'],
482-
FileRoutesByPath['/Animation']['id'],
483-
FileRoutesByPath['/Animation']['path'],
484-
FileRoutesByPath['/Animation']['fullPath']
485-
>
486-
}
487-
declare module './routes/CellNavigation' {
488-
const createFileRoute: CreateFileRoute<
489-
'/CellNavigation',
490-
FileRoutesByPath['/CellNavigation']['parentRoute'],
491-
FileRoutesByPath['/CellNavigation']['id'],
492-
FileRoutesByPath['/CellNavigation']['path'],
493-
FileRoutesByPath['/CellNavigation']['fullPath']
494-
>
495-
}
496-
declare module './routes/ColumnGrouping' {
497-
const createFileRoute: CreateFileRoute<
498-
'/ColumnGrouping',
499-
FileRoutesByPath['/ColumnGrouping']['parentRoute'],
500-
FileRoutesByPath['/ColumnGrouping']['id'],
501-
FileRoutesByPath['/ColumnGrouping']['path'],
502-
FileRoutesByPath['/ColumnGrouping']['fullPath']
503-
>
504-
}
505-
declare module './routes/ColumnSpanning' {
506-
const createFileRoute: CreateFileRoute<
507-
'/ColumnSpanning',
508-
FileRoutesByPath['/ColumnSpanning']['parentRoute'],
509-
FileRoutesByPath['/ColumnSpanning']['id'],
510-
FileRoutesByPath['/ColumnSpanning']['path'],
511-
FileRoutesByPath['/ColumnSpanning']['fullPath']
512-
>
513-
}
514-
declare module './routes/ColumnsReordering' {
515-
const createFileRoute: CreateFileRoute<
516-
'/ColumnsReordering',
517-
FileRoutesByPath['/ColumnsReordering']['parentRoute'],
518-
FileRoutesByPath['/ColumnsReordering']['id'],
519-
FileRoutesByPath['/ColumnsReordering']['path'],
520-
FileRoutesByPath['/ColumnsReordering']['fullPath']
521-
>
522-
}
523-
declare module './routes/CommonFeatures' {
524-
const createFileRoute: CreateFileRoute<
525-
'/CommonFeatures',
526-
FileRoutesByPath['/CommonFeatures']['parentRoute'],
527-
FileRoutesByPath['/CommonFeatures']['id'],
528-
FileRoutesByPath['/CommonFeatures']['path'],
529-
FileRoutesByPath['/CommonFeatures']['fullPath']
530-
>
531-
}
532-
declare module './routes/ContextMenu' {
533-
const createFileRoute: CreateFileRoute<
534-
'/ContextMenu',
535-
FileRoutesByPath['/ContextMenu']['parentRoute'],
536-
FileRoutesByPath['/ContextMenu']['id'],
537-
FileRoutesByPath['/ContextMenu']['path'],
538-
FileRoutesByPath['/ContextMenu']['fullPath']
539-
>
540-
}
541-
declare module './routes/CustomizableRenderers' {
542-
const createFileRoute: CreateFileRoute<
543-
'/CustomizableRenderers',
544-
FileRoutesByPath['/CustomizableRenderers']['parentRoute'],
545-
FileRoutesByPath['/CustomizableRenderers']['id'],
546-
FileRoutesByPath['/CustomizableRenderers']['path'],
547-
FileRoutesByPath['/CustomizableRenderers']['fullPath']
548-
>
549-
}
550-
declare module './routes/HeaderFilters' {
551-
const createFileRoute: CreateFileRoute<
552-
'/HeaderFilters',
553-
FileRoutesByPath['/HeaderFilters']['parentRoute'],
554-
FileRoutesByPath['/HeaderFilters']['id'],
555-
FileRoutesByPath['/HeaderFilters']['path'],
556-
FileRoutesByPath['/HeaderFilters']['fullPath']
557-
>
558-
}
559-
declare module './routes/InfiniteScrolling' {
560-
const createFileRoute: CreateFileRoute<
561-
'/InfiniteScrolling',
562-
FileRoutesByPath['/InfiniteScrolling']['parentRoute'],
563-
FileRoutesByPath['/InfiniteScrolling']['id'],
564-
FileRoutesByPath['/InfiniteScrolling']['path'],
565-
FileRoutesByPath['/InfiniteScrolling']['fullPath']
566-
>
567-
}
568-
declare module './routes/MasterDetail' {
569-
const createFileRoute: CreateFileRoute<
570-
'/MasterDetail',
571-
FileRoutesByPath['/MasterDetail']['parentRoute'],
572-
FileRoutesByPath['/MasterDetail']['id'],
573-
FileRoutesByPath['/MasterDetail']['path'],
574-
FileRoutesByPath['/MasterDetail']['fullPath']
575-
>
576-
}
577-
declare module './routes/MillionCells' {
578-
const createFileRoute: CreateFileRoute<
579-
'/MillionCells',
580-
FileRoutesByPath['/MillionCells']['parentRoute'],
581-
FileRoutesByPath['/MillionCells']['id'],
582-
FileRoutesByPath['/MillionCells']['path'],
583-
FileRoutesByPath['/MillionCells']['fullPath']
584-
>
585-
}
586-
declare module './routes/NoRows' {
587-
const createFileRoute: CreateFileRoute<
588-
'/NoRows',
589-
FileRoutesByPath['/NoRows']['parentRoute'],
590-
FileRoutesByPath['/NoRows']['id'],
591-
FileRoutesByPath['/NoRows']['path'],
592-
FileRoutesByPath['/NoRows']['fullPath']
593-
>
594-
}
595-
declare module './routes/ResizableGrid' {
596-
const createFileRoute: CreateFileRoute<
597-
'/ResizableGrid',
598-
FileRoutesByPath['/ResizableGrid']['parentRoute'],
599-
FileRoutesByPath['/ResizableGrid']['id'],
600-
FileRoutesByPath['/ResizableGrid']['path'],
601-
FileRoutesByPath['/ResizableGrid']['fullPath']
602-
>
603-
}
604-
declare module './routes/RowGrouping' {
605-
const createFileRoute: CreateFileRoute<
606-
'/RowGrouping',
607-
FileRoutesByPath['/RowGrouping']['parentRoute'],
608-
FileRoutesByPath['/RowGrouping']['id'],
609-
FileRoutesByPath['/RowGrouping']['path'],
610-
FileRoutesByPath['/RowGrouping']['fullPath']
611-
>
612-
}
613-
declare module './routes/RowsReordering' {
614-
const createFileRoute: CreateFileRoute<
615-
'/RowsReordering',
616-
FileRoutesByPath['/RowsReordering']['parentRoute'],
617-
FileRoutesByPath['/RowsReordering']['id'],
618-
FileRoutesByPath['/RowsReordering']['path'],
619-
FileRoutesByPath['/RowsReordering']['fullPath']
620-
>
621-
}
622-
declare module './routes/ScrollToCell' {
623-
const createFileRoute: CreateFileRoute<
624-
'/ScrollToCell',
625-
FileRoutesByPath['/ScrollToCell']['parentRoute'],
626-
FileRoutesByPath['/ScrollToCell']['id'],
627-
FileRoutesByPath['/ScrollToCell']['path'],
628-
FileRoutesByPath['/ScrollToCell']['fullPath']
629-
>
630-
}
631-
declare module './routes/TreeView' {
632-
const createFileRoute: CreateFileRoute<
633-
'/TreeView',
634-
FileRoutesByPath['/TreeView']['parentRoute'],
635-
FileRoutesByPath['/TreeView']['id'],
636-
FileRoutesByPath['/TreeView']['path'],
637-
FileRoutesByPath['/TreeView']['fullPath']
638-
>
639-
}
640-
declare module './routes/VariableRowHeight' {
641-
const createFileRoute: CreateFileRoute<
642-
'/VariableRowHeight',
643-
FileRoutesByPath['/VariableRowHeight']['parentRoute'],
644-
FileRoutesByPath['/VariableRowHeight']['id'],
645-
FileRoutesByPath['/VariableRowHeight']['path'],
646-
FileRoutesByPath['/VariableRowHeight']['fullPath']
647-
>
648-
}
649-
650458
const rootRouteChildren: RootRouteChildren = {
651459
IndexRoute: IndexRoute,
652460
AllFeaturesRoute: AllFeaturesRoute,

website/router.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { createHashHistory, createRouter, ErrorComponent } from '@tanstack/react-router';
2+
3+
import { routeTree } from './routeTree.gen';
4+
5+
export const router = createRouter({
6+
routeTree,
7+
history: createHashHistory(),
8+
caseSensitive: true,
9+
defaultErrorComponent: ErrorComponent,
10+
defaultNotFoundComponent: NotFound,
11+
defaultPendingMinMs: 0,
12+
defaultPreload: 'intent',
13+
defaultStructuralSharing: true,
14+
scrollRestoration: true
15+
});
16+
17+
// Register the router instance for type safety
18+
declare module '@tanstack/react-router' {
19+
interface Register {
20+
router: typeof router;
21+
}
22+
}
23+
24+
function NotFound() {
25+
return 'Nothing to see here';
26+
}

website/routes/AllFeatures.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState } from 'react';
22
import { faker } from '@faker-js/faker';
3+
import { createFileRoute } from '@tanstack/react-router';
34
import { css } from 'ecij';
45
import clsx from 'clsx';
56

@@ -8,7 +9,7 @@ import type { CalculatedColumn, CellCopyArgs, CellPasteArgs, Column, FillEvent }
89
import { textEditorClassname } from '../../src/editors/renderTextEditor';
910
import { useDirection } from '../directionContext';
1011

11-
export const Route = createFileRoute({
12+
export const Route = createFileRoute('/AllFeatures')({
1213
component: AllFeatures,
1314
loader() {
1415
rows ??= createRows();

website/routes/Animation.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { useState } from 'react';
2+
import { createFileRoute } from '@tanstack/react-router';
23
import { css } from 'ecij';
34

45
import { DataGrid, type Column } from '../../src';
56
import { useDirection } from '../directionContext';
67

7-
export const Route = createFileRoute({
8+
export const Route = createFileRoute('/Animation')({
89
component: Animation
910
});
1011

website/routes/CellNavigation.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { useId, useState } from 'react';
2+
import { createFileRoute } from '@tanstack/react-router';
23

34
import { DataGrid } from '../../src';
45
import type { CellKeyboardEvent, CellKeyDownArgs, Column } from '../../src';
56
import { useDirection } from '../directionContext';
67

7-
export const Route = createFileRoute({
8+
export const Route = createFileRoute('/CellNavigation')({
89
component: CellNavigation
910
});
1011

website/routes/ColumnGrouping.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import { createFileRoute } from '@tanstack/react-router';
2+
13
import { DataGrid, type ColumnOrColumnGroup } from '../../src';
24
import { renderCoordinates } from '../renderers';
35
import { useDirection } from '../directionContext';
46

5-
export const Route = createFileRoute({
7+
export const Route = createFileRoute('/ColumnGrouping')({
68
component: ColumnGrouping
79
});
810

website/routes/ColumnSpanning.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { createFileRoute } from '@tanstack/react-router';
12
import { css } from 'ecij';
23

34
import { DataGrid, type Column } from '../../src';
45
import { renderCoordinates } from '../renderers';
56
import { useDirection } from '../directionContext';
67

7-
export const Route = createFileRoute({
8+
export const Route = createFileRoute('/ColumnSpanning')({
89
component: ColumnSpanning
910
});
1011

website/routes/ColumnsReordering.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { useCallback, useMemo, useState } from 'react';
2+
import { createFileRoute } from '@tanstack/react-router';
23

34
import { DataGrid, type Column, type ColumnWidths, type SortColumn } from '../../src';
45
import { useDirection } from '../directionContext';
56

6-
export const Route = createFileRoute({
7+
export const Route = createFileRoute('/ColumnsReordering')({
78
component: ColumnsReordering
89
});
910

0 commit comments

Comments
 (0)