Files
monitoring-app/src/frontend.tsx
bipproduction 08a1054e3c Initial commit: full-stack Bun + Elysia + React template
Elysia.js API with session-based auth (email/password + Google OAuth),
role system (USER/ADMIN/SUPER_ADMIN), Prisma + PostgreSQL, React 19
with Mantine UI, TanStack Router, dark theme, and comprehensive test
suite (unit, integration, E2E with Lightpanda).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 10:12:19 +08:00

35 lines
939 B
TypeScript

import type { ReactNode } from 'react'
import { createRoot } from 'react-dom/client'
import { App } from './frontend/App'
// DevInspector hanya di-import saat dev (tree-shaken di production)
const InspectorWrapper = import.meta.env?.DEV
? (await import('./frontend/DevInspector')).DevInspector
: ({ children }: { children: ReactNode }) => <>{children}</>
// Remove splash screen after React mounts
function removeSplash() {
const splash = document.getElementById('splash')
if (splash) {
splash.classList.add('fade-out')
setTimeout(() => splash.remove(), 300)
}
}
const elem = document.getElementById('root')!
const app = (
<InspectorWrapper>
<App />
</InspectorWrapper>
)
// HMR-safe: reuse root agar React state preserved saat hot reload
if (import.meta.hot) {
import.meta.hot.data.root ??= createRoot(elem)
import.meta.hot.data.root.render(app)
} else {
createRoot(elem).render(app)
}
removeSplash()