ember-source 4.1.0-alpha.2 → 4.1.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/blueprints/initializer/files/__root__/initializers/__name__.js +0 -1
  3. package/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.js +0 -1
  4. package/build-metadata.json +3 -3
  5. package/dist/ember-template-compiler.js +25 -274
  6. package/dist/ember-template-compiler.map +1 -1
  7. package/dist/ember-testing.js +4 -1
  8. package/dist/ember-testing.map +1 -1
  9. package/dist/ember.debug.js +227 -1338
  10. package/dist/ember.debug.map +1 -1
  11. package/dist/header/license.js +1 -1
  12. package/dist/header/loader.js +1 -0
  13. package/dist/packages/@ember/-internals/container/index.js +17 -183
  14. package/dist/packages/@ember/-internals/environment/index.js +0 -12
  15. package/dist/packages/@ember/-internals/extension-support/lib/container_debug_adapter.js +7 -0
  16. package/dist/packages/@ember/-internals/glimmer/index.js +34 -71
  17. package/dist/packages/@ember/-internals/metal/index.js +65 -2
  18. package/dist/packages/@ember/-internals/routing/lib/ext/controller.js +1 -0
  19. package/dist/packages/@ember/-internals/routing/lib/services/router.js +16 -8
  20. package/dist/packages/@ember/-internals/routing/lib/system/route.js +2 -1
  21. package/dist/packages/@ember/-internals/routing/lib/system/router.js +10 -45
  22. package/dist/packages/@ember/-internals/runtime/lib/system/core_object.js +4 -90
  23. package/dist/packages/@ember/-internals/views/index.js +0 -1
  24. package/dist/packages/@ember/-internals/views/lib/system/event_dispatcher.js +22 -72
  25. package/dist/packages/@ember/application/instance.js +1 -22
  26. package/dist/packages/@ember/application/lib/application.js +7 -24
  27. package/dist/packages/@ember/canary-features/index.js +4 -2
  28. package/dist/packages/@ember/deprecated-features/index.js +0 -3
  29. package/dist/packages/@ember/engine/index.js +1 -5
  30. package/dist/packages/@ember/engine/instance.js +0 -4
  31. package/dist/packages/@ember/object/lib/computed/computed_macros.js +0 -373
  32. package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +0 -351
  33. package/dist/packages/@ember/service/index.js +19 -5
  34. package/dist/packages/@glimmer/tracking/index.js +1 -1
  35. package/dist/packages/ember/index.js +2 -3
  36. package/dist/packages/ember/version.js +1 -1
  37. package/dist/packages/ember-testing/lib/adapters/qunit.js +1 -0
  38. package/docs/data.json +326 -368
  39. package/lib/index.js +11 -48
  40. package/package.json +33 -33
  41. package/dist/packages/@ember/-internals/views/lib/system/jquery.js +0 -26
  42. package/dist/packages/jquery/index.js +0 -2
@@ -5,5 +5,5 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 4.1.0-alpha.2
8
+ * @version 4.1.0-alpha.6
9
9
  */
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable no-var */
2
2
  /* globals global globalThis self */
3
+ /* eslint-disable-next-line no-unused-vars */
3
4
  var define, require;
4
5
 
5
6
  (function () {
@@ -1,6 +1,6 @@
1
1
  import { setOwner } from '@ember/-internals/owner';
2
2
  import { dictionary, symbol, intern } from '@ember/-internals/utils';
3
- import { assert } from '@ember/debug';
3
+ import { assert, deprecate } from '@ember/debug';
4
4
  import { DEBUG } from '@glimmer/env';
5
5
 
6
6
  let leakTracking;
@@ -347,53 +347,6 @@ function instantiateFactory(container, normalizedName, fullName, options) {
347
347
  throw new Error('Could not create factory');
348
348
  }
349
349
 
350
- function processInjections(container, injections, result) {
351
- if (DEBUG) {
352
- container.registry.validateInjections(injections);
353
- }
354
-
355
- let hash = result.injections;
356
-
357
- for (let i = 0; i < injections.length; i++) {
358
- let {
359
- property,
360
- specifier
361
- } = injections[i];
362
- hash[property] = lookup(container, specifier);
363
-
364
- if (!result.isDynamic) {
365
- result.isDynamic = !isSingleton(container, specifier);
366
- }
367
- }
368
- }
369
-
370
- function buildInjections(container, typeInjections, injections) {
371
- let injectionsHash = {};
372
- setOwner(injectionsHash, container.owner);
373
- let result = {
374
- injections: injectionsHash,
375
- isDynamic: false
376
- };
377
-
378
- if (typeInjections !== undefined) {
379
- processInjections(container, typeInjections, result);
380
- }
381
-
382
- if (injections !== undefined) {
383
- processInjections(container, injections, result);
384
- }
385
-
386
- return result;
387
- }
388
-
389
- function injectionsFor(container, fullName) {
390
- let registry = container.registry;
391
- let [type] = fullName.split(':');
392
- let typeInjections = registry.getTypeInjections(type);
393
- let injections = registry.getInjections(fullName);
394
- return buildInjections(container, typeInjections, injections);
395
- }
396
-
397
350
  function destroyDestroyables(container) {
398
351
  let cache = container.cache;
399
352
  let keys = Object.keys(cache);
@@ -445,7 +398,7 @@ class FactoryManager {
445
398
  this.injections = undefined;
446
399
  setFactoryFor(this, this);
447
400
 
448
- if (factory) {
401
+ if (isInstantiatable(container, fullName)) {
449
402
  setFactoryFor(factory, this);
450
403
  }
451
404
  }
@@ -467,20 +420,9 @@ class FactoryManager {
467
420
  throw new Error(`Can not create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`);
468
421
  }
469
422
 
470
- let props = this.injections;
471
-
472
- if (props === undefined) {
473
- let {
474
- injections,
475
- isDynamic
476
- } = injectionsFor(this.container, this.normalizedName);
477
- setFactoryFor(injections, this);
478
- props = injections;
479
-
480
- if (!isDynamic) {
481
- this.injections = injections;
482
- }
483
- }
423
+ let props = {};
424
+ setOwner(props, container.owner);
425
+ setFactoryFor(props, this);
484
426
 
485
427
  if (options !== undefined) {
486
428
  props = Object.assign({}, props, options);
@@ -525,8 +467,6 @@ class Registry {
525
467
  this.fallback = options.fallback || null;
526
468
  this.resolver = options.resolver || null;
527
469
  this.registrations = dictionary(options.registrations || null);
528
- this._typeInjections = dictionary(null);
529
- this._injections = dictionary(null);
530
470
  this._localLookupCache = Object.create(null);
531
471
  this._normalizeCache = dictionary(null);
532
472
  this._resolveCache = dictionary(null);
@@ -554,18 +494,6 @@ class Registry {
554
494
  @type InheritingDict
555
495
  */
556
496
 
557
- /**
558
- @private
559
- @property _typeInjections
560
- @type InheritingDict
561
- */
562
-
563
- /**
564
- @private
565
- @property _injections
566
- @type InheritingDict
567
- */
568
-
569
497
  /**
570
498
  @private
571
499
  @property _normalizeCache
@@ -864,93 +792,27 @@ class Registry {
864
792
  return undefined;
865
793
  }
866
794
  /**
867
- Used only via `injection`.
868
- Provides a specialized form of injection, specifically enabling
869
- all objects of one type to be injected with a reference to another
870
- object.
871
- For example, provided each object of type `controller` needed a `router`.
872
- one would do the following:
873
- ```javascript
874
- let registry = new Registry();
875
- let container = registry.container();
876
- registry.register('router:main', Router);
877
- registry.register('controller:user', UserController);
878
- registry.register('controller:post', PostController);
879
- registry.typeInjection('controller', 'router', 'router:main');
880
- let user = container.lookup('controller:user');
881
- let post = container.lookup('controller:post');
882
- user.router instanceof Router; //=> true
883
- post.router instanceof Router; //=> true
884
- // both controllers share the same router
885
- user.router === post.router; //=> true
886
- ```
887
- @private
888
- @method typeInjection
889
- @param {String} type
890
- @param {String} property
891
- @param {String} fullName
892
- */
893
-
894
-
895
- typeInjection(type, property, fullName) {
896
- assert('fullName must be a proper full name', this.isValidFullName(fullName));
897
- let fullNameType = fullName.split(':')[0];
898
- assert(`Cannot inject a '${fullName}' on other ${type}(s).`, fullNameType !== type);
899
- let injections = this._typeInjections[type] || (this._typeInjections[type] = []);
900
- injections.push({
901
- property,
902
- specifier: fullName
903
- });
904
- }
905
- /**
906
- Defines injection rules.
907
- These rules are used to inject dependencies onto objects when they
908
- are instantiated.
909
- Two forms of injections are possible:
910
- * Injecting one fullName on another fullName
911
- * Injecting one fullName on a type
912
- Example:
913
- ```javascript
914
- let registry = new Registry();
915
- let container = registry.container();
916
- registry.register('source:main', Source);
917
- registry.register('model:user', User);
918
- registry.register('model:post', Post);
919
- // injecting one fullName on another fullName
920
- // eg. each user model gets a post model
921
- registry.injection('model:user', 'post', 'model:post');
922
- // injecting one fullName on another type
923
- registry.injection('model', 'source', 'source:main');
924
- let user = container.lookup('model:user');
925
- let post = container.lookup('model:post');
926
- user.source instanceof Source; //=> true
927
- post.source instanceof Source; //=> true
928
- user.post instanceof Post; //=> true
929
- // and both models share the same source
930
- user.source === post.source; //=> true
795
+ This is deprecated in favor of explicit injection of dependencies.
796
+ Reference: https://deprecations.emberjs.com/v3.x#toc_implicit-injections
931
797
  ```
932
798
  @private
933
799
  @method injection
934
800
  @param {String} factoryName
935
801
  @param {String} property
936
802
  @param {String} injectionName
803
+ @deprecated
937
804
  */
938
805
 
939
806
 
940
- injection(fullName, property, injectionName) {
941
- assert(`Invalid injectionName, expected: 'type:name' got: ${injectionName}`, this.isValidFullName(injectionName));
942
- let normalizedInjectionName = this.normalize(injectionName);
943
-
944
- if (fullName.indexOf(':') === -1) {
945
- return this.typeInjection(fullName, property, normalizedInjectionName);
946
- }
947
-
948
- assert('fullName must be a proper full name', this.isValidFullName(fullName));
949
- let normalizedName = this.normalize(fullName);
950
- let injections = this._injections[normalizedName] || (this._injections[normalizedName] = []);
951
- injections.push({
952
- property,
953
- specifier: normalizedInjectionName
807
+ injection(fullName, property) {
808
+ deprecate(`As of Ember 4.0.0, owner.inject no longer injects values into resolved instances, and calling the method has been deprecated. Since this method no longer does anything, it is fully safe to remove this injection. As an alternative to this API, you can refactor to explicitly inject \`${property}\` on \`${fullName}\`, or look it up directly using the \`getOwner\` API.`, false, {
809
+ id: 'remove-owner-inject',
810
+ until: '5.0.0',
811
+ url: 'https://deprecations.emberjs.com/v4.x#toc_implicit-injections',
812
+ for: 'ember-source',
813
+ since: {
814
+ enabled: '4.0.0'
815
+ }
954
816
  });
955
817
  }
956
818
  /**
@@ -990,34 +852,6 @@ class Registry {
990
852
  return VALID_FULL_NAME_REGEXP.test(fullName);
991
853
  }
992
854
 
993
- getInjections(fullName) {
994
- let injections = this._injections[fullName];
995
-
996
- if (this.fallback !== null) {
997
- let fallbackInjections = this.fallback.getInjections(fullName);
998
-
999
- if (fallbackInjections !== undefined) {
1000
- injections = injections === undefined ? fallbackInjections : injections.concat(fallbackInjections);
1001
- }
1002
- }
1003
-
1004
- return injections;
1005
- }
1006
-
1007
- getTypeInjections(type) {
1008
- let injections = this._typeInjections[type];
1009
-
1010
- if (this.fallback !== null) {
1011
- let fallbackInjections = this.fallback.getTypeInjections(type);
1012
-
1013
- if (fallbackInjections !== undefined) {
1014
- injections = injections === undefined ? fallbackInjections : injections.concat(fallbackInjections);
1015
- }
1016
- }
1017
-
1018
- return injections;
1019
- }
1020
-
1021
855
  }
1022
856
 
1023
857
  if (DEBUG) {
@@ -145,18 +145,6 @@ const ENV = {
145
145
  */
146
146
  _DEBUG_RENDER_TREE: DEBUG,
147
147
 
148
- /**
149
- Whether the app is using jQuery. See RFC #294.
150
- This is not intended to be set directly, as the implementation may change in
151
- the future. Use `@ember/optional-features` instead.
152
- @property _JQUERY_INTEGRATION
153
- @for EmberENV
154
- @type Boolean
155
- @default true
156
- @private
157
- */
158
- _JQUERY_INTEGRATION: true,
159
-
160
148
  /**
161
149
  Whether the app defaults to using async observers.
162
150
  This is not intended to be set directly, as the implementation may change in
@@ -1,5 +1,6 @@
1
1
  import { classify, dasherize } from '@ember/string';
2
2
  import { A as emberA, typeOf, Namespace, Object as EmberObject } from '@ember/-internals/runtime';
3
+ import { getOwner } from '@ember/-internals/owner';
3
4
  /**
4
5
  @module @ember/debug
5
6
  */
@@ -40,6 +41,12 @@ import { A as emberA, typeOf, Namespace, Object as EmberObject } from '@ember/-i
40
41
  */
41
42
 
42
43
  export default EmberObject.extend({
44
+ init() {
45
+ this._super(...arguments);
46
+
47
+ this.resolver = getOwner(this).lookup('resolver-for-debugging:main');
48
+ },
49
+
43
50
  /**
44
51
  The resolver instance of the application
45
52
  being debugged. This property will be injected
@@ -19,7 +19,7 @@ export { DOMChanges, DOMTreeConstruction, isSerializationFirstNode } from '@glim
19
19
  import { CoreObject, TargetActionSupport, FrameworkObject, _contentFor, isArray } from '@ember/-internals/runtime';
20
20
  import { hasDOM } from '@ember/-internals/browser-environment';
21
21
  import { getEngineParent } from '@ember/engine';
22
- import { inject } from '@ember/service';
22
+ import { service } from '@ember/service';
23
23
  import { action } from '@ember/object';
24
24
  import { ENV } from '@ember/-internals/environment';
25
25
  import { getFactoryFor, privatize } from '@ember/-internals/container';
@@ -452,7 +452,7 @@ const ACTIONS = new _WeakSet();
452
452
 
453
453
  ```app/controllers/application.js
454
454
  import Controller from '@ember/controller';
455
- import { inject as service } from '@ember/service';
455
+ import { service } from '@ember/service';
456
456
 
457
457
  export default class extends Controller {
458
458
  @service someService;
@@ -1743,34 +1743,6 @@ const Component = CoreView.extend(ChildViewsSupport, ViewStateSupport, ClassName
1743
1743
  assert( // tslint:disable-next-line:max-line-length
1744
1744
  `You can not define \`${eventNames}\` function(s) to handle DOM event in the \`${this}\` tagless component since it doesn't have any DOM element.`, !eventNames.length);
1745
1745
  }
1746
-
1747
- deprecate(`${this}: Using \`mouseEnter\` event handler methods in components has been deprecated.`, this.mouseEnter === undefined, {
1748
- id: 'ember-views.event-dispatcher.mouseenter-leave-move',
1749
- until: '4.0.0',
1750
- url: 'https://deprecations.emberjs.com/v3.x#toc_component-mouseenter-leave-move',
1751
- for: 'ember-source',
1752
- since: {
1753
- enabled: '3.13.0-beta.1'
1754
- }
1755
- });
1756
- deprecate(`${this}: Using \`mouseLeave\` event handler methods in components has been deprecated.`, this.mouseLeave === undefined, {
1757
- id: 'ember-views.event-dispatcher.mouseenter-leave-move',
1758
- until: '4.0.0',
1759
- url: 'https://deprecations.emberjs.com/v3.x#toc_component-mouseenter-leave-move',
1760
- for: 'ember-source',
1761
- since: {
1762
- enabled: '3.13.0-beta.1'
1763
- }
1764
- });
1765
- deprecate(`${this}: Using \`mouseMove\` event handler methods in components has been deprecated.`, this.mouseMove === undefined, {
1766
- id: 'ember-views.event-dispatcher.mouseenter-leave-move',
1767
- until: '4.0.0',
1768
- url: 'https://deprecations.emberjs.com/v3.x#toc_component-mouseenter-leave-move',
1769
- for: 'ember-source',
1770
- since: {
1771
- enabled: '3.13.0-beta.1'
1772
- }
1773
- });
1774
1746
  },
1775
1747
 
1776
1748
  get _dispatcher() {
@@ -2047,8 +2019,11 @@ setInternalComponentManager(CURLY_COMPONENT_MANAGER, Component);
2047
2019
  deprecate('Reopening the Ember.Component super class itself is deprecated. ' + 'Consider alternatives such as installing event listeners on ' + 'the document or add the customizations to specific subclasses.', false, {
2048
2020
  id: 'ember.component.reopen',
2049
2021
  for: 'ember-source',
2050
- since: {},
2051
- until: '4.0.0'
2022
+ since: {
2023
+ enabled: '4.0.0'
2024
+ },
2025
+ url: 'https://deprecations.emberjs.com/v4.x#toc_ember-component-reopen',
2026
+ until: '5.0.0'
2052
2027
  });
2053
2028
  Component._wasReopened = true;
2054
2029
  }
@@ -2065,8 +2040,11 @@ setInternalComponentManager(CURLY_COMPONENT_MANAGER, Component);
2065
2040
  deprecate('Reopening the Ember.Component super class itself is deprecated. ' + 'Consider alternatives such as installing event listeners on ' + 'the document or add the customizations to specific subclasses.', false, {
2066
2041
  id: 'ember.component.reopen',
2067
2042
  for: 'ember-source',
2068
- since: {},
2069
- until: '4.0.0'
2043
+ url: 'https://deprecations.emberjs.com/v4.x#toc_ember-component-reopen',
2044
+ since: {
2045
+ enabled: '4.0.0'
2046
+ },
2047
+ until: '5.0.0'
2070
2048
  });
2071
2049
  Component._wasReopened = true;
2072
2050
  }
@@ -3031,7 +3009,7 @@ const LinkComponent = Component.extend({
3031
3009
  this.on(eventName, this, this._invoke);
3032
3010
  },
3033
3011
 
3034
- _routing: inject('-routing'),
3012
+ _routing: service('-routing'),
3035
3013
  _currentRoute: alias('_routing.currentRouteName'),
3036
3014
  _currentRouterState: alias('_routing.currentState'),
3037
3015
  _targetRouterState: alias('_routing.targetState'),
@@ -4733,7 +4711,7 @@ let Helper = FrameworkObject.extend({
4733
4711
  session service changes:
4734
4712
  ```app/helpers/current-user-email.js
4735
4713
  import Helper from '@ember/component/helper'
4736
- import { inject as service } from '@ember/service'
4714
+ import { service } from '@ember/service'
4737
4715
  import { observer } from '@ember/object'
4738
4716
  export default Helper.extend({
4739
4717
  session: service(),
@@ -6409,17 +6387,7 @@ class ActionModifierManager {
6409
6387
  }
6410
6388
 
6411
6389
  let actionId = uuid();
6412
- let actionState = new ActionState(element, owner, actionId, actionArgs, named, positional);
6413
- deprecate(`Using the \`{{action}}\` modifier with \`${actionState.eventName}\` events has been deprecated.`, actionState.eventName !== 'mouseEnter' && actionState.eventName !== 'mouseLeave' && actionState.eventName !== 'mouseMove', {
6414
- id: 'ember-views.event-dispatcher.mouseenter-leave-move',
6415
- until: '4.0.0',
6416
- url: 'https://deprecations.emberjs.com/v3.x#toc_action-mouseenter-leave-move',
6417
- for: 'ember-source',
6418
- since: {
6419
- enabled: '3.13.0-beta.1'
6420
- }
6421
- });
6422
- return actionState;
6390
+ return new ActionState(element, owner, actionId, actionArgs, named, positional);
6423
6391
  }
6424
6392
 
6425
6393
  getDebugName() {
@@ -7277,7 +7245,7 @@ class Renderer {
7277
7245
  this._destroyed = false;
7278
7246
  this._owner = owner;
7279
7247
  this._rootTemplate = rootTemplate(owner);
7280
- this._viewRegistry = viewRegistry;
7248
+ this._viewRegistry = viewRegistry || owner.lookup('-view-registry:main');
7281
7249
  this._roots = [];
7282
7250
  this._removedRoots = [];
7283
7251
  this._builder = builder;
@@ -7295,12 +7263,13 @@ class Renderer {
7295
7263
 
7296
7264
  static create(props) {
7297
7265
  let {
7298
- document,
7299
- env,
7300
- rootTemplate,
7301
- _viewRegistry,
7302
- builder
7266
+ _viewRegistry
7303
7267
  } = props;
7268
+ let document = getOwner(props).lookup('service:-document');
7269
+ let env = getOwner(props).lookup('-environment:main');
7270
+ let owner = getOwner(props);
7271
+ let rootTemplate = owner.lookup(privatize`template:-root`);
7272
+ let builder = owner.lookup('service:-dom-builder');
7304
7273
  return new this(getOwner(props), document, env, rootTemplate, _viewRegistry, builder);
7305
7274
  }
7306
7275
 
@@ -7858,7 +7827,7 @@ class LinkTo extends InternalComponent {
7858
7827
 
7859
7828
  }
7860
7829
 
7861
- __decorate$3([inject('-routing')], LinkTo.prototype, "routing", void 0);
7830
+ __decorate$3([service('-routing')], LinkTo.prototype, "routing", void 0);
7862
7831
 
7863
7832
  __decorate$3([action], LinkTo.prototype, "click", null); // Deprecated features
7864
7833
 
@@ -8039,6 +8008,7 @@ __decorate$3([action], LinkTo.prototype, "click", null); // Deprecated features
8039
8008
  deprecate('Passing the `@disabledWhen` argument to <LinkTo> is deprecated. ' + 'Use the `@disabled` argument instead.', false, {
8040
8009
  id: 'ember.link-to.disabled-when',
8041
8010
  for: 'ember-source',
8011
+ url: 'https://deprecations.emberjs.com/v4.x#toc_ember-link-to-disabled-when',
8042
8012
  since: {},
8043
8013
  until: '4.0.0'
8044
8014
  });
@@ -8060,6 +8030,7 @@ __decorate$3([action], LinkTo.prototype, "click", null); // Deprecated features
8060
8030
  deprecate('Passing the `@disabledWhen` argument to <LinkTo> is deprecated. ' + 'Use the `@disabled` argument instead.', false, {
8061
8031
  id: 'ember.link-to.disabled-when',
8062
8032
  for: 'ember-source',
8033
+ url: 'https://deprecations.emberjs.com/v4.x#toc_ember-link-to-disabled-when',
8063
8034
  since: {},
8064
8035
  until: '4.0.0'
8065
8036
  });
@@ -8163,10 +8134,11 @@ var OutletTemplate = templateFactory({
8163
8134
  const TOP_LEVEL_NAME = '-top-level';
8164
8135
  const TOP_LEVEL_OUTLET = 'main';
8165
8136
  class OutletView {
8166
- constructor(_environment, owner, template) {
8137
+ constructor(_environment, owner, template, namespace) {
8167
8138
  this._environment = _environment;
8168
8139
  this.owner = owner;
8169
8140
  this.template = template;
8141
+ this.namespace = namespace;
8170
8142
  let outletStateTag = createTag();
8171
8143
  let outletState = {
8172
8144
  outlets: {
@@ -8218,12 +8190,13 @@ class OutletView {
8218
8190
 
8219
8191
  static create(options) {
8220
8192
  let {
8221
- _environment,
8193
+ environment: _environment,
8194
+ application: namespace,
8222
8195
  template: templateFactory$$1
8223
8196
  } = options;
8224
8197
  let owner = getOwner(options);
8225
8198
  let template = templateFactory$$1(owner);
8226
- return new OutletView(_environment, owner, template);
8199
+ return new OutletView(_environment, owner, template, namespace);
8227
8200
  }
8228
8201
 
8229
8202
  appendTo(selector) {
@@ -8254,19 +8227,14 @@ class OutletView {
8254
8227
  }
8255
8228
 
8256
8229
  function setupApplicationRegistry(registry) {
8257
- registry.injection('renderer', 'env', '-environment:main'); // because we are using injections we can't use instantiate false
8230
+ // because we are using injections we can't use instantiate false
8258
8231
  // we need to use bind() to copy the function so factory for
8259
8232
  // association won't leak
8260
-
8261
8233
  registry.register('service:-dom-builder', {
8262
- create({
8263
- bootOptions
8264
- }) {
8265
- let {
8266
- _renderMode
8267
- } = bootOptions;
8234
+ create(props) {
8235
+ let env = getOwner(props).lookup('-environment:main');
8268
8236
 
8269
- switch (_renderMode) {
8237
+ switch (env._renderMode) {
8270
8238
  case 'serialize':
8271
8239
  return serializeBuilder.bind(null);
8272
8240
 
@@ -8279,12 +8247,8 @@ function setupApplicationRegistry(registry) {
8279
8247
  }
8280
8248
 
8281
8249
  });
8282
- registry.injection('service:-dom-builder', 'bootOptions', '-environment:main');
8283
- registry.injection('renderer', 'builder', 'service:-dom-builder');
8284
8250
  registry.register(privatize`template:-root`, RootTemplate);
8285
- registry.injection('renderer', 'rootTemplate', privatize`template:-root`);
8286
8251
  registry.register('renderer:-dom', Renderer);
8287
- registry.injection('renderer', 'document', 'service:-document');
8288
8252
  }
8289
8253
  function setupEngineRegistry(registry) {
8290
8254
  registry.optionsForType('template', {
@@ -8292,7 +8256,6 @@ function setupEngineRegistry(registry) {
8292
8256
  });
8293
8257
  registry.register('view:-outlet', OutletView);
8294
8258
  registry.register('template:-outlet', OutletTemplate);
8295
- registry.injection('view:-outlet', 'template', 'template:-outlet');
8296
8259
  registry.optionsForType('helper', {
8297
8260
  instantiate: false
8298
8261
  });
@@ -2241,7 +2241,7 @@ function isEmpty(obj) {
2241
2241
  return none;
2242
2242
  }
2243
2243
 
2244
- if (typeof obj.size === 'number') {
2244
+ if (typeof obj.unknownProperty !== 'function' && typeof obj.size === 'number') {
2245
2245
  return !obj.size;
2246
2246
  }
2247
2247
 
@@ -3478,6 +3478,69 @@ class TrackedDescriptor {
3478
3478
 
3479
3479
  }
3480
3480
 
3481
+ // NOTE: copied from: https://github.com/glimmerjs/glimmer.js/pull/358
3482
+ /**
3483
+ * @decorator
3484
+ *
3485
+ * The `@cached` decorator can be used on getters in order to cache the return
3486
+ * value of the getter. This is useful when a getter is expensive and used very
3487
+ * often.
3488
+ *
3489
+ *
3490
+ * @example
3491
+ *
3492
+ * in this guest list class, we have the `sortedGuests`
3493
+ * getter that sorts the guests alphabetically:
3494
+ *
3495
+ * ```js
3496
+ * import { tracked } from '@glimmer/tracking';
3497
+ *
3498
+ * class GuestList {
3499
+ * @tracked guests = ['Zoey', 'Tomster'];
3500
+ *
3501
+ * get sortedGuests() {
3502
+ * return this.guests.slice().sort()
3503
+ * }
3504
+ * }
3505
+ * ```
3506
+ *
3507
+ * Every time `sortedGuests` is accessed, a new array will be created and sorted,
3508
+ * because JavaScript getters do not cache by default. When the guest list is
3509
+ * small, like the one in the example, this is not a problem. However, if the guest
3510
+ * list were to grow very large, it would mean that we would be doing a large
3511
+ * amount of work each time we accessed `sortedGetters`. With `@cached`, we can
3512
+ * cache the value instead:
3513
+ *
3514
+ * ```js
3515
+ * import { tracked, cached } from '@glimmer/tracking';
3516
+ *
3517
+ * class GuestList {
3518
+ * @tracked guests = ['Zoey', 'Tomster'];
3519
+ *
3520
+ * @cached
3521
+ * get sortedGuests() {
3522
+ * return this.guests.slice().sort()
3523
+ * }
3524
+ * }
3525
+ * ```
3526
+ *
3527
+ * Now the `sortedGuests` getter will be cached based on _autotracking_. It will
3528
+ * only rerun and create a new sorted array when the `guests` tracked property is
3529
+ * updated.
3530
+ *
3531
+ * In general, you should avoid using `@cached` unless you have confirmed that the
3532
+ * getter you are decorating is computationally expensive. `@cached` adds a small
3533
+ * amount of overhead to the getter, making it more expensive. While this overhead
3534
+ * is small, if `@cached` is overused it can add up to a large impact overall in
3535
+ * your app. Many getters and tracked properties are only accessed once, rendered,
3536
+ * and then never rerendered, so adding `@cached` when it is unnecessary can
3537
+ * negatively impact performance.
3538
+ */
3539
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3540
+
3541
+ const cached = (...args) => {
3542
+ };
3543
+
3481
3544
  /**
3482
3545
  Ember uses caching based on trackable values to avoid updating large portions
3483
3546
  of the application. This caching is exposed via a cache primitive that can be
@@ -3600,4 +3663,4 @@ class TrackedDescriptor {
3600
3663
  @public
3601
3664
  */
3602
3665
 
3603
- export { computed, autoComputed, isComputed, ComputedProperty, getCachedValueFor, alias, deprecateProperty, PROXY_CONTENT, _getPath, get, _getProp, set, _setProp, trySet, objectAt, replace, replaceInNativeArray, addArrayObserver, removeArrayObserver, arrayContentWillChange, arrayContentDidChange, eachProxyArrayWillChange, eachProxyArrayDidChange, addListener, hasListeners, on, removeListener, sendEvent, isNone, isEmpty, isBlank, isPresent, beginPropertyChanges, changeProperties, endPropertyChanges, notifyPropertyChange, PROPERTY_DID_CHANGE, defineProperty, isElementDescriptor, nativeDescDecorator, descriptorForDecorator, descriptorForProperty, isClassicDecorator, setClassicDecorator, LIBRARIES as libraries, Libraries, getProperties, setProperties, expandProperties, ASYNC_OBSERVERS, SYNC_OBSERVERS, addObserver, activateObserver, removeObserver, flushAsyncObservers, Mixin, mixin, observer, applyMixin, inject, DEBUG_INJECTION_FUNCTIONS, tagForProperty, tagForObject, markObjectAsDirty, tracked, TrackedDescriptor, NAMESPACES, NAMESPACES_BY_ID, addNamespace, findNamespace, findNamespaces, processNamespace, processAllNamespaces, removeNamespace, isSearchDisabled as isNamespaceSearchDisabled, setSearchDisabled as setNamespaceSearchDisabled };
3666
+ export { computed, autoComputed, isComputed, ComputedProperty, getCachedValueFor, alias, deprecateProperty, PROXY_CONTENT, _getPath, get, _getProp, set, _setProp, trySet, objectAt, replace, replaceInNativeArray, addArrayObserver, removeArrayObserver, arrayContentWillChange, arrayContentDidChange, eachProxyArrayWillChange, eachProxyArrayDidChange, addListener, hasListeners, on, removeListener, sendEvent, isNone, isEmpty, isBlank, isPresent, beginPropertyChanges, changeProperties, endPropertyChanges, notifyPropertyChange, PROPERTY_DID_CHANGE, defineProperty, isElementDescriptor, nativeDescDecorator, descriptorForDecorator, descriptorForProperty, isClassicDecorator, setClassicDecorator, LIBRARIES as libraries, Libraries, getProperties, setProperties, expandProperties, ASYNC_OBSERVERS, SYNC_OBSERVERS, addObserver, activateObserver, removeObserver, flushAsyncObservers, Mixin, mixin, observer, applyMixin, inject, DEBUG_INJECTION_FUNCTIONS, tagForProperty, tagForObject, markObjectAsDirty, tracked, TrackedDescriptor, cached, NAMESPACES, NAMESPACES_BY_ID, addNamespace, findNamespace, findNamespaces, processNamespace, processAllNamespaces, removeNamespace, isSearchDisabled as isNamespaceSearchDisabled, setSearchDisabled as setNamespaceSearchDisabled };
@@ -197,6 +197,7 @@ ControllerMixin.reopen({
197
197
  @method replaceRoute
198
198
  @return {Transition} the transition object associated with this
199
199
  attempted transition
200
+ @deprecated Use replaceWith from the Router service instead.
200
201
  @public
201
202
  */
202
203
  replaceRoute(...args) {