Skip to content

Commit

Permalink
Remove registering unncessary component
Browse files Browse the repository at this point in the history
`-environment:main` is always instance-specific (because it is
dependent on the boot options that are specified when creating the
instance). Therefore it is unncessary (and confusing) to register it on
the `Application` just to have it always overriden by something else on
the `ApplicationInstance`.
  • Loading branch information
chancancode committed Nov 10, 2015
1 parent 1bfa8dd commit 3aa1b62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 2 additions & 0 deletions packages/ember-application/lib/system/application-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ let ApplicationInstance = EmberObject.extend(RegistryProxy, ContainerProxy, {
let environment = options.toEnvironment();

registry.register('-environment:main', environment, { instantiate: false });
registry.injection('view', '_environment', '-environment:main');
registry.injection('route', '_environment', '-environment:main');

registry.register('renderer:-dom', {
create() {
Expand Down
6 changes: 0 additions & 6 deletions packages/ember-application/lib/system/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -1352,12 +1352,6 @@ Application.reopenClass({
registry.optionsForType('view', { singleton: false });
registry.optionsForType('template', { instantiate: false });

if (isEnabled('ember-application-visit')) {
registry.register('-environment:main', environment, { instantiate: false });
registry.injection('view', '_environment', '-environment:main');
registry.injection('route', '_environment', '-environment:main');
}

registry.register('application:main', namespace, { instantiate: false });

registry.register('controller:basic', Controller, { instantiate: false });
Expand Down

0 comments on commit 3aa1b62

Please sign in to comment.