ember-source 3.28.4 → 3.28.8
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.
- package/CHANGELOG.md +17 -0
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +2 -2
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +1 -1
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +46 -12
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/container/index.js +11 -4
- package/dist/packages/@ember/-internals/routing/lib/system/route.js +25 -6
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +1 -2
- package/dist/packages/ember/version.js +1 -1
- package/docs/data.json +68 -68
- package/package.json +7 -4
package/dist/header/license.js
CHANGED
|
@@ -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
|
-
|
|
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) {
|
|
@@ -450,7 +457,7 @@ class FactoryManager {
|
|
|
450
457
|
this.injections = undefined;
|
|
451
458
|
setFactoryFor(this, this);
|
|
452
459
|
|
|
453
|
-
if (
|
|
460
|
+
if (isInstantiatable(container, fullName) && (HAS_NATIVE_SYMBOL || INIT_FACTORY in factory)) {
|
|
454
461
|
setFactoryFor(factory, this);
|
|
455
462
|
}
|
|
456
463
|
}
|
|
@@ -1116,4 +1123,4 @@ The public API, specified on the application namespace should be considered the
|
|
|
1116
1123
|
@private
|
|
1117
1124
|
*/
|
|
1118
1125
|
|
|
1119
|
-
export { Registry, privatize, Container, getFactoryFor, setFactoryFor, INIT_FACTORY };
|
|
1126
|
+
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
|
|
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(
|
|
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
|
-
|
|
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
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default "3.28.
|
|
1
|
+
export default "3.28.8";
|