feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
// First: fills the server module graph before anything renders.
|
|
|
|
|
import '../bootstrap/bootstrap.server';
|
|
|
|
|
import '../styles/app.css';
|
|
|
|
|
|
2026-10-05 15:00:46 +00:00
|
|
|
import { CRITICAL_FONT_URL } from '@lumina/island/constants';
|
feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
import { Element } from '@lumina/island/primitives/element';
|
|
|
|
|
import type { Metadata } from 'next';
|
2026-10-02 14:19:11 +00:00
|
|
|
import type { ReactNode } from 'react';
|
2026-10-05 15:00:46 +00:00
|
|
|
import { preload } from 'react-dom';
|
2026-10-02 14:19:11 +00:00
|
|
|
|
feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
import { rootMetadata } from '../configs';
|
|
|
|
|
import { i18n } from '../i18n';
|
|
|
|
|
import { AppProviders } from './organisms/app-providers';
|
|
|
|
|
|
|
|
|
|
export function generateMetadata(): Metadata {
|
|
|
|
|
return rootMetadata();
|
|
|
|
|
}
|
2026-10-02 14:19:11 +00:00
|
|
|
|
|
|
|
|
export default function RootLayout({ children }: { children: ReactNode }) {
|
2026-10-05 15:00:46 +00:00
|
|
|
// Only the face every page renders first; the Latin face loads where شبا is shown.
|
|
|
|
|
preload(CRITICAL_FONT_URL, {
|
|
|
|
|
as: 'font',
|
|
|
|
|
type: 'font/woff2',
|
|
|
|
|
crossOrigin: 'anonymous',
|
|
|
|
|
});
|
|
|
|
|
|
2026-10-02 14:19:11 +00:00
|
|
|
return (
|
2026-10-05 15:00:46 +00:00
|
|
|
<Element tag="html" lang={i18n.language} dir={i18n.dir()}>
|
feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
<Element tag="body">
|
|
|
|
|
<AppProviders>{children}</AppProviders>
|
|
|
|
|
</Element>
|
|
|
|
|
</Element>
|
2026-10-02 14:19:11 +00:00
|
|
|
);
|
|
|
|
|
}
|