@@ -239,13 +239,6 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
239239 bestPath = indexMatchAtMount ;
240240 }
241241
242- if ( process . env . NODE_ENV !== 'production' ) {
243- console . log (
244- `[getParentPath] outlet=${ this . id } , pathname=${ currentPathname } : ` +
245- `specific=${ firstSpecificMatch } , wildcard=${ firstWildcardMatch } , index=${ indexMatchAtMount } , best=${ bestPath } `
246- ) ;
247- }
248-
249242 // Store the mount path when we first successfully match a route
250243 if ( ! this . outletMountPath && bestPath ) {
251244 this . outletMountPath = bestPath ;
@@ -331,18 +324,11 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
331324 * Set a flag to indicate that we should transition the page after
332325 * the component has updated (i.e., in `componentDidUpdate`).
333326 */
334- if ( process . env . NODE_ENV !== 'production' ) {
335- console . log ( `[StackManager] Outlet ${ this . id } not ready yet, setting pendingPageTransition=true for ${ routeInfo . pathname } ` ) ;
336- }
337327 this . pendingPageTransition = true ;
338328 } else {
339329 let enteringViewItem = this . context . findViewItemByRouteInfo ( routeInfo , this . id ) ;
340330 let leavingViewItem = this . context . findLeavingViewItemByRouteInfo ( routeInfo , this . id ) ;
341331
342- if ( process . env . NODE_ENV !== 'production' ) {
343- console . log ( `[StackManager:handlePageTransition] outlet=${ this . id } , pathname=${ routeInfo . pathname } , entering=${ enteringViewItem ?. id } , leaving=${ leavingViewItem ?. id } , enteringIsNav=${ isNavigateViewItem ( enteringViewItem ) } , leavingIsNav=${ isNavigateViewItem ( leavingViewItem ) } ` ) ;
344- }
345-
346332 /**
347333 * If we don't have a leaving view item, but the route info indicates
348334 * that the user has routed from a previous path, then the leaving view
@@ -443,13 +429,7 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
443429 : [ ] ;
444430
445431 // Unmount and remove all views in this outlet immediately to avoid leftover content
446- if ( process . env . NODE_ENV !== 'production' ) {
447- console . log ( `[StackManager:outOfScope] outlet=${ this . id } is out of scope, removing ${ allViewsInOutlet . length } views` ) ;
448- }
449432 allViewsInOutlet . forEach ( ( viewItem ) => {
450- if ( process . env . NODE_ENV !== 'production' ) {
451- console . log ( `[StackManager:outOfScope] Removing view ${ viewItem . id } from outlet ${ this . id } , isNavigate=${ isNavigateViewItem ( viewItem ) } ` ) ;
452- }
453433 if ( viewItem . ionPageElement ) {
454434 viewItem . ionPageElement . classList . add ( 'ion-page-hidden' ) ;
455435 viewItem . ionPageElement . setAttribute ( 'aria-hidden' , 'true' ) ;
@@ -490,9 +470,6 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
490470 leavingViewItem . ionPageElement . setAttribute ( 'aria-hidden' , 'true' ) ;
491471 }
492472 if ( leavingViewItem ) {
493- if ( isNavigateViewItem ( leavingViewItem ) && process . env . NODE_ENV !== 'production' ) {
494- console . log ( `[StackManager:hasRelativeRoutes] Setting mount=false on Navigate ${ leavingViewItem . id } , outlet=${ this . id } , pathname=${ routeInfo . pathname } ` ) ;
495- }
496473 leavingViewItem . mount = false ;
497474 }
498475 this . forceUpdate ( ) ;
@@ -506,32 +483,16 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
506483 parentPath
507484 ) as React . ReactElement ;
508485
509- if ( enteringRoute && process . env . NODE_ENV !== 'production' ) {
510- const routeElement = enteringRoute . props ?. element ;
511- const isNavigate = React . isValidElement ( routeElement ) && routeElement . type === Navigate ;
512- console . log (
513- `[StackManager] Found entering route for ${ routeInfo . pathname } in outlet ${ this . id } : path="${
514- enteringRoute . props ?. path ?? '(index)'
515- } ", isNavigate=${ isNavigate } `
516- ) ;
517- }
518-
519486 // If this is a nested outlet (has an explicit ID) and no route matches,
520487 // it means this outlet shouldn't handle this route
521488 if ( this . id !== 'routerOutlet' && ! enteringRoute && ! enteringViewItem ) {
522- if ( process . env . NODE_ENV !== 'production' ) {
523- console . log ( `[StackManager:noMatchingRoute] outlet=${ this . id } has no matching route for ${ routeInfo . pathname } , leavingViewItem=${ leavingViewItem ?. id } ` ) ;
524- }
525489 // Hide any visible views in this outlet since it has no matching route
526490 if ( leavingViewItem && leavingViewItem . ionPageElement ) {
527491 leavingViewItem . ionPageElement . classList . add ( 'ion-page-hidden' ) ;
528492 leavingViewItem . ionPageElement . setAttribute ( 'aria-hidden' , 'true' ) ;
529493 }
530494 // Unmount the leaving view to prevent components from staying active
531495 if ( leavingViewItem ) {
532- if ( isNavigateViewItem ( leavingViewItem ) && process . env . NODE_ENV !== 'production' ) {
533- console . log ( `[StackManager:noMatchingRoute] Setting mount=false on Navigate ${ leavingViewItem . id } , outlet=${ this . id } , pathname=${ routeInfo . pathname } ` ) ;
534- }
535496 leavingViewItem . mount = false ;
536497 }
537498 this . forceUpdate ( ) ;
@@ -545,18 +506,9 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
545506 if ( enteringViewItem && enteringRoute ) {
546507 // Update existing view item
547508 enteringViewItem . reactElement = enteringRoute ;
548- if ( process . env . NODE_ENV !== 'production' ) {
549- console . log ( `[StackManager] Updated existing view item ${ enteringViewItem . id } for outlet ${ this . id } ` ) ;
550- }
551509 } else if ( enteringRoute ) {
552- if ( process . env . NODE_ENV !== 'production' ) {
553- console . log ( `[StackManager] Creating new view item for outlet ${ this . id } , route path="${ enteringRoute . props ?. path ?? '(index)' } "` ) ;
554- }
555510 enteringViewItem = this . context . createViewItem ( this . id , enteringRoute , routeInfo ) ;
556511 this . context . addViewItem ( enteringViewItem ) ;
557- if ( process . env . NODE_ENV !== 'production' ) {
558- console . log ( `[StackManager] Added view item ${ enteringViewItem . id } to outlet ${ this . id } ` ) ;
559- }
560512 }
561513
562514 /**
@@ -716,9 +668,6 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
716668 * and repeatedly hide the leaving view. Treat this as a no-op transition and allow
717669 * the follow-up navigation to proceed.
718670 */
719- if ( process . env . NODE_ENV !== 'production' ) {
720- console . log ( `[StackManager:Navigate] outlet=${ this . id } , entering=${ enteringViewItem ?. id } , leaving=${ leavingViewItem ?. id } , shouldUnmount=${ shouldUnmountLeavingViewItem } , pathname=${ routeInfo . pathname } ` ) ;
721- }
722671 this . waitingForIonPage = false ;
723672 if ( this . ionPageWaitTimeout ) {
724673 clearTimeout ( this . ionPageWaitTimeout ) ;
@@ -735,9 +684,6 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
735684 // This happens during chained Navigate redirects where the same Navigate view item
736685 // is being processed multiple times before it can render and trigger the redirect
737686 if ( shouldUnmountLeavingViewItem && leavingViewItem && enteringViewItem !== leavingViewItem ) {
738- if ( isNavigateViewItem ( leavingViewItem ) && process . env . NODE_ENV !== 'production' ) {
739- console . log ( `[StackManager:Navigate:unmountLeaving] Setting mount=false on Navigate ${ leavingViewItem . id } , outlet=${ this . id } ` ) ;
740- }
741687 leavingViewItem . mount = false ;
742688 }
743689
@@ -754,18 +700,9 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
754700 * while we wait for the entering view's IonPage to mount, then retry the
755701 * transition once the page is ready.
756702 */
757- if ( process . env . NODE_ENV !== 'production' ) {
758- console . log (
759- `[StackManager] Entering view ${ enteringViewItem . id } has no ionPageElement yet, will hide leaving view and retry`
760- ) ;
761- }
762-
763703 if ( leavingViewItem ?. ionPageElement ) {
764704 leavingViewItem . ionPageElement . classList . add ( 'ion-page-hidden' ) ;
765705 leavingViewItem . ionPageElement . setAttribute ( 'aria-hidden' , 'true' ) ;
766- if ( process . env . NODE_ENV !== 'production' ) {
767- console . log ( `[StackManager] HIDING leaving view ${ leavingViewItem . id } (no entering ionPage yet)` ) ;
768- }
769706 }
770707
771708 this . waitingForIonPage = true ;
@@ -787,21 +724,13 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
787724 this . context . findLeavingViewItemByRouteInfo ( routeInfo , this . id ) ?? leavingViewItem ;
788725
789726 if ( latestEnteringView ?. ionPageElement ) {
790- if ( process . env . NODE_ENV !== 'production' ) {
791- console . log ( `[StackManager] Retrying transition for ${ latestEnteringView . id } ` ) ;
792- }
793-
794727 this . transitionPage ( routeInfo , latestEnteringView , latestLeavingView ?? undefined ) ;
795728
796729 if ( shouldUnmountLeavingViewItem && latestLeavingView && latestEnteringView !== latestLeavingView ) {
797730 latestLeavingView . mount = false ;
798731 }
799732
800733 this . forceUpdate ( ) ;
801- } else if ( process . env . NODE_ENV !== 'production' ) {
802- console . log (
803- `[StackManager] Still no ionPageElement for ${ latestEnteringView ?. id ?? enteringViewItem ?. id ?? 'unknown' } , skipping transition`
804- ) ;
805734 }
806735 } , 50 ) ;
807736
@@ -1205,12 +1134,6 @@ function findRouteByRouteInfo(node: React.ReactNode, routeInfo: RouteInfo, paren
12051134 const parentSegments = normalizedParent . split ( '/' ) . filter ( Boolean ) ;
12061135 const relativeSegments = pathSegments . slice ( parentSegments . length ) ;
12071136 pathnameToMatch = relativeSegments . join ( '/' ) ; // Empty string is valid for index routes
1208-
1209- if ( process . env . NODE_ENV !== 'production' ) {
1210- console . log (
1211- `[findRouteByRouteInfo] Computed relative path: "${ pathnameToMatch } " from pathname="${ routeInfo . pathname } " parentPath="${ parentPath } "`
1212- ) ;
1213- }
12141137 }
12151138 }
12161139
@@ -1222,13 +1145,6 @@ function findRouteByRouteInfo(node: React.ReactNode, routeInfo: RouteInfo, paren
12221145 } ) ;
12231146
12241147 if ( match ) {
1225- if ( process . env . NODE_ENV !== 'production' ) {
1226- console . log (
1227- `[findRouteByRouteInfo] Matched route for ${ routeInfo . pathname } in outlet ${ parentPath ?? 'root' } with path="${
1228- child . props . path ?? '(index)'
1229- } "`
1230- ) ;
1231- }
12321148 matchedNode = child ;
12331149 break ;
12341150 }
0 commit comments