MCPcopy Create free account
hub / github.com/GCWing/BitFun / initializeBeforeRender

Function initializeBeforeRender

src/web-ui/src/main.tsx:202–228  ·  view source on GitHub ↗

Logger, theme, and minimal deps — must finish before first React paint (F5 / webview reload does not re-run Tauri init script).

()

Source from the content-addressed store, hash-verified

200
201/** Logger, theme, and minimal deps — must finish before first React paint (F5 / webview reload does not re-run Tauri init script). */
202async function initializeBeforeRender(): Promise<void> {
203 const phaseStartedAt = nowMs();
204 startupTrace.markPhase('before_render_start');
205 await traceStartupStep('before_render_step', 'init_logger', async () => {
206 await measureAsyncAndLog(log, 'Startup step completed', () => initLogger(), {
207 data: { step: 'initLogger' },
208 });
209 });
210
211 log.info('Initializing BitFun');
212
213 await traceStartupStep('before_render_step', 'theme_service_initialize', async () => {
214 await measureAsyncAndLog(log, 'Startup step completed', async () => {
215 const { themeService } = await import('./infrastructure/theme');
216 await themeService.initialize();
217 }, {
218 data: { step: 'themeService.initialize' },
219 });
220 });
221 log.info('Theme system initialized');
222 logElapsed(log, 'Startup phase completed', phaseStartedAt, {
223 data: { phase: 'initializeBeforeRender' },
224 });
225 startupTrace.markPhase('before_render_end', {
226 durationMs: elapsedMs(phaseStartedAt),
227 });
228}
229
230/** Rest of startup runs after the shell is interactive so first-screen latency stays reasonable. */
231async function initializeAfterRender(): Promise<void> {

Callers 1

startApplicationFunction · 0.85

Calls 9

nowMsFunction · 0.90
measureAsyncAndLogFunction · 0.90
initLoggerFunction · 0.90
logElapsedFunction · 0.90
elapsedMsFunction · 0.90
traceStartupStepFunction · 0.85
markPhaseMethod · 0.80
infoMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected