diff --git a/src/App.tsx b/src/App.tsx index 154b547..1e2e7fe 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,15 +1,34 @@ +console.log('[APP] ๐Ÿš€ App.tsx loading - BEGIN') +console.time('[APP] Component initialization') + import { useState, lazy, Suspense, useMemo, useEffect } from 'react' +console.log('[APP] โœ… React hooks imported') + import { Tabs, TabsContent } from '@/components/ui/tabs' +console.log('[APP] โœ… Tabs imported') + import { AppHeader, PageHeader } from '@/components/organisms' +console.log('[APP] โœ… Header components imported') + import { LoadingFallback } from '@/components/molecules' +console.log('[APP] โœ… LoadingFallback imported') + import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@/components/ui/resizable' +console.log('[APP] โœ… Resizable components imported') + import { useProjectState } from '@/hooks/use-project-state' import { useFileOperations } from '@/hooks/use-file-operations' import { useKeyboardShortcuts } from '@/hooks/use-keyboard-shortcuts' import { useSeedData } from '@/hooks/data/use-seed-data' -import { getPageConfig, getEnabledPages, getPageShortcuts, resolveProps } from '@/config/page-loader' -import { toast } from 'sonner' +console.log('[APP] โœ… Custom hooks imported') +import { getPageConfig, getEnabledPages, getPageShortcuts, resolveProps } from '@/config/page-loader' +console.log('[APP] โœ… Page config imported') + +import { toast } from 'sonner' +console.log('[APP] โœ… Toast imported') + +console.log('[APP] ๐Ÿ“ฆ Setting up lazy-loaded components') const componentMap: Record> = { ProjectDashboard: lazy(() => import('@/components/ProjectDashboard').then(m => ({ default: m.ProjectDashboard }))), CodeEditor: lazy(() => import('@/components/CodeEditor').then(m => ({ default: m.CodeEditor }))), @@ -34,6 +53,7 @@ const componentMap: Record> = { FeatureIdeaCloud: lazy(() => import('@/components/FeatureIdeaCloud').then(m => ({ default: m.FeatureIdeaCloud }))), TemplateSelector: lazy(() => import('@/components/TemplateSelector').then(m => ({ default: m.TemplateSelector }))), } +console.log('[APP] โœ… Component map created with', Object.keys(componentMap).length, 'components') const GlobalSearch = lazy(() => import('@/components/GlobalSearch').then(m => ({ default: m.GlobalSearch }))) const KeyboardShortcutsDialog = lazy(() => import('@/components/KeyboardShortcutsDialog').then(m => ({ default: m.KeyboardShortcutsDialog }))) @@ -41,9 +61,18 @@ const PreviewDialog = lazy(() => import('@/components/PreviewDialog').then(m => const PWAInstallPrompt = lazy(() => import('@/components/PWAInstallPrompt').then(m => ({ default: m.PWAInstallPrompt }))) const PWAUpdatePrompt = lazy(() => import('@/components/PWAUpdatePrompt').then(m => ({ default: m.PWAUpdatePrompt }))) const PWAStatusBar = lazy(() => import('@/components/PWAStatusBar').then(m => ({ default: m.PWAStatusBar }))) +console.log('[APP] โœ… Additional lazy components registered') + +console.log('[APP] ๐ŸŽฏ App component function executing') function App() { + console.log('[APP] ๐Ÿ”ง Initializing App component') + console.time('[APP] App render') + + console.log('[APP] ๐Ÿ“Š Initializing project state hook') const projectState = useProjectState() + console.log('[APP] โœ… Project state initialized') + const { files, models, @@ -75,10 +104,17 @@ function App() { setFeatureToggles, } = projectState + console.log('[APP] ๐Ÿ“ Initializing file operations') const fileOps = useFileOperations(files, setFiles) + console.log('[APP] โœ… File operations initialized') + const { activeFileId, setActiveFileId, handleFileChange, handleFileAdd, handleFileClose } = fileOps + + console.log('[APP] ๐ŸŒฑ Initializing seed data hook') const { loadSeedData } = useSeedData() + console.log('[APP] โœ… Seed data hook initialized') + console.log('[APP] ๐Ÿ’พ Initializing state variables') const [activeTab, setActiveTab] = useState('dashboard') const [searchOpen, setSearchOpen] = useState(false) const [shortcutsOpen, setShortcutsOpen] = useState(false) @@ -86,28 +122,63 @@ function App() { const [lastSaved] = useState(Date.now()) const [errorCount] = useState(0) const [appReady, setAppReady] = useState(false) + console.log('[APP] โœ… State variables initialized') + console.log('[APP] โฐ Setting up initialization effect') useEffect(() => { + console.log('[APP] ๐Ÿš€ Initialization effect triggered') + console.time('[APP] Seed data loading') + const timer = setTimeout(() => { + console.log('[APP] โฑ๏ธ Fallback timer triggered (100ms)') setAppReady(true) }, 100) + console.log('[APP] ๐Ÿ“ฅ Starting seed data load') loadSeedData() + .then(() => { + console.log('[APP] โœ… Seed data loaded successfully') + }) .catch(err => { - console.error('Seed data loading failed:', err) + console.error('[APP] โŒ Seed data loading failed:', err) }) .finally(() => { + console.log('[APP] ๐Ÿ Seed data loading complete') clearTimeout(timer) setAppReady(true) + console.timeEnd('[APP] Seed data loading') + console.log('[APP] โœ… App marked as ready') }) - return () => clearTimeout(timer) + return () => { + console.log('[APP] ๐Ÿงน Cleaning up initialization effect') + clearTimeout(timer) + } }, [loadSeedData]) - const pageConfig = useMemo(() => getPageConfig(), []) - const enabledPages = useMemo(() => getEnabledPages(featureToggles), [featureToggles]) - const shortcuts = useMemo(() => getPageShortcuts(featureToggles), [featureToggles]) + console.log('[APP] ๐Ÿงฎ Computing page configuration') + const pageConfig = useMemo(() => { + console.log('[APP] ๐Ÿ“„ Getting page config') + const config = getPageConfig() + console.log('[APP] โœ… Page config retrieved:', Object.keys(config).length, 'pages') + return config + }, []) + + const enabledPages = useMemo(() => { + console.log('[APP] ๐Ÿ” Filtering enabled pages') + const pages = getEnabledPages(featureToggles) + console.log('[APP] โœ… Enabled pages:', pages.map(p => p.id).join(', ')) + return pages + }, [featureToggles]) + + const shortcuts = useMemo(() => { + console.log('[APP] โŒจ๏ธ Getting keyboard shortcuts') + const s = getPageShortcuts(featureToggles) + console.log('[APP] โœ… Shortcuts configured:', s.length) + return s + }, [featureToggles]) + console.log('[APP] โŒจ๏ธ Configuring keyboard shortcuts') useKeyboardShortcuts([ ...shortcuts.map(s => ({ key: s.key, @@ -120,6 +191,7 @@ function App() { { key: '/', ctrl: true, description: 'Shortcuts', action: () => setShortcutsOpen(true) }, { key: 'p', ctrl: true, description: 'Preview', action: () => setPreviewOpen(true) }, ]) + console.log('[APP] โœ… Keyboard shortcuts configured') const getCurrentProject = () => ({ name: nextjsConfig.appName, @@ -203,20 +275,26 @@ function App() { } const renderPageContent = (page: any) => { + console.log('[APP] ๐ŸŽจ Rendering page:', page.id) try { const Component = componentMap[page.component] if (!Component) { + console.error('[APP] โŒ Component not found:', page.component) return } + console.log('[APP] โœ… Component found:', page.component) if (page.requiresResizable && page.resizableConfig) { + console.log('[APP] ๐Ÿ”€ Rendering resizable layout for:', page.id) const config = page.resizableConfig const LeftComponent = componentMap[config.leftComponent] const RightComponent = Component if (!LeftComponent) { + console.error('[APP] โŒ Left component not found:', config.leftComponent) return } + console.log('[APP] โœ… Resizable layout components ready') const stateContext = { files, @@ -280,6 +358,7 @@ function App() { ) } + console.log('[APP] ๐Ÿ“ฆ Rendering standard component:', page.component) const props = getPropsForComponent(page.id) return ( }> @@ -287,7 +366,7 @@ function App() { ) } catch (error) { - console.error(`Failed to render page ${page.id}:`, error) + console.error('[APP] โŒ Failed to render page', page.id, ':', error) return (
@@ -299,6 +378,10 @@ function App() { } } + console.log('[APP] ๐ŸŽจ Rendering App component UI') + console.log('[APP] App state - appReady:', appReady, 'activeTab:', activeTab) + console.timeEnd('[APP] App render') + return (
{!appReady && ( @@ -372,4 +455,7 @@ function App() { ) } +console.log('[APP] โœ… App component defined') +console.timeEnd('[APP] Component initialization') + export default App diff --git a/src/config/page-loader.ts b/src/config/page-loader.ts index 830c5aa..c0890bc 100644 --- a/src/config/page-loader.ts +++ b/src/config/page-loader.ts @@ -38,19 +38,31 @@ export interface PagesConfig { } export function getPageConfig(): PagesConfig { - return pagesConfig as PagesConfig + console.log('[CONFIG] ๐Ÿ“„ getPageConfig called') + const config = pagesConfig as PagesConfig + console.log('[CONFIG] โœ… Pages config loaded:', config.pages.length, 'pages') + return config } export function getPageById(id: string): PageConfig | undefined { - return pagesConfig.pages.find(page => page.id === id) + console.log('[CONFIG] ๐Ÿ” getPageById called for:', id) + const page = pagesConfig.pages.find(page => page.id === id) + console.log('[CONFIG]', page ? 'โœ… Page found' : 'โŒ Page not found') + return page } export function getEnabledPages(featureToggles?: FeatureToggles): PageConfig[] { - return pagesConfig.pages.filter(page => { - if (!page.enabled) return false + console.log('[CONFIG] ๐Ÿ” getEnabledPages called with toggles:', featureToggles) + const enabled = pagesConfig.pages.filter(page => { + if (!page.enabled) { + console.log('[CONFIG] โญ๏ธ Skipping disabled page:', page.id) + return false + } if (!page.toggleKey) return true return featureToggles?.[page.toggleKey as keyof FeatureToggles] !== false }).sort((a, b) => a.order - b.order) + console.log('[CONFIG] โœ… Enabled pages:', enabled.map(p => p.id).join(', ')) + return enabled } export function getPageShortcuts(featureToggles?: FeatureToggles): Array<{ @@ -60,7 +72,8 @@ export function getPageShortcuts(featureToggles?: FeatureToggles): Array<{ description: string action: string }> { - return getEnabledPages(featureToggles) + console.log('[CONFIG] โŒจ๏ธ getPageShortcuts called') + const shortcuts = getEnabledPages(featureToggles) .filter(page => page.shortcut) .map(page => { const parts = page.shortcut!.toLowerCase().split('+') @@ -76,15 +89,22 @@ export function getPageShortcuts(featureToggles?: FeatureToggles): Array<{ action: page.id } }) + console.log('[CONFIG] โœ… Shortcuts configured:', shortcuts.length) + return shortcuts } export function resolveProps(propConfig: PropConfig | undefined, stateContext: Record, actionContext: Record): Record { - if (!propConfig) return {} + console.log('[CONFIG] ๐Ÿ”ง resolveProps called') + if (!propConfig) { + console.log('[CONFIG] โญ๏ธ No prop config provided') + return {} + } const resolvedProps: Record = {} try { if (propConfig.state) { + console.log('[CONFIG] ๐Ÿ“ฆ Resolving', propConfig.state.length, 'state props') for (const stateKey of propConfig.state) { try { const [propName, contextKey] = stateKey.includes(':') @@ -93,29 +113,37 @@ export function resolveProps(propConfig: PropConfig | undefined, stateContext: R if (stateContext[contextKey] !== undefined) { resolvedProps[propName] = stateContext[contextKey] + console.log('[CONFIG] โœ… Resolved state prop:', propName) + } else { + console.log('[CONFIG] โš ๏ธ State prop not found:', contextKey) } } catch (err) { - console.warn(`Failed to resolve state prop: ${stateKey}`, err) + console.warn('[CONFIG] โŒ Failed to resolve state prop:', stateKey, err) } } } if (propConfig.actions) { + console.log('[CONFIG] ๐ŸŽฌ Resolving', propConfig.actions.length, 'action props') for (const actionKey of propConfig.actions) { try { const [propName, contextKey] = actionKey.split(':') if (actionContext[contextKey]) { resolvedProps[propName] = actionContext[contextKey] + console.log('[CONFIG] โœ… Resolved action prop:', propName) + } else { + console.log('[CONFIG] โš ๏ธ Action prop not found:', contextKey) } } catch (err) { - console.warn(`Failed to resolve action prop: ${actionKey}`, err) + console.warn('[CONFIG] โŒ Failed to resolve action prop:', actionKey, err) } } } } catch (err) { - console.error('Failed to resolve props:', err) + console.error('[CONFIG] โŒ Failed to resolve props:', err) } + console.log('[CONFIG] โœ… Props resolved:', Object.keys(resolvedProps).length, 'props') return resolvedProps } diff --git a/src/hooks/data/use-seed-data.ts b/src/hooks/data/use-seed-data.ts index da0c2d5..85ab109 100644 --- a/src/hooks/data/use-seed-data.ts +++ b/src/hooks/data/use-seed-data.ts @@ -2,75 +2,108 @@ import { useCallback, useState } from 'react' import seedDataConfig from '@/config/seed-data.json' export function useSeedData() { + console.log('[SEED] ๐ŸŒฑ useSeedData hook initializing') const [isLoaded, setIsLoaded] = useState(false) const [isLoading, setIsLoading] = useState(false) const loadSeedData = useCallback(async () => { - if (isLoading || isLoaded) return + console.log('[SEED] ๐Ÿ” loadSeedData called - isLoading:', isLoading, 'isLoaded:', isLoaded) + + if (isLoading || isLoaded) { + console.log('[SEED] โญ๏ธ Skipping seed data load (already loading or loaded)') + return + } + console.log('[SEED] ๐Ÿš€ Starting seed data load') setIsLoading(true) + console.time('[SEED] Seed data load duration') + try { + console.log('[SEED] ๐Ÿ”Œ Checking Spark KV availability') if (!window.spark?.kv) { - console.warn('Spark KV not available, skipping seed data') + console.warn('[SEED] โš ๏ธ Spark KV not available, skipping seed data') return } + console.log('[SEED] โœ… Spark KV is available') + console.log('[SEED] ๐Ÿ“‹ Fetching existing keys from KV store') const keys = await window.spark.kv.keys() + console.log('[SEED] ๐Ÿ“Š Found', keys.length, 'existing keys:', keys) + + console.log('[SEED] ๐Ÿ“ฆ Seed data config entries:', Object.keys(seedDataConfig).length) + let seededCount = 0 + let skippedCount = 0 for (const [key, value] of Object.entries(seedDataConfig)) { if (!keys.includes(key)) { + console.log('[SEED] โž• Seeding key:', key) await window.spark.kv.set(key, value) + seededCount++ + } else { + console.log('[SEED] โญ๏ธ Skipping existing key:', key) + skippedCount++ } } + console.log('[SEED] โœ… Seed data load complete - seeded:', seededCount, 'skipped:', skippedCount) setIsLoaded(true) } catch (error) { - console.error('Failed to load seed data:', error) + console.error('[SEED] โŒ Failed to load seed data:', error) setIsLoaded(true) } finally { setIsLoading(false) + console.timeEnd('[SEED] Seed data load duration') } }, [isLoading, isLoaded]) const resetSeedData = useCallback(async () => { + console.log('[SEED] ๐Ÿ”„ Resetting seed data') setIsLoading(true) try { if (!window.spark?.kv) { - console.warn('Spark KV not available') + console.warn('[SEED] โš ๏ธ Spark KV not available') return } + console.log('[SEED] ๐Ÿ”„ Overwriting all seed data keys') for (const [key, value] of Object.entries(seedDataConfig)) { + console.log('[SEED] ๐Ÿ“ Setting key:', key) await window.spark.kv.set(key, value) } + console.log('[SEED] โœ… Seed data reset complete') setIsLoaded(true) } catch (error) { - console.error('Failed to reset seed data:', error) + console.error('[SEED] โŒ Failed to reset seed data:', error) } finally { setIsLoading(false) } }, []) const clearAllData = useCallback(async () => { + console.log('[SEED] ๐Ÿ—‘๏ธ Clearing all data') setIsLoading(true) try { if (!window.spark?.kv) { - console.warn('Spark KV not available') + console.warn('[SEED] โš ๏ธ Spark KV not available') return } const keys = await window.spark.kv.keys() + console.log('[SEED] ๐Ÿ“‹ Deleting', keys.length, 'keys') for (const key of keys) { + console.log('[SEED] ๐Ÿ—‘๏ธ Deleting key:', key) await window.spark.kv.delete(key) } + console.log('[SEED] โœ… All data cleared') setIsLoaded(false) } catch (error) { - console.error('Failed to clear data:', error) + console.error('[SEED] โŒ Failed to clear data:', error) } finally { setIsLoading(false) } }, []) + console.log('[SEED] ๐Ÿ“ค Returning seed data hook methods') return { isLoaded, isLoading, diff --git a/src/hooks/use-project-state.ts b/src/hooks/use-project-state.ts index bd267da..b4e35b6 100644 --- a/src/hooks/use-project-state.ts +++ b/src/hooks/use-project-state.ts @@ -134,9 +134,22 @@ const DEFAULT_FILES: ProjectFile[] = [ ] export function useProjectState() { + console.log('[STATE] ๐Ÿ”ง useProjectState hook initializing') + console.time('[STATE] Project state initialization') + + console.log('[STATE] ๐Ÿ“ Loading files from KV') const [files, setFiles] = useKV('project-files', DEFAULT_FILES) + console.log('[STATE] โœ… Files loaded:', files?.length || 0, 'files') + + console.log('[STATE] ๐Ÿ—ƒ๏ธ Loading models from KV') const [models, setModels] = useKV('project-models', []) + console.log('[STATE] โœ… Models loaded:', models?.length || 0, 'models') + + console.log('[STATE] ๐Ÿงฉ Loading components from KV') const [components, setComponents] = useKV('project-components', []) + console.log('[STATE] โœ… Components loaded:', components?.length || 0, 'components') + + console.log('[STATE] ๐ŸŒณ Loading component trees from KV') const [componentTrees, setComponentTrees] = useKV('project-component-trees', [ { id: 'default-tree', @@ -147,17 +160,49 @@ export function useProjectState() { updatedAt: Date.now(), }, ]) + console.log('[STATE] โœ… Component trees loaded:', componentTrees?.length || 0, 'trees') + + console.log('[STATE] ๐Ÿ”„ Loading workflows from KV') const [workflows, setWorkflows] = useKV('project-workflows', []) + console.log('[STATE] โœ… Workflows loaded:', workflows?.length || 0, 'workflows') + + console.log('[STATE] ฮป Loading lambdas from KV') const [lambdas, setLambdas] = useKV('project-lambdas', []) + console.log('[STATE] โœ… Lambdas loaded:', lambdas?.length || 0, 'lambdas') + + console.log('[STATE] ๐ŸŽจ Loading theme from KV') const [theme, setTheme] = useKV('project-theme', DEFAULT_THEME) + console.log('[STATE] โœ… Theme loaded') + + console.log('[STATE] ๐ŸŽญ Loading Playwright tests from KV') const [playwrightTests, setPlaywrightTests] = useKV('project-playwright-tests', []) + console.log('[STATE] โœ… Playwright tests loaded:', playwrightTests?.length || 0, 'tests') + + console.log('[STATE] ๐Ÿ“š Loading Storybook stories from KV') const [storybookStories, setStorybookStories] = useKV('project-storybook-stories', []) + console.log('[STATE] โœ… Storybook stories loaded:', storybookStories?.length || 0, 'stories') + + console.log('[STATE] ๐Ÿงช Loading unit tests from KV') const [unitTests, setUnitTests] = useKV('project-unit-tests', []) + console.log('[STATE] โœ… Unit tests loaded:', unitTests?.length || 0, 'tests') + + console.log('[STATE] ๐Ÿ Loading Flask config from KV') const [flaskConfig, setFlaskConfig] = useKV('project-flask-config', DEFAULT_FLASK_CONFIG) + console.log('[STATE] โœ… Flask config loaded') + + console.log('[STATE] โš›๏ธ Loading Next.js config from KV') const [nextjsConfig, setNextjsConfig] = useKV('project-nextjs-config', DEFAULT_NEXTJS_CONFIG) + console.log('[STATE] โœ… Next.js config loaded') + + console.log('[STATE] ๐Ÿ“ฆ Loading NPM settings from KV') const [npmSettings, setNpmSettings] = useKV('project-npm-settings', DEFAULT_NPM_SETTINGS) + console.log('[STATE] โœ… NPM settings loaded') + + console.log('[STATE] ๐ŸŽš๏ธ Loading feature toggles from KV') const [featureToggles, setFeatureToggles] = useKV('project-feature-toggles', DEFAULT_FEATURE_TOGGLES) + console.log('[STATE] โœ… Feature toggles loaded') + console.log('[STATE] ๐Ÿ›ก๏ธ Creating safe array wrappers') const safeFiles = Array.isArray(files) ? files : [] const safeModels = Array.isArray(models) ? models : [] const safeComponents = Array.isArray(components) ? components : [] @@ -172,7 +217,11 @@ export function useProjectState() { const safeNextjsConfig = nextjsConfig || DEFAULT_NEXTJS_CONFIG const safeNpmSettings = npmSettings || DEFAULT_NPM_SETTINGS const safeFeatureToggles = featureToggles || DEFAULT_FEATURE_TOGGLES + console.log('[STATE] โœ… Safe wrappers created') + console.log('[STATE] ๐Ÿ“ค Returning project state object') + console.timeEnd('[STATE] Project state initialization') + return { files: safeFiles, setFiles, diff --git a/src/main.tsx b/src/main.tsx index 0cd7bc2..23bd47d 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,15 +1,40 @@ -import { createRoot } from 'react-dom/client' -import { ErrorBoundary } from "react-error-boundary"; -import "@github/spark/spark" +console.log('[INIT] ๐Ÿš€ main.tsx starting - BEGIN') +console.time('[INIT] Total initialization time') +console.log('[INIT] ๐Ÿ“ฆ Importing React DOM') +import { createRoot } from 'react-dom/client' +console.log('[INIT] โœ… React DOM imported') + +console.log('[INIT] ๐Ÿ“ฆ Importing ErrorBoundary') +import { ErrorBoundary } from "react-error-boundary"; +console.log('[INIT] โœ… ErrorBoundary imported') + +console.log('[INIT] ๐Ÿ“ฆ Importing Spark SDK') +import "@github/spark/spark" +console.log('[INIT] โœ… Spark SDK imported') + +console.log('[INIT] ๐Ÿ“ฆ Importing App component') import App from './App.tsx' +console.log('[INIT] โœ… App component imported') + +console.log('[INIT] ๐Ÿ“ฆ Importing ErrorFallback') import { ErrorFallback } from './ErrorFallback.tsx' +console.log('[INIT] โœ… ErrorFallback imported') + +console.log('[INIT] ๐Ÿ“ฆ Importing UI components') import { Toaster } from './components/ui/sonner.tsx' import { TooltipProvider } from './components/ui/tooltip.tsx' +console.log('[INIT] โœ… UI components imported') +console.log('[INIT] ๐ŸŽจ Loading CSS files') import "./main.css" +console.log('[INIT] โœ… main.css loaded') import "./styles/theme.css" +console.log('[INIT] โœ… theme.css loaded') import "./index.css" +console.log('[INIT] โœ… index.css loaded') + +console.log('[INIT] ๐Ÿ›ก๏ธ Setting up error handlers') const isResizeObserverError = (message: string | undefined): boolean => { if (!message) return false @@ -42,6 +67,7 @@ console.warn = (...args) => { } window.addEventListener('error', (e) => { + console.log('[INIT] โš ๏ธ Global error caught:', e.message) if (isResizeObserverError(e.message)) { e.stopImmediatePropagation() e.preventDefault() @@ -50,13 +76,29 @@ window.addEventListener('error', (e) => { }, true) window.addEventListener('unhandledrejection', (e) => { + console.log('[INIT] โš ๏ธ Unhandled rejection caught:', e.reason) if (e.reason && e.reason.message && isResizeObserverError(e.reason.message)) { e.preventDefault() return false } }) -createRoot(document.getElementById('root')!).render( +console.log('[INIT] โœ… Error handlers configured') + +console.log('[INIT] ๐ŸŽฏ Finding root element') +const rootElement = document.getElementById('root') +if (!rootElement) { + console.error('[INIT] โŒ Root element not found!') + throw new Error('Root element not found') +} +console.log('[INIT] โœ… Root element found:', rootElement) + +console.log('[INIT] ๐Ÿ—๏ธ Creating React root') +const root = createRoot(rootElement) +console.log('[INIT] โœ… React root created') + +console.log('[INIT] ๐ŸŽจ Rendering application') +root.render( @@ -64,3 +106,6 @@ createRoot(document.getElementById('root')!).render( ) +console.log('[INIT] โœ… Application rendered') +console.timeEnd('[INIT] Total initialization time') +console.log('[INIT] ๐ŸŽ‰ main.tsx complete - END')