ember-source 3.28.6 → 3.28.9

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.
@@ -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 3.28.6
8
+ * @version 3.28.9
9
9
  */
@@ -1,5 +1,5 @@
1
1
  import { setOwner } from '@ember/-internals/owner';
2
- import { dictionary, HAS_NATIVE_PROXY, HAS_NATIVE_SYMBOL, symbol, intern } from '@ember/-internals/utils';
2
+ import { dictionary, HAS_NATIVE_PROXY, symbol, intern } from '@ember/-internals/utils';
3
3
  import { assert } from '@ember/debug';
4
4
  import { assign } from '@ember/polyfills';
5
5
  import { DEBUG } from '@glimmer/env';
@@ -37,6 +37,8 @@ if (DEBUG) {
37
37
  } catch (e) {// ignore
38
38
  }
39
39
  }
40
+
41
+ const deprecatedStoreInjections = DEBUG && window.WeakSet ? new window.WeakSet() : undefined;
40
42
  /**
41
43
  A container used to instantiate and cache objects.
42
44
 
@@ -51,7 +53,6 @@ if (DEBUG) {
51
53
  @class Container
52
54
  */
53
55
 
54
-
55
56
  class Container {
56
57
  constructor(registry, options = {}) {
57
58
  this.registry = registry;
@@ -396,7 +397,13 @@ function injectionsFor(container, fullName) {
396
397
  let [type] = fullName.split(':');
397
398
  let typeInjections = registry.getTypeInjections(type);
398
399
  let injections = registry.getInjections(fullName);
399
- return buildInjections(container, typeInjections, injections);
400
+ let result = buildInjections(container, typeInjections, injections);
401
+
402
+ if (DEBUG && deprecatedStoreInjections && type === 'route' && result.injections.store) {
403
+ deprecatedStoreInjections.add(result.injections.store);
404
+ }
405
+
406
+ return result;
400
407
  }
401
408
 
402
409
  function destroyDestroyables(container) {
@@ -448,11 +455,6 @@ class FactoryManager {
448
455
  this.normalizedName = normalizedName;
449
456
  this.madeToString = undefined;
450
457
  this.injections = undefined;
451
- setFactoryFor(this, this);
452
-
453
- if (isInstantiatable(container, fullName) && (HAS_NATIVE_SYMBOL || INIT_FACTORY in factory)) {
454
- setFactoryFor(factory, this);
455
- }
456
458
  }
457
459
 
458
460
  toString() {
@@ -1116,4 +1118,4 @@ The public API, specified on the application namespace should be considered the
1116
1118
  @private
1117
1119
  */
1118
1120
 
1119
- export { Registry, privatize, Container, getFactoryFor, setFactoryFor, INIT_FACTORY };
1121
+ export { Registry, privatize, Container, getFactoryFor, setFactoryFor, INIT_FACTORY, deprecatedStoreInjections };
@@ -1,4 +1,4 @@
1
- import { privatize as P } from '@ember/-internals/container';
1
+ import { deprecatedStoreInjections, privatize as P } from '@ember/-internals/container';
2
2
  import { addObserver, computed, defineProperty, descriptorForProperty, flushAsyncObservers, get, getProperties, isEmpty, set, setProperties } from '@ember/-internals/metal';
3
3
  import { getOwner } from '@ember/-internals/owner';
4
4
  import { A as emberA, ActionHandler, Evented, Object as EmberObject, typeOf } from '@ember/-internals/runtime';
@@ -8,7 +8,6 @@ import { ROUTER_EVENTS } from '@ember/deprecated-features';
8
8
  import { dependentKeyCompat } from '@ember/object/compat';
9
9
  import { assign } from '@ember/polyfills';
10
10
  import { once } from '@ember/runloop';
11
- import { classify } from '@ember/string';
12
11
  import { DEBUG } from '@glimmer/env';
13
12
  import { PARAMS_SYMBOL, STATE_SYMBOL } from 'router_js';
14
13
  import { calculateCacheKey, deprecateTransitionMethods, normalizeControllerQueryParams, prefixRouteNameArg, stashParamNames } from '../utils';
@@ -1999,18 +1998,17 @@ Route.reopen(ActionHandler, Evented, {
1999
1998
  get() {
2000
1999
  let owner = getOwner(this);
2001
2000
  let routeName = this.routeName;
2002
- let namespace = get(this, '_router.namespace');
2003
2001
  return {
2004
2002
  find(name, value) {
2005
2003
  let modelClass = owner.factoryFor(`model:${name}`);
2006
- assert(`You used the dynamic segment ${name}_id in your route ${routeName}, but ${namespace}.${classify(name)} did not exist and you did not override your route's \`model\` hook.`, Boolean(modelClass));
2004
+ assert(`You used the dynamic segment \`${name}_id\` in your route ` + `\`${routeName}\` for which Ember requires you provide a ` + `data-loading implementation. Commonly, that is done by ` + `adding a model hook implementation on the route ` + `(\`model({${name}_id}) {\`) or by injecting an implemention of ` + `a data store: \`@service store;\`.`, Boolean(modelClass));
2007
2005
 
2008
2006
  if (!modelClass) {
2009
2007
  return;
2010
2008
  }
2011
2009
 
2012
2010
  modelClass = modelClass.class;
2013
- assert(`${classify(name)} has no method \`find\`.`, typeof modelClass.find === 'function');
2011
+ assert(`You used the dynamic segment \`${name}_id\` in your route ` + `\`${routeName}\` for which Ember requires you provide a ` + `data-loading implementation. Commonly, that is done by ` + `adding a model hook implementation on the route ` + `(\`model({${name}_id}) {\`) or by injecting an implemention of ` + `a data store: \`@service store;\`.\n\n` + `Rarely, applications may attempt to use a legacy behavior where ` + `the model class (in this case \`${name}\`) is resolved and the ` + `\`find\` method on that class is invoked to load data. In this ` + `application, a model of \`${name}\` was found but it did not ` + `provide a \`find\` method. You should not add a \`find\` ` + `method to your model. Instead, please implement an appropriate ` + `\`model\` hook on the \`${routeName}\` route.`, typeof modelClass.find === 'function');
2014
2012
  return modelClass.find(value);
2015
2013
  }
2016
2014
 
@@ -2018,7 +2016,28 @@ Route.reopen(ActionHandler, Evented, {
2018
2016
  },
2019
2017
 
2020
2018
  set(key, value) {
2021
- defineProperty(this, key, null, value);
2019
+ if (DEBUG && (deprecatedStoreInjections === null || deprecatedStoreInjections === void 0 ? void 0 : deprecatedStoreInjections.has(value))) {
2020
+ Object.defineProperty(this, key, {
2021
+ configurable: true,
2022
+ enumerable: false,
2023
+
2024
+ get() {
2025
+ deprecate(`A value for the \`store\` property was injected onto a route via the owner API. Implicit injection via the owner API is now deprecated, please add an explicit injection for this value. If the injected value is a service, consider using the @service decorator.`, false, {
2026
+ id: 'implicit-injections',
2027
+ until: '4.0.0',
2028
+ url: 'https://deprecations.emberjs.com/v3.x/#toc_implicit-injections',
2029
+ for: 'ember-source',
2030
+ since: {
2031
+ enabled: '3.28.7'
2032
+ }
2033
+ });
2034
+ return value;
2035
+ }
2036
+
2037
+ });
2038
+ } else {
2039
+ defineProperty(this, key, null, value);
2040
+ }
2022
2041
  }
2023
2042
 
2024
2043
  }),
@@ -264,8 +264,8 @@
264
264
  }
265
265
  }
266
266
 
267
- export default class PlusOne extends Component {
268
- plusOne = invokeHelper(this, RemoteData, () => {
267
+ export default class PlusOneComponent extends Component {
268
+ plusOne = invokeHelper(this, PlusOne, () => {
269
269
  return {
270
270
  positional: [this.args.number],
271
271
  };
@@ -1 +1 @@
1
- export default "3.28.6";
1
+ export default "3.28.9";