@@ -80,24 +80,24 @@ export class PrepareController extends EventEmitter {
8080 nativeFilesWatcher : null ,
8181 webpackCompilerProcess : null
8282 } ;
83- }
83+ await this . startJSWatcherWithPrepare ( platformData , projectData , prepareData ) ; // -> start watcher + initial compilation
84+ const hasNativeChanges = await this . startNativeWatcherWithPrepare ( platformData , projectData , prepareData ) ; // -> start watcher + initial prepare
85+ const result = { platform : platformData . platformNameLowerCase , hasNativeChanges } ;
8486
85- await this . startJSWatcherWithPrepare ( platformData , projectData , prepareData ) ; // -> start watcher + initial compilation
86- const hasNativeChanges = await this . startNativeWatcherWithPrepare ( platformData , projectData , prepareData ) ; // -> start watcher + initial prepare
87+ const hasPersistedDataWithNativeChanges = this . persistedData . find ( data => data . platform === result . platform && data . hasNativeChanges ) ;
88+ if ( hasPersistedDataWithNativeChanges ) {
89+ result . hasNativeChanges = true ;
90+ }
8791
88- const result = { platform : platformData . platformNameLowerCase , hasNativeChanges } ;
89- const hasPersistedDataWithNativeChanges = this . persistedData . find ( data => data . platform === result . platform && data . hasNativeChanges ) ;
90- if ( hasPersistedDataWithNativeChanges ) {
91- result . hasNativeChanges = true ;
92- }
92+ // TODO: Do not persist this in `this` context. Also it should be per platform.
93+ this . isInitialPrepareReady = true ;
9394
94- this . isInitialPrepareReady = true ;
95+ if ( this . persistedData && this . persistedData . length ) {
96+ this . emitPrepareEvent ( { files : [ ] , hasOnlyHotUpdateFiles : false , hasNativeChanges : result . hasNativeChanges , hmrData : null , platform : platformData . platformNameLowerCase } ) ;
97+ }
9598
96- if ( this . persistedData && this . persistedData . length ) {
97- this . emitPrepareEvent ( { files : [ ] , hasOnlyHotUpdateFiles : false , hasNativeChanges : result . hasNativeChanges , hmrData : null , platform : platformData . platformNameLowerCase } ) ;
99+ return result ;
98100 }
99-
100- return result ;
101101 }
102102
103103 private async startJSWatcherWithPrepare ( platformData : IPlatformData , projectData : IProjectData , prepareData : IPrepareData ) : Promise < void > {
0 commit comments