Ember.Application and Ember.EngineInstance.boot are public (#27504)

This commit is contained in:
Mike North
2018-07-23 12:18:16 -07:00
committed by Andy
parent 4230539c0e
commit a2e4f5b348
4 changed files with 44 additions and 0 deletions
+11
View File
@@ -480,6 +480,11 @@ declare module 'ember' {
**/
Router: Router;
registry: Registry;
/**
* Initialize the application and return a promise that resolves with the `Application`
* object when the boot process is complete.
*/
boot(): Promise<Application>;
}
/**
The `ApplicationInstance` encapsulates all of the stateful aspects of a
@@ -1111,6 +1116,12 @@ declare module 'ember' {
* Unregister a factory.
*/
unregister(fullName: string): any;
/**
* Initialize the `EngineInstance` and return a promise that resolves
* with the instance itself when the boot process is complete.
*/
boot(): Promise<EngineInstance>;
}
/**
* This mixin defines the common interface implemented by enumerable objects
+6
View File
@@ -18,3 +18,9 @@ appInstance.register('some:injection', class Foo {}, {
appInstance.factoryFor('router:main');
appInstance.lookup('route:basic');
appInstance.boot();
(async function() {
await appInstance.boot();
}());
+26
View File
@@ -0,0 +1,26 @@
import EngineInstance from '@ember/engine/instance';
const engineInstance = EngineInstance.create();
engineInstance.register('some:injection', class Foo {});
engineInstance.register('some:injection', class Foo {}, {
singleton: true,
});
engineInstance.register('some:injection', class Foo {}, {
instantiate: false,
});
engineInstance.register('some:injection', class Foo {}, {
singleton: false,
instantiate: true,
});
engineInstance.factoryFor('router:main');
engineInstance.lookup('route:basic');
engineInstance.boot();
(async function() {
await engineInstance.boot();
}());
+1
View File
@@ -23,6 +23,7 @@
"test/lib/assert.ts",
"test/application.ts",
"test/application-instance.ts",
"test/engine-instance.ts",
"test/ember-tests.ts",
"test/error.ts",
"test/event.ts",