@@ -80,24 +80,24 @@ export class PrepareController extends EventEmitter {
80
80
nativeFilesWatcher : null ,
81
81
webpackCompilerProcess : null
82
82
} ;
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 } ;
84
86
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
+ }
87
91
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 ;
93
94
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
+ }
95
98
96
- if ( this . persistedData && this . persistedData . length ) {
97
- this . emitPrepareEvent ( { files : [ ] , hasOnlyHotUpdateFiles : false , hasNativeChanges : result . hasNativeChanges , hmrData : null , platform : platformData . platformNameLowerCase } ) ;
99
+ return result ;
98
100
}
99
-
100
- return result ;
101
101
}
102
102
103
103
private async startJSWatcherWithPrepare ( platformData : IPlatformData , projectData : IProjectData , prepareData : IPrepareData ) : Promise < void > {
0 commit comments