separate TablePage into its own chunk

This commit is contained in:
Sidney Alcantara
2022-11-09 15:15:58 +11:00
parent 796c980337
commit 73af4d768b
2 changed files with 8 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
import { Suspense, useMemo } from "react";
import { lazy, Suspense, useMemo } from "react";
import { useAtom, Provider } from "jotai";
import { selectAtom } from "jotai/utils";
import { DebugAtoms } from "@src/atoms/utils";
@@ -10,7 +10,6 @@ import Modal from "@src/components/Modal";
import BreadcrumbsSubTable from "@src/components/Table/BreadcrumbsSubTable";
import ErrorFallback from "@src/components/ErrorFallback";
import TableSourceFirestore from "@src/sources/TableSourceFirestore";
import TablePage from "./TablePage";
import TableToolbarSkeleton from "@src/components/TableToolbar/TableToolbarSkeleton";
import TableSkeleton from "@src/components/Table/TableSkeleton";
@@ -25,6 +24,9 @@ import { ROUTES } from "@src/constants/routes";
import { TOP_BAR_HEIGHT } from "@src/layouts/Navigation/TopBar";
import { TABLE_TOOLBAR_HEIGHT } from "@src/components/TableToolbar";
// prettier-ignore
const TablePage = lazy(() => import("./TablePage" /* webpackChunkName: "TablePage" */));
/**
* Wraps `TablePage` with the data for a top-level table.
*/

View File

@@ -1,4 +1,4 @@
import { Suspense } from "react";
import { lazy, Suspense } from "react";
import { useAtom, Provider } from "jotai";
import { DebugAtoms } from "@src/atoms/utils";
import { useParams, useOutlet } from "react-router-dom";
@@ -9,7 +9,6 @@ import ErrorFallback, {
ERROR_TABLE_NOT_FOUND,
} from "@src/components/ErrorFallback";
import TableSourceFirestore from "@src/sources/TableSourceFirestore";
import TablePage from "./TablePage";
import TableToolbarSkeleton from "@src/components/TableToolbar/TableToolbarSkeleton";
import TableSkeleton from "@src/components/Table/TableSkeleton";
@@ -28,6 +27,9 @@ import {
import { SyncAtomValue } from "@src/atoms/utils";
import useDocumentTitle from "@src/hooks/useDocumentTitle";
// prettier-ignore
const TablePage = lazy(() => import("./TablePage" /* webpackChunkName: "TablePage" */));
/**
* Wraps `TablePage` with the data for a top-level table.
* `SubTablePage` is inserted in the outlet, alongside `TablePage`.