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

Function initializeAfterRender

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

Rest of startup runs after the shell is interactive so first-screen latency stays reasonable.

()

Source from the content-addressed store, hash-verified

229
230/** Rest of startup runs after the shell is interactive so first-screen latency stays reasonable. */
231async function initializeAfterRender(): Promise<void> {
232 const phaseStartedAt = nowMs();
233 startupTrace.markPhase('after_render_start');
234 const { fontPreferenceService } = await import('./infrastructure/font-preference');
235 await fontPreferenceService.initialize();
236 log.info('Font preference initialized at startup');
237
238 const initResults = await Promise.allSettled([
239 (async () => {
240 const { backgroundTaskScheduler } = await import('./shared/utils/backgroundTaskScheduler');
241 backgroundTaskScheduler.schedule(async () => {
242 const { configManager } = await import('./infrastructure/config/services/ConfigManager');
243 await configManager.getConfig('editor');
244 log.info('Editor configuration preloaded');
245 }, {
246 idle: true,
247 inFlightKey: 'startup:editor-config-preload',
248 priority: 'low',
249 });
250 })(),
251 (async () => {
252 const {
253 initializeFrontendLogLevelSync,
254 installFrontendLogLevelConfigWatcher,
255 } = await import('./infrastructure/config/services/FrontendLogLevelSync');
256 await initializeFrontendLogLevelSync();
257 await installFrontendLogLevelConfigWatcher();
258 })(),
259 (async () => {
260 const { themeService } = await import('./infrastructure/theme');
261 await themeService.ensureUserThemesLoaded();
262 })(),
263 (async () => {
264 const { registerDefaultContextTypes } = await import('./shared/context-system/core/registerDefaultTypes');
265 registerDefaultContextTypes();
266 })(),
267 (async () => {
268 const { initRecommendationProviders } = await import('./flow_chat/components/smart-recommendations');
269 initRecommendationProviders();
270 })(),
271 (async () => {
272 const { initializeAllTools } = await import('./tools/initializeTools');
273 await initializeAllTools();
274 })(),
275 (async () => {
276 const { initContextMenuSystem } = await import('./shared/context-menu-system');
277 initContextMenuSystem({
278 registerBuiltinCommands: true,
279 registerBuiltinProviders: true,
280 debug: false,
281 });
282
283 const { registerNotificationContextMenu } = await import('./shared/notification-system');
284 registerNotificationContextMenu();
285 })(),
286 ]);
287
288 initResults.forEach((result, index) => {

Callers 1

startApplicationFunction · 0.85

Calls 15

nowMsFunction · 0.90
logElapsedFunction · 0.90
elapsedMsFunction · 0.90
initializeAllToolsFunction · 0.85
initContextMenuSystemFunction · 0.85
markPhaseMethod · 0.80

Tested by

no test coverage detected