@@ -3,7 +3,7 @@ import { of, Observable, Subject, forkJoin, from } from 'rxjs';
3
3
import { AssetsLoader } from '../assets-loader' ;
4
4
import { PlanetApplication , PlanetRouterEvent , SwitchModes , PlanetOptions } from '../planet.class' ;
5
5
import { switchMap , share , map , tap , distinctUntilChanged , take , filter , catchError } from 'rxjs/operators' ;
6
- import { getHTMLElement , coerceArray , createElementByTemplate , debug } from '../helpers' ;
6
+ import { getHTMLElement , coerceArray , createElementByTemplate } from '../helpers' ;
7
7
import { PlanetApplicationRef } from './planet-application-ref' ;
8
8
import { PlanetPortalApplication } from './portal-application' ;
9
9
import { PlanetApplicationService } from './planet-application.service' ;
@@ -224,12 +224,12 @@ export class PlanetApplicationLoader {
224
224
setTimeout ( ( ) => {
225
225
// 此处判断是因为如果静态资源加载完毕还未启动被取消,还是会启动之前的应用,虽然可能性比较小,但是无法排除这种可能性,所以只有当 Event 是最后一个才会启动
226
226
if ( this . startRouteChangeEvent === event ) {
227
- this . ngZone . runOutsideAngular ( ( ) => {
228
- forkJoin ( apps$ ) . subscribe ( ( ) => {
229
- this . setLoadingDone ( ) ;
230
- this . ensurePreloadApps ( apps ) ;
231
- } ) ;
227
+ // this.ngZone.runOutsideAngular(() => {
228
+ forkJoin ( apps$ ) . subscribe ( ( ) => {
229
+ this . setLoadingDone ( ) ;
230
+ this . ensurePreloadApps ( apps ) ;
232
231
} ) ;
232
+ // });
233
233
}
234
234
} ) ;
235
235
} else {
@@ -305,7 +305,6 @@ export class PlanetApplicationLoader {
305
305
app : PlanetApplication ,
306
306
defaultStatus : 'hidden' | 'display' = 'display'
307
307
) : Observable < PlanetApplicationRef > {
308
- debug ( `${ app . name } start bootstrap` ) ;
309
308
this . setAppStatus ( app , ApplicationStatus . bootstrapping ) ;
310
309
const appRef = getPlanetApplicationRef ( app . name ) ;
311
310
if ( appRef && appRef . bootstrap ) {
@@ -333,7 +332,6 @@ export class PlanetApplicationLoader {
333
332
}
334
333
return result . pipe (
335
334
tap ( ( ) => {
336
- debug ( `${ app . name } bootstrapped` ) ;
337
335
this . setAppStatus ( app , ApplicationStatus . bootstrapped ) ;
338
336
if ( defaultStatus === 'display' && appRootElement ) {
339
337
appRootElement . removeAttribute ( 'style' ) ;
@@ -437,7 +435,6 @@ export class PlanetApplicationLoader {
437
435
preload ( app : PlanetApplication , directBootstrap ?: boolean ) : Observable < PlanetApplicationRef > {
438
436
const status = this . appsStatus . get ( app ) ;
439
437
if ( ! status || status === ApplicationStatus . loadError ) {
440
- debug ( `${ app . name } start preloading` ) ;
441
438
return this . startLoadAppAssets ( app ) . pipe (
442
439
switchMap ( ( ) => {
443
440
if ( directBootstrap ) {
@@ -446,7 +443,6 @@ export class PlanetApplicationLoader {
446
443
return this . ngZone . runOutsideAngular ( ( ) => {
447
444
return this . takeOneStable ( ) . pipe (
448
445
switchMap ( ( ) => {
449
- debug ( `${ app . name } start bootstrap on stable` ) ;
450
446
return this . bootstrapApp ( app , 'hidden' ) ;
451
447
} )
452
448
) ;
@@ -468,12 +464,10 @@ export class PlanetApplicationLoader {
468
464
} ) ,
469
465
take ( 1 ) ,
470
466
map ( ( ) => {
471
- debug ( `${ app . name } assets is loading or app is bootstrapped, return appRef` ) ;
472
467
return getPlanetApplicationRef ( app . name ) ;
473
468
} )
474
469
) ;
475
470
} else {
476
- debug ( `${ app . name } status is '${ status } ' , return appRef` ) ;
477
471
return of ( getPlanetApplicationRef ( app . name ) ) ;
478
472
}
479
473
}
0 commit comments