@ember-data/model 4.12.0-beta.0 → 4.12.0-beta.1
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/addon/-private.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as Model } from "./has-many-
|
|
2
|
-
export { E as Errors, L as LEGACY_SUPPORT, R as ManyArray, P as PromiseBelongsTo, c as PromiseManyArray, a as attr, b as belongsTo, h as hasMany } from "./has-many-
|
|
1
|
+
import { M as Model } from "./has-many-0b8d932c";
|
|
2
|
+
export { E as Errors, L as LEGACY_SUPPORT, R as ManyArray, P as PromiseBelongsTo, c as PromiseManyArray, a as attr, b as belongsTo, h as hasMany } from "./has-many-0b8d932c";
|
|
3
3
|
import { getOwner } from '@ember/application';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { macroCondition, isDevelopingApp, getOwnConfig, importSync,
|
|
1
|
+
import { macroCondition, isDevelopingApp, getOwnConfig, importSync, dependencySatisfies } from '@embroider/macros';
|
|
2
2
|
import { assert, deprecate, warn, inspect } from '@ember/debug';
|
|
3
3
|
import EmberObject, { computed, get } from '@ember/object';
|
|
4
4
|
import { recordIdentifierFor, storeFor } from '@ember-data/store';
|
|
@@ -2892,7 +2892,7 @@ class LegacySupport {
|
|
|
2892
2892
|
return [identifiers, jsonApi];
|
|
2893
2893
|
}
|
|
2894
2894
|
getManyArray(key, definition) {
|
|
2895
|
-
if (
|
|
2895
|
+
if (macroCondition(dependencySatisfies("@ember-data/json-api", "*"))) {
|
|
2896
2896
|
let manyArray = this._manyArrayCache[key];
|
|
2897
2897
|
if (!definition) {
|
|
2898
2898
|
const graphFor = importSync('@ember-data/graph/-private').graphFor;
|
|
@@ -2923,7 +2923,7 @@ class LegacySupport {
|
|
|
2923
2923
|
assert('hasMany only works with the @ember-data/json-api package');
|
|
2924
2924
|
}
|
|
2925
2925
|
fetchAsyncHasMany(key, relationship, manyArray, options) {
|
|
2926
|
-
if (
|
|
2926
|
+
if (macroCondition(dependencySatisfies("@ember-data/json-api", "*"))) {
|
|
2927
2927
|
let loadingPromise = this._relationshipPromisesCache[key];
|
|
2928
2928
|
if (loadingPromise) {
|
|
2929
2929
|
return loadingPromise;
|
|
@@ -2941,7 +2941,7 @@ class LegacySupport {
|
|
|
2941
2941
|
assert('hasMany only works with the @ember-data/json-api package');
|
|
2942
2942
|
}
|
|
2943
2943
|
reloadHasMany(key, options) {
|
|
2944
|
-
if (
|
|
2944
|
+
if (macroCondition(dependencySatisfies("@ember-data/json-api", "*"))) {
|
|
2945
2945
|
let loadingPromise = this._relationshipPromisesCache[key];
|
|
2946
2946
|
if (loadingPromise) {
|
|
2947
2947
|
return loadingPromise;
|
|
@@ -2966,7 +2966,7 @@ class LegacySupport {
|
|
|
2966
2966
|
assert(`hasMany only works with the @ember-data/json-api package`);
|
|
2967
2967
|
}
|
|
2968
2968
|
getHasMany(key, options) {
|
|
2969
|
-
if (
|
|
2969
|
+
if (macroCondition(dependencySatisfies("@ember-data/json-api", "*"))) {
|
|
2970
2970
|
const graphFor = importSync('@ember-data/graph/-private').graphFor;
|
|
2971
2971
|
const relationship = graphFor(this.store).get(this.identifier, key);
|
|
2972
2972
|
const {
|
|
@@ -3024,7 +3024,7 @@ class LegacySupport {
|
|
|
3024
3024
|
referenceFor(kind, name) {
|
|
3025
3025
|
let reference = this.references[name];
|
|
3026
3026
|
if (!reference) {
|
|
3027
|
-
if (!
|
|
3027
|
+
if (macroCondition(!dependencySatisfies("@ember-data/json-api", "*"))) {
|
|
3028
3028
|
// TODO @runspired while this feels odd, it is not a regression in capability because we do
|
|
3029
3029
|
// not today support references pulling from RecordDatas other than our own
|
|
3030
3030
|
// because of the intimate API access involved. This is something we will need to redesign.
|
|
@@ -3051,7 +3051,7 @@ class LegacySupport {
|
|
|
3051
3051
|
return reference;
|
|
3052
3052
|
}
|
|
3053
3053
|
_findHasManyByJsonApiResource(resource, parentIdentifier, relationship, options = {}) {
|
|
3054
|
-
if (
|
|
3054
|
+
if (macroCondition(dependencySatisfies("@ember-data/json-api", "*"))) {
|
|
3055
3055
|
if (!resource) {
|
|
3056
3056
|
return;
|
|
3057
3057
|
}
|
|
@@ -5702,7 +5702,7 @@ let Model = (_class = (_class2 = class Model extends EmberObject {
|
|
|
5702
5702
|
// the values initialized during create to `setUnknownProperty`
|
|
5703
5703
|
Model.prototype._createProps = null;
|
|
5704
5704
|
Model.prototype._secretInit = null;
|
|
5705
|
-
if (getOwnConfig().includeDataAdapter) {
|
|
5705
|
+
if (macroCondition(getOwnConfig().includeDataAdapter)) {
|
|
5706
5706
|
/**
|
|
5707
5707
|
Provides info about the model for debugging purposes
|
|
5708
5708
|
by grouping the properties into more semantic groups.
|