perf: split chunks and lazy-load Room to shrink initial bundle
manualChunks: add sentry, folds, i18n, jotai, immer Router: lazy-load Room component (used in home/direct/space routes) Sentry: wire in real DSN with browserTracingIntegration, 5% trace rate, tracePropagationTargets scoped to matrix.lotusguild.org, sendDefaultPii=false Main bundle: 2481 kB -> 1857 kB gzip 623 kB -> 450 kB (-28% initial load) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -49,7 +49,7 @@ import { RouteSpaceProvider, Space, SpaceRouteRoomProvider, SpaceSearch } from '
|
||||
|
||||
|
||||
import { setAfterLoginRedirectPath } from './afterLoginRedirectPath';
|
||||
import { Room } from '../features/room';
|
||||
const Room = React.lazy(() => import('../features/room').then(m => ({ default: m.Room })));
|
||||
|
||||
import { WelcomePage } from './client/WelcomePage';
|
||||
import { SidebarNav } from './client/SidebarNav';
|
||||
@@ -186,7 +186,9 @@ export const createRouter = (clientConfig: ClientConfig, screenSize: ScreenSize)
|
||||
path={_ROOM_PATH}
|
||||
element={
|
||||
<HomeRouteRoomProvider>
|
||||
<Room />
|
||||
<React.Suspense fallback={null}>
|
||||
<Room />
|
||||
</React.Suspense>
|
||||
</HomeRouteRoomProvider>
|
||||
}
|
||||
/>
|
||||
@@ -211,7 +213,9 @@ export const createRouter = (clientConfig: ClientConfig, screenSize: ScreenSize)
|
||||
path={_ROOM_PATH}
|
||||
element={
|
||||
<DirectRouteRoomProvider>
|
||||
<Room />
|
||||
<React.Suspense fallback={null}>
|
||||
<Room />
|
||||
</React.Suspense>
|
||||
</DirectRouteRoomProvider>
|
||||
}
|
||||
/>
|
||||
@@ -251,7 +255,9 @@ export const createRouter = (clientConfig: ClientConfig, screenSize: ScreenSize)
|
||||
path={_ROOM_PATH}
|
||||
element={
|
||||
<SpaceRouteRoomProvider>
|
||||
<Room />
|
||||
<React.Suspense fallback={null}>
|
||||
<Room />
|
||||
</React.Suspense>
|
||||
</SpaceRouteRoomProvider>
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user