Skip to content

Commit

Permalink
Evaluate dist files upon new FastBoot
Browse files Browse the repository at this point in the history
This helps ensure that if the dist files themselves are invalid, we fail
fast (e.g. before the first `fastboot.visit()` invocation).
  • Loading branch information
rwjblue committed Oct 30, 2019
1 parent ec2b32d commit 148a75c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ember-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class EmberApp {
config.appFiles
);
this.scripts = buildScripts(filePaths);

// Ensure that the dist files can be evaluated and the `Ember.Application`
// instance created.
this.buildApp();
}

/**
Expand Down Expand Up @@ -192,7 +196,7 @@ class EmberApp {
*
* @returns {Ember.Application} instance
*/
async buildApp() {
buildApp() {
let sandbox = this.buildSandbox();

debug('adding files to sandbox');
Expand Down Expand Up @@ -221,8 +225,6 @@ class EmberApp {
// Otherwise, return a new `Ember.Application` instance
let app = AppFactory['default']();

await app.boot();

return app;
}

Expand All @@ -248,6 +250,8 @@ class EmberApp {
let app = await this.buildApp();
result.applicationInstance = app;

await app.boot();

let instance = await app.buildInstance();
result.applicationInstanceInstance = instance;

Expand Down

0 comments on commit 148a75c

Please sign in to comment.