ember-source 4.0.0-beta.6 → 4.1.0-alpha.5

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.
@@ -6,11 +6,13 @@
6
6
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
7
  * @license Licensed under MIT license
8
8
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
- * @version 4.0.0-beta.6
9
+ * @version 4.1.0-alpha.5
10
10
  */
11
11
  /* eslint-disable no-var */
12
12
 
13
13
  /* globals global globalThis self */
14
+
15
+ /* eslint-disable-next-line no-unused-vars */
14
16
  var define, require;
15
17
 
16
18
  (function () {
@@ -2614,7 +2616,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
2614
2616
 
2615
2617
  ```app/controllers/application.js
2616
2618
  import Controller from '@ember/controller';
2617
- import { inject as service } from '@ember/service';
2619
+ import { service } from '@ember/service';
2618
2620
 
2619
2621
  export default class extends Controller {
2620
2622
  @service someService;
@@ -5215,7 +5217,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
5215
5217
  this.on(eventName, this, this._invoke);
5216
5218
  },
5217
5219
 
5218
- _routing: (0, _service.inject)('-routing'),
5220
+ _routing: (0, _service.service)('-routing'),
5219
5221
  _currentRoute: (0, _metal.alias)('_routing.currentRouteName'),
5220
5222
  _currentRouterState: (0, _metal.alias)('_routing.currentState'),
5221
5223
  _targetRouterState: (0, _metal.alias)('_routing.targetState'),
@@ -6930,7 +6932,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6930
6932
  session service changes:
6931
6933
  ```app/helpers/current-user-email.js
6932
6934
  import Helper from '@ember/component/helper'
6933
- import { inject as service } from '@ember/service'
6935
+ import { service } from '@ember/service'
6934
6936
  import { observer } from '@ember/object'
6935
6937
  export default Helper.extend({
6936
6938
  session: service(),
@@ -10096,7 +10098,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
10096
10098
 
10097
10099
  }
10098
10100
 
10099
- __decorate$3([(0, _service.inject)('-routing')], LinkTo.prototype, "routing", void 0);
10101
+ __decorate$3([(0, _service.service)('-routing')], LinkTo.prototype, "routing", void 0);
10100
10102
 
10101
10103
  __decorate$3([_object.action], LinkTo.prototype, "click", null); // Deprecated features
10102
10104
 
@@ -11440,7 +11442,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
11440
11442
  return _validator.isConst;
11441
11443
  }
11442
11444
  });
11443
- _exports.NAMESPACES_BY_ID = _exports.NAMESPACES = _exports.TrackedDescriptor = _exports.DEBUG_INJECTION_FUNCTIONS = _exports.Mixin = _exports.SYNC_OBSERVERS = _exports.ASYNC_OBSERVERS = _exports.Libraries = _exports.libraries = _exports.PROPERTY_DID_CHANGE = _exports.PROXY_CONTENT = _exports.ComputedProperty = void 0;
11445
+ _exports.NAMESPACES_BY_ID = _exports.NAMESPACES = _exports.cached = _exports.TrackedDescriptor = _exports.DEBUG_INJECTION_FUNCTIONS = _exports.Mixin = _exports.SYNC_OBSERVERS = _exports.ASYNC_OBSERVERS = _exports.Libraries = _exports.libraries = _exports.PROPERTY_DID_CHANGE = _exports.PROXY_CONTENT = _exports.ComputedProperty = void 0;
11444
11446
 
11445
11447
  /**
11446
11448
  @module @ember/object
@@ -13753,7 +13755,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13753
13755
  return none;
13754
13756
  }
13755
13757
 
13756
- if (typeof obj.size === 'number') {
13758
+ if (typeof obj.unknownProperty !== 'function' && typeof obj.size === 'number') {
13757
13759
  return !obj.size;
13758
13760
  }
13759
13761
 
@@ -15025,7 +15027,71 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
15025
15027
  this._set.call(obj, value);
15026
15028
  }
15027
15029
 
15028
- }
15030
+ } // NOTE: copied from: https://github.com/glimmerjs/glimmer.js/pull/358
15031
+
15032
+ /**
15033
+ * @decorator
15034
+ *
15035
+ * The `@cached` decorator can be used on getters in order to cache the return
15036
+ * value of the getter. This is useful when a getter is expensive and used very
15037
+ * often.
15038
+ *
15039
+ *
15040
+ * @example
15041
+ *
15042
+ * in this guest list class, we have the `sortedGuests`
15043
+ * getter that sorts the guests alphabetically:
15044
+ *
15045
+ * ```js
15046
+ * import { tracked } from '@glimmer/tracking';
15047
+ *
15048
+ * class GuestList {
15049
+ * @tracked guests = ['Zoey', 'Tomster'];
15050
+ *
15051
+ * get sortedGuests() {
15052
+ * return this.guests.slice().sort()
15053
+ * }
15054
+ * }
15055
+ * ```
15056
+ *
15057
+ * Every time `sortedGuests` is accessed, a new array will be created and sorted,
15058
+ * because JavaScript getters do not cache by default. When the guest list is
15059
+ * small, like the one in the example, this is not a problem. However, if the guest
15060
+ * list were to grow very large, it would mean that we would be doing a large
15061
+ * amount of work each time we accessed `sortedGetters`. With `@cached`, we can
15062
+ * cache the value instead:
15063
+ *
15064
+ * ```js
15065
+ * import { tracked, cached } from '@glimmer/tracking';
15066
+ *
15067
+ * class GuestList {
15068
+ * @tracked guests = ['Zoey', 'Tomster'];
15069
+ *
15070
+ * @cached
15071
+ * get sortedGuests() {
15072
+ * return this.guests.slice().sort()
15073
+ * }
15074
+ * }
15075
+ * ```
15076
+ *
15077
+ * Now the `sortedGuests` getter will be cached based on _autotracking_. It will
15078
+ * only rerun and create a new sorted array when the `guests` tracked property is
15079
+ * updated.
15080
+ *
15081
+ * In general, you should avoid using `@cached` unless you have confirmed that the
15082
+ * getter you are decorating is computationally expensive. `@cached` adds a small
15083
+ * amount of overhead to the getter, making it more expensive. While this overhead
15084
+ * is small, if `@cached` is overused it can add up to a large impact overall in
15085
+ * your app. Many getters and tracked properties are only accessed once, rendered,
15086
+ * and then never rerendered, so adding `@cached` when it is unnecessary can
15087
+ * negatively impact performance.
15088
+ */
15089
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15090
+
15091
+
15092
+ _exports.TrackedDescriptor = TrackedDescriptor;
15093
+
15094
+ var cached = (...args) => {};
15029
15095
  /**
15030
15096
  Ember uses caching based on trackable values to avoid updating large portions
15031
15097
  of the application. This caching is exposed via a cache primitive that can be
@@ -15149,7 +15215,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
15149
15215
  */
15150
15216
 
15151
15217
 
15152
- _exports.TrackedDescriptor = TrackedDescriptor;
15218
+ _exports.cached = cached;
15153
15219
  });
15154
15220
  define("@ember/-internals/overrides/index", ["exports"], function (_exports) {
15155
15221
  "use strict";
@@ -16656,7 +16722,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
16656
16722
  ```app/components/example.js
16657
16723
  import Component from '@glimmer/component';
16658
16724
  import { action } from '@ember/object';
16659
- import { inject as service } from '@ember/service';
16725
+ import { service } from '@ember/service';
16660
16726
 
16661
16727
  export default class ExampleComponent extends Component {
16662
16728
  @service router;
@@ -16706,7 +16772,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
16706
16772
  ```app/components/example.js
16707
16773
  import Component from '@glimmer/component';
16708
16774
  import { action } from '@ember/object';
16709
- import { inject as service } from '@ember/service';
16775
+ import { service } from '@ember/service';
16710
16776
  export default class extends Component {
16711
16777
  @service router;
16712
16778
  @action
@@ -16800,7 +16866,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
16800
16866
  ```
16801
16867
  ```app/components/copy-link.js
16802
16868
  import Component from '@glimmer/component';
16803
- import { inject as service } from '@ember/service';
16869
+ import { service } from '@ember/service';
16804
16870
  import { action } from '@ember/object';
16805
16871
  export default class CopyLinkComponent extends Component {
16806
16872
  @service router;
@@ -16822,7 +16888,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
16822
16888
  ```
16823
16889
  ```app/components/copy-link.js
16824
16890
  import Component from '@glimmer/component';
16825
- import { inject as service } from '@ember/service';
16891
+ import { service } from '@ember/service';
16826
16892
  import { action } from '@ember/object';
16827
16893
  export default class CopyLinkComponent extends Component {
16828
16894
  @service router;
@@ -16862,7 +16928,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
16862
16928
  In the following example, `isActive` will return `true` if the current route is `/posts`.
16863
16929
  ```app/components/posts.js
16864
16930
  import Component from '@glimmer/component';
16865
- import { inject as service } from '@ember/service';
16931
+ import { service } from '@ember/service';
16866
16932
  export default class extends Component {
16867
16933
  @service router;
16868
16934
  displayComments() {
@@ -16874,7 +16940,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
16874
16940
  assuming the post has an id of 1:
16875
16941
  ```app/components/posts.js
16876
16942
  import Component from '@glimmer/component';
16877
- import { inject as service } from '@ember/service';
16943
+ import { service } from '@ember/service';
16878
16944
  export default class extends Component {
16879
16945
  @service router;
16880
16946
  displayComments(post) {
@@ -16953,7 +17019,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
16953
17019
  application before transitioning to it.
16954
17020
  ```
16955
17021
  import Component from '@ember/component';
16956
- import { inject as service } from '@ember/service';
17022
+ import { service } from '@ember/service';
16957
17023
  export default class extends Component {
16958
17024
  @service router;
16959
17025
  path = '/';
@@ -17150,7 +17216,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
17150
17216
  Usage example:
17151
17217
  ```app/components/header.js
17152
17218
  import Component from '@glimmer/component';
17153
- import { inject as service } from '@ember/service';
17219
+ import { service } from '@ember/service';
17154
17220
  import { notEmpty } from '@ember/object/computed';
17155
17221
  export default class extends Component {
17156
17222
  @service router;
@@ -19205,7 +19271,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
19205
19271
  ```
19206
19272
  ```app/routes/application.js
19207
19273
  import Route from '@ember/routing/route';
19208
- import { inject as service } from '@ember/service';
19274
+ import { service } from '@ember/service';
19209
19275
  export default class ApplicationRoute extends Route {
19210
19276
  @service router
19211
19277
  constructor() {
@@ -31952,7 +32018,7 @@ define("@ember/application/lib/application", ["exports", "@ember/-internals/util
31952
32018
  ```
31953
32019
  ```app/routes/post.js
31954
32020
  import Route from '@ember/routing/route';
31955
- import { inject as service } from '@ember/service';
32021
+ import { service } from '@ember/service';
31956
32022
  // An example of how the (hypothetical) service is used in routes.
31957
32023
  export default class IndexRoute extends Route {
31958
32024
  @service network;
@@ -32216,7 +32282,7 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
32216
32282
  value: true
32217
32283
  });
32218
32284
  _exports.isEnabled = isEnabled;
32219
- _exports.EMBER_ROUTING_ROUTER_SERVICE_REFRESH = _exports.EMBER_DYNAMIC_HELPERS_AND_MODIFIERS = _exports.EMBER_STRICT_MODE = _exports.EMBER_MODERNIZED_BUILT_IN_COMPONENTS = _exports.EMBER_GLIMMER_INVOKE_HELPER = _exports.EMBER_GLIMMER_HELPER_MANAGER = _exports.EMBER_NAMED_BLOCKS = _exports.EMBER_IMPROVED_INSTRUMENTATION = _exports.EMBER_LIBRARIES_ISREGISTERED = _exports.FEATURES = _exports.DEFAULT_FEATURES = void 0;
32285
+ _exports.EMBER_CACHED = _exports.EMBER_ROUTING_ROUTER_SERVICE_REFRESH = _exports.EMBER_DYNAMIC_HELPERS_AND_MODIFIERS = _exports.EMBER_STRICT_MODE = _exports.EMBER_MODERNIZED_BUILT_IN_COMPONENTS = _exports.EMBER_GLIMMER_INVOKE_HELPER = _exports.EMBER_GLIMMER_HELPER_MANAGER = _exports.EMBER_NAMED_BLOCKS = _exports.EMBER_IMPROVED_INSTRUMENTATION = _exports.EMBER_LIBRARIES_ISREGISTERED = _exports.FEATURES = _exports.DEFAULT_FEATURES = void 0;
32220
32286
 
32221
32287
  /**
32222
32288
  Set `EmberENV.FEATURES` in your application's `config/environment.js` file
@@ -32229,15 +32295,16 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
32229
32295
  @public
32230
32296
  */
32231
32297
  var DEFAULT_FEATURES = {
32232
- EMBER_LIBRARIES_ISREGISTERED: false,
32233
- EMBER_IMPROVED_INSTRUMENTATION: false,
32298
+ EMBER_LIBRARIES_ISREGISTERED: null,
32299
+ EMBER_IMPROVED_INSTRUMENTATION: null,
32234
32300
  EMBER_NAMED_BLOCKS: true,
32235
32301
  EMBER_GLIMMER_HELPER_MANAGER: true,
32236
32302
  EMBER_GLIMMER_INVOKE_HELPER: true,
32237
32303
  EMBER_MODERNIZED_BUILT_IN_COMPONENTS: true,
32238
32304
  EMBER_STRICT_MODE: true,
32239
32305
  EMBER_DYNAMIC_HELPERS_AND_MODIFIERS: true,
32240
- EMBER_ROUTING_ROUTER_SERVICE_REFRESH: false
32306
+ EMBER_ROUTING_ROUTER_SERVICE_REFRESH: null,
32307
+ EMBER_CACHED: null
32241
32308
  };
32242
32309
  /**
32243
32310
  The hash of enabled Canary features. Add to this, any canary features
@@ -32307,6 +32374,8 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
32307
32374
  _exports.EMBER_DYNAMIC_HELPERS_AND_MODIFIERS = EMBER_DYNAMIC_HELPERS_AND_MODIFIERS;
32308
32375
  var EMBER_ROUTING_ROUTER_SERVICE_REFRESH = featureValue(FEATURES.EMBER_ROUTING_ROUTER_SERVICE_REFRESH);
32309
32376
  _exports.EMBER_ROUTING_ROUTER_SERVICE_REFRESH = EMBER_ROUTING_ROUTER_SERVICE_REFRESH;
32377
+ var EMBER_CACHED = featureValue(FEATURES.EMBER_CACHED);
32378
+ _exports.EMBER_CACHED = EMBER_CACHED;
32310
32379
  });
32311
32380
  define("@ember/component/checkbox", ["exports", "@ember/debug", "@ember/-internals/glimmer"], function (_exports, _debug, _glimmer) {
32312
32381
  "use strict";
@@ -38228,6 +38297,7 @@ define("@ember/service/index", ["exports", "@ember/-internals/runtime", "@ember/
38228
38297
  value: true
38229
38298
  });
38230
38299
  _exports.inject = inject;
38300
+ _exports.service = service;
38231
38301
  _exports.default = void 0;
38232
38302
 
38233
38303
  /**
@@ -38235,6 +38305,19 @@ define("@ember/service/index", ["exports", "@ember/-internals/runtime", "@ember/
38235
38305
  @public
38236
38306
  */
38237
38307
 
38308
+ /**
38309
+ @method inject
38310
+ @static
38311
+ @since 1.10.0
38312
+ @for @ember/service
38313
+ @param {String} name (optional) name of the service to inject, defaults to
38314
+ the property's name
38315
+ @return {ComputedDecorator} injection decorator instance
38316
+ @public
38317
+ */
38318
+ function inject() {
38319
+ return (0, _metal.inject)('service', ...arguments);
38320
+ }
38238
38321
  /**
38239
38322
  Creates a property that lazily looks up a service in the container. There are
38240
38323
  no restrictions as to what objects a service can be injected into.
@@ -38243,7 +38326,7 @@ define("@ember/service/index", ["exports", "@ember/-internals/runtime", "@ember/
38243
38326
 
38244
38327
  ```app/routes/application.js
38245
38328
  import Route from '@ember/routing/route';
38246
- import { inject as service } from '@ember/service';
38329
+ import { service } from '@ember/service';
38247
38330
 
38248
38331
  export default class ApplicationRoute extends Route {
38249
38332
  @service('auth') authManager;
@@ -38258,7 +38341,7 @@ define("@ember/service/index", ["exports", "@ember/-internals/runtime", "@ember/
38258
38341
 
38259
38342
  ```app/routes/application.js
38260
38343
  import Route from '@ember/routing/route';
38261
- import { inject as service } from '@ember/service';
38344
+ import { service } from '@ember/service';
38262
38345
 
38263
38346
  export default Route.extend({
38264
38347
  authManager: service('auth'),
@@ -38273,16 +38356,18 @@ define("@ember/service/index", ["exports", "@ember/-internals/runtime", "@ember/
38273
38356
  that looks up the `auth` service in the container, making it easily accessible
38274
38357
  in the `model` hook.
38275
38358
 
38276
- @method inject
38359
+ @method service
38277
38360
  @static
38278
- @since 1.10.0
38361
+ @since 4.1.0
38279
38362
  @for @ember/service
38280
38363
  @param {String} name (optional) name of the service to inject, defaults to
38281
38364
  the property's name
38282
38365
  @return {ComputedDecorator} injection decorator instance
38283
38366
  @public
38284
38367
  */
38285
- function inject() {
38368
+
38369
+
38370
+ function service() {
38286
38371
  return (0, _metal.inject)('service', ...arguments);
38287
38372
  }
38288
38373
  /**
@@ -52409,6 +52494,12 @@ define("@glimmer/tracking/index", ["exports", "@ember/-internals/metal"], functi
52409
52494
  return _metal.tracked;
52410
52495
  }
52411
52496
  });
52497
+ Object.defineProperty(_exports, "cached", {
52498
+ enumerable: true,
52499
+ get: function () {
52500
+ return _metal.cached;
52501
+ }
52502
+ });
52412
52503
  });
52413
52504
  define("@glimmer/tracking/primitives/cache", ["exports", "@ember/-internals/metal"], function (_exports, _metal) {
52414
52505
  "use strict";
@@ -56472,6 +56563,7 @@ define("ember-testing/lib/adapters/qunit", ["exports", "@ember/-internals/utils"
56472
56563
  asyncStart() {
56473
56564
  if (typeof QUnit.stop === 'function') {
56474
56565
  // very old QUnit version
56566
+ // eslint-disable-next-line qunit/no-qunit-stop
56475
56567
  QUnit.stop();
56476
56568
  } else {
56477
56569
  this.doneCallbacks.push(QUnit.config.current ? QUnit.config.current.assert.async() : null);
@@ -57866,7 +57958,7 @@ define("ember/index", ["exports", "require", "@ember/-internals/environment", "@
57866
57958
  (true && !(false) && (0, EmberDebug.assert)(`Injected properties must be created through helpers, see '${Object.keys(inject).map(k => `'inject.${k}'`).join(' or ')}'`));
57867
57959
  };
57868
57960
 
57869
- Ember.inject.service = _service.inject;
57961
+ Ember.inject.service = _service.service;
57870
57962
  Ember.inject.controller = _controller.inject;
57871
57963
  Ember.Array = _runtime.Array;
57872
57964
  Ember.Comparable = _runtime.Comparable;
@@ -58211,17 +58303,7 @@ define("ember/version", ["exports"], function (_exports) {
58211
58303
  value: true
58212
58304
  });
58213
58305
  _exports.default = void 0;
58214
- var _default = "4.0.0-beta.6";
58215
- _exports.default = _default;
58216
- });
58217
- define("jquery/index", ["exports", "@ember/-internals/views"], function (_exports, _views) {
58218
- "use strict";
58219
-
58220
- Object.defineProperty(_exports, "__esModule", {
58221
- value: true
58222
- });
58223
- _exports.default = void 0;
58224
- var _default = _views.jQuery;
58306
+ var _default = "4.1.0-alpha.5";
58225
58307
  _exports.default = _default;
58226
58308
  });
58227
58309
  define("route-recognizer", ["exports"], function (_exports) {