fix: code splitting, route errors, Sentry CI source maps
- Lazy-import CreateRoomForm/CreateSpaceForm in CreateRoom.tsx and Create.tsx so create-room and create-space get their own chunks; eliminates INEFFECTIVE_DYNAMIC_IMPORT warnings - Add RouteError component wired to root route errorElement so crashes show a reload button instead of React Router dev screen - ci.yml: use secrets.SENTRY_AUTH_TOKEN so source maps upload on CI builds Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,9 +7,12 @@ import {
|
||||
PageHero,
|
||||
PageHeroSection,
|
||||
} from '../../../components/page';
|
||||
import { CreateSpaceForm } from '../../../features/create-space';
|
||||
import { useRoomNavigate } from '../../../hooks/useRoomNavigate';
|
||||
|
||||
const CreateSpaceForm = React.lazy(() =>
|
||||
import('../../../features/create-space').then((m) => ({ default: m.CreateSpaceForm })),
|
||||
);
|
||||
|
||||
export function Create() {
|
||||
const { navigateSpace } = useRoomNavigate();
|
||||
|
||||
@@ -26,7 +29,9 @@ export function Create() {
|
||||
title="Create Space"
|
||||
subTitle="Build a space for your community."
|
||||
/>
|
||||
<CreateSpaceForm onCreate={navigateSpace} />
|
||||
<React.Suspense fallback={null}>
|
||||
<CreateSpaceForm onCreate={navigateSpace} />
|
||||
</React.Suspense>
|
||||
</Box>
|
||||
</PageHeroSection>
|
||||
</PageContentCenter>
|
||||
|
||||
@@ -10,9 +10,12 @@ import {
|
||||
} from '../../../components/page';
|
||||
import { ScreenSize, useScreenSizeContext } from '../../../hooks/useScreenSize';
|
||||
import { BackRouteHandler } from '../../../components/BackRouteHandler';
|
||||
import { CreateRoomForm } from '../../../features/create-room';
|
||||
import { useRoomNavigate } from '../../../hooks/useRoomNavigate';
|
||||
|
||||
const CreateRoomForm = React.lazy(() =>
|
||||
import('../../../features/create-room').then((m) => ({ default: m.CreateRoomForm })),
|
||||
);
|
||||
|
||||
export function HomeCreateRoom() {
|
||||
const screenSize = useScreenSizeContext();
|
||||
|
||||
@@ -44,7 +47,9 @@ export function HomeCreateRoom() {
|
||||
title="Create Room"
|
||||
subTitle="Build a Room for Real-Time Conversations."
|
||||
/>
|
||||
<CreateRoomForm onCreate={navigateRoom} />
|
||||
<React.Suspense fallback={null}>
|
||||
<CreateRoomForm onCreate={navigateRoom} />
|
||||
</React.Suspense>
|
||||
</Box>
|
||||
</PageHeroSection>
|
||||
</PageContentCenter>
|
||||
|
||||
Reference in New Issue
Block a user