MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / logUiSnapshot

Function logUiSnapshot

packages/vite/hmr/client/utils.ts:375–404  ·  view source on GitHub ↗
(reason: string)

Source from the content-addressed store, hash-verified

373}
374
375export function logUiSnapshot(reason: string) {
376 try {
377 const g: any = globalThis as any;
378 const F = getCore('Frame') || g.Frame;
379 const App = getCore('Application') || g.Application;
380 const top = F?.topmost?.();
381 const rootView = App?.getRootView ? App.getRootView() : undefined;
382 const page = top?.currentPage || top?._currentEntry?.resolvedPage || null;
383 const info = {
384 reason,
385 placeholderActive: !!(g.__NS_DEV_PLACEHOLDER_ROOT_VIEW__ || g.__NS_DEV_PLACEHOLDER_ROOT_EARLY__),
386 activityReady: !!(App?.android && (App.android.foregroundActivity || App.android.startActivity)),
387 topFrame: top
388 ? {
389 ctor: top.constructor?.name,
390 backstack: (top as any)?._backStack?.length || 0,
391 }
392 : null,
393 rootView: rootView ? { ctor: rootView.constructor?.name } : null,
394 currentPage: page
395 ? {
396 ctor: page.constructor?.name,
397 tag: (page as any)?.__ns_hmr_tag || (page as any)?.__ns_diag_tag,
398 title: (page as any)?.title,
399 }
400 : null,
401 };
402 console.log('[diag][ui]', info);
403 } catch {}
404}

Callers 1

performResetRootFunction · 0.85

Calls 4

getCoreFunction · 0.70
getRootViewMethod · 0.65
topmostMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected