Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up boot process #10271

Merged
merged 15 commits into from
Jan 30, 2015
Prev Previous commit
Fix feature flagged autoboot
  • Loading branch information
tomdale committed Jan 30, 2015
commit f578a04740d91bb03d2520b537ccbcc344a157ae
15 changes: 10 additions & 5 deletions packages/ember-application/lib/system/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,16 @@ var Application = Namespace.extend(DeferredMixin, {
// decremented by the Application's own `initialize` method.
this._readinessDeferrals = 1;

if (!Ember.FEATURES.isEnabled('ember-application-visit') || this.autoboot) {
// Create subclass of Ember.Router for this Application instance.
// This is to ensure that someone reopening `App.Router` does not
// tamper with the default `Ember.Router`.
// 2.0TODO: Can we move this into a globals-mode-only library?
if (Ember.FEATURES.isEnabled('ember-application-visit')) {
if (this.autoboot) {
// Create subclass of Ember.Router for this Application instance.
// This is to ensure that someone reopening `App.Router` does not
// tamper with the default `Ember.Router`.
// 2.0TODO: Can we move this into a globals-mode-only library?
this.Router = Router.extend();
this.waitForDOMReady(this.buildDefaultInstance());
}
} else {
this.Router = Router.extend();
this.waitForDOMReady(this.buildDefaultInstance());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know several people who want to optionally begin before DOMReady, any thoughts on how to facilitate that officially?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to not wait for DOM ready, especially when you stream a chunked encoded index.html. We optimize by streaming down JSON snippets to the index.html but we currently can't boot till that connection closes because the document is not complete. Would be great to hide Ember boot underneath the initial connection.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is absolutely one of the goals of the refactor: to give developers fine-grained control over the boot process. While I would prefer to preserve the current DOM ready semantics, our goal is that developers can prevent the default autobooting behavior, and use the same API as the FastBoot harness to control how the app is booted.

}
Expand Down