@ember-data/model 4.2.0-beta.0 → 4.4.0-alpha.0
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/attr.js +7 -10
- package/addon/-private/errors.js +1 -21
- package/addon/-private/model.js +29 -267
- package/addon/-private/system/many-array.js +3 -3
- package/addon/-private/system/promise-many-array.ts +0 -11
- package/blueprints/model-test/mocha-rfc-232-files/__root__/__path__/__test__.js +1 -1
- package/blueprints/model-test/qunit-files/__root__/__path__/__test__.js +1 -1
- package/package.json +15 -15
package/addon/-private/attr.js
CHANGED
|
@@ -2,7 +2,6 @@ import { assert } from '@ember/debug';
|
|
|
2
2
|
import { computed } from '@ember/object';
|
|
3
3
|
import { DEBUG } from '@glimmer/env';
|
|
4
4
|
|
|
5
|
-
import { RECORD_DATA_ERRORS } from '@ember-data/canary-features';
|
|
6
5
|
import { recordDataFor } from '@ember-data/store/-private';
|
|
7
6
|
|
|
8
7
|
import { computedMacroWithOptionalParams } from './util';
|
|
@@ -151,15 +150,13 @@ function attr(type, options) {
|
|
|
151
150
|
);
|
|
152
151
|
}
|
|
153
152
|
}
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.___recordState.cleanErrorRequests();
|
|
162
|
-
}
|
|
153
|
+
if (!this.isValid) {
|
|
154
|
+
let oldValue = this._internalModel._recordData.getAttr(key);
|
|
155
|
+
if (oldValue !== value) {
|
|
156
|
+
const { errors } = this;
|
|
157
|
+
if (errors.get(key)) {
|
|
158
|
+
errors.remove(key);
|
|
159
|
+
this.___recordState.cleanErrorRequests();
|
|
163
160
|
}
|
|
164
161
|
}
|
|
165
162
|
}
|
package/addon/-private/errors.js
CHANGED
|
@@ -2,10 +2,6 @@ import { A, makeArray } from '@ember/array';
|
|
|
2
2
|
import ArrayProxy from '@ember/array/proxy';
|
|
3
3
|
import { computed, get } from '@ember/object';
|
|
4
4
|
import { mapBy, not } from '@ember/object/computed';
|
|
5
|
-
import { DEBUG } from '@glimmer/env';
|
|
6
|
-
|
|
7
|
-
import { DEPRECATE_EVENTED_API_USAGE } from '@ember-data/private-build-infra/deprecations';
|
|
8
|
-
import { DeprecatedEvented } from '@ember-data/store/-private';
|
|
9
5
|
|
|
10
6
|
/**
|
|
11
7
|
@module @ember-data/store
|
|
@@ -85,9 +81,8 @@ import { DeprecatedEvented } from '@ember-data/store/-private';
|
|
|
85
81
|
@class Errors
|
|
86
82
|
@public
|
|
87
83
|
@extends Ember.ArrayProxy
|
|
88
|
-
@uses Ember.Evented
|
|
89
84
|
*/
|
|
90
|
-
export default ArrayProxy.extend(
|
|
85
|
+
export default ArrayProxy.extend({
|
|
91
86
|
/**
|
|
92
87
|
Register with target handler
|
|
93
88
|
|
|
@@ -250,11 +245,6 @@ export default ArrayProxy.extend(DeprecatedEvented, {
|
|
|
250
245
|
|
|
251
246
|
if (wasEmpty && !get(this, 'isEmpty')) {
|
|
252
247
|
this._registeredHandlers && this._registeredHandlers.becameInvalid();
|
|
253
|
-
if (DEPRECATE_EVENTED_API_USAGE) {
|
|
254
|
-
if (this[DEBUG ? '_has' : 'has']('becameInvalid')) {
|
|
255
|
-
this.trigger('becameInvalid');
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
248
|
}
|
|
259
249
|
},
|
|
260
250
|
|
|
@@ -334,11 +324,6 @@ export default ArrayProxy.extend(DeprecatedEvented, {
|
|
|
334
324
|
|
|
335
325
|
if (get(this, 'isEmpty')) {
|
|
336
326
|
this._registeredHandlers && this._registeredHandlers.becameValid();
|
|
337
|
-
if (DEPRECATE_EVENTED_API_USAGE) {
|
|
338
|
-
if (this[DEBUG ? '_has' : 'has']('becameValid')) {
|
|
339
|
-
this.trigger('becameValid');
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
327
|
}
|
|
343
328
|
},
|
|
344
329
|
|
|
@@ -417,11 +402,6 @@ export default ArrayProxy.extend(DeprecatedEvented, {
|
|
|
417
402
|
|
|
418
403
|
this._clear();
|
|
419
404
|
this._registeredHandlers && this._registeredHandlers.becameValid();
|
|
420
|
-
if (DEPRECATE_EVENTED_API_USAGE) {
|
|
421
|
-
if (this[DEBUG ? '_has' : 'has']('becameValid')) {
|
|
422
|
-
this.trigger('becameValid');
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
405
|
},
|
|
426
406
|
|
|
427
407
|
/**
|
package/addon/-private/model.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@module @ember-data/model
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { assert,
|
|
5
|
+
import { assert, warn } from '@ember/debug';
|
|
6
6
|
import EmberError from '@ember/error';
|
|
7
7
|
import EmberObject, { get } from '@ember/object';
|
|
8
8
|
import { dependentKeyCompat } from '@ember/object/compat';
|
|
@@ -12,20 +12,8 @@ import { DEBUG } from '@glimmer/env';
|
|
|
12
12
|
import { tracked } from '@glimmer/tracking';
|
|
13
13
|
import Ember from 'ember';
|
|
14
14
|
|
|
15
|
-
import { CUSTOM_MODEL_CLASS, RECORD_DATA_ERRORS, REQUEST_SERVICE } from '@ember-data/canary-features';
|
|
16
15
|
import { HAS_DEBUG_PACKAGE } from '@ember-data/private-build-infra';
|
|
17
|
-
import {
|
|
18
|
-
DEPRECATE_EVENTED_API_USAGE,
|
|
19
|
-
DEPRECATE_RECORD_LIFECYCLE_EVENT_METHODS,
|
|
20
|
-
} from '@ember-data/private-build-infra/deprecations';
|
|
21
|
-
import {
|
|
22
|
-
coerceId,
|
|
23
|
-
DeprecatedEvented,
|
|
24
|
-
errorsArrayToHash,
|
|
25
|
-
InternalModel,
|
|
26
|
-
PromiseObject,
|
|
27
|
-
recordDataFor,
|
|
28
|
-
} from '@ember-data/store/-private';
|
|
16
|
+
import { coerceId, errorsArrayToHash, InternalModel, PromiseObject, recordDataFor } from '@ember-data/store/-private';
|
|
29
17
|
|
|
30
18
|
import Errors from './errors';
|
|
31
19
|
import RecordState, { peekTag, tagged } from './record-state';
|
|
@@ -33,15 +21,6 @@ import { relationshipFromMeta } from './system/relationships/relationship-meta';
|
|
|
33
21
|
|
|
34
22
|
const { changeProperties } = Ember;
|
|
35
23
|
|
|
36
|
-
/*
|
|
37
|
-
In the non-CUSTOM_MODEL_CLASS world things decorated with flagToggledDecorator
|
|
38
|
-
have logic that requires a cache and caching key (which tagged provides), but
|
|
39
|
-
in the CUSTOM_MODEL_CLASS branch it only requires dependentKeyCompat which
|
|
40
|
-
ensures computeds/observers on the field will fire when anything it accesses
|
|
41
|
-
that is tracked changes
|
|
42
|
-
*/
|
|
43
|
-
const flagToggledDecorator = CUSTOM_MODEL_CLASS ? dependentKeyCompat : tagged;
|
|
44
|
-
|
|
45
24
|
function findPossibleInverses(type, inverseType, name, relationshipsSoFar) {
|
|
46
25
|
let possibleRelationships = relationshipsSoFar || [];
|
|
47
26
|
|
|
@@ -115,7 +94,6 @@ function computeOnce(target, key, desc) {
|
|
|
115
94
|
@class Model
|
|
116
95
|
@public
|
|
117
96
|
@extends Ember.EmberObject
|
|
118
|
-
@uses DeprecatedEvented
|
|
119
97
|
*/
|
|
120
98
|
class Model extends EmberObject {
|
|
121
99
|
init(options = {}) {
|
|
@@ -131,9 +109,7 @@ class Model extends EmberObject {
|
|
|
131
109
|
}
|
|
132
110
|
}
|
|
133
111
|
|
|
134
|
-
|
|
135
|
-
this.___recordState = new RecordState(this);
|
|
136
|
-
}
|
|
112
|
+
this.___recordState = new RecordState(this);
|
|
137
113
|
this.setProperties(createProps);
|
|
138
114
|
}
|
|
139
115
|
|
|
@@ -389,21 +365,13 @@ class Model extends EmberObject {
|
|
|
389
365
|
@type {Boolean}
|
|
390
366
|
@readOnly
|
|
391
367
|
*/
|
|
392
|
-
@
|
|
368
|
+
@dependentKeyCompat
|
|
393
369
|
get isError() {
|
|
394
|
-
|
|
395
|
-
return this.currentState.isError;
|
|
396
|
-
}
|
|
397
|
-
let tag = peekTag(this, 'isError');
|
|
398
|
-
tag.value = tag.value || false;
|
|
399
|
-
return tag.value;
|
|
370
|
+
return this.currentState.isError;
|
|
400
371
|
}
|
|
401
372
|
set isError(v) {
|
|
402
|
-
if (
|
|
403
|
-
throw new Error(`isError is not directly settable
|
|
404
|
-
} else {
|
|
405
|
-
let tag = peekTag(this, 'isError');
|
|
406
|
-
tag.value = v;
|
|
373
|
+
if (DEBUG) {
|
|
374
|
+
throw new Error(`isError is not directly settable`);
|
|
407
375
|
}
|
|
408
376
|
}
|
|
409
377
|
|
|
@@ -472,19 +440,10 @@ class Model extends EmberObject {
|
|
|
472
440
|
*/
|
|
473
441
|
@tagged
|
|
474
442
|
get currentState() {
|
|
475
|
-
|
|
476
|
-
return this.___recordState;
|
|
477
|
-
}
|
|
478
|
-
if (this.isDestroyed || this.isDestroying) {
|
|
479
|
-
return this._internalModel._previousState;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
return this._internalModel && this._internalModel.currentState;
|
|
443
|
+
return this.___recordState;
|
|
483
444
|
}
|
|
484
|
-
set currentState(
|
|
485
|
-
|
|
486
|
-
this.notifyPropertyChange('currentState');
|
|
487
|
-
}
|
|
445
|
+
set currentState(_v) {
|
|
446
|
+
throw new Error('cannot set currentState');
|
|
488
447
|
}
|
|
489
448
|
|
|
490
449
|
/**
|
|
@@ -564,21 +523,19 @@ class Model extends EmberObject {
|
|
|
564
523
|
this._internalModel.send('becameValid');
|
|
565
524
|
}
|
|
566
525
|
);
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
errors._add(errorKeys[i], errorsHash[errorKeys[i]]);
|
|
581
|
-
}
|
|
526
|
+
// TODO we should unify how errors gets populated
|
|
527
|
+
// with the code managing the update. Probably a
|
|
528
|
+
// lazy flush similar to retrieveLatest in ManyArray
|
|
529
|
+
let recordData = recordDataFor(this);
|
|
530
|
+
let jsonApiErrors;
|
|
531
|
+
if (recordData.getErrors) {
|
|
532
|
+
jsonApiErrors = recordData.getErrors();
|
|
533
|
+
if (jsonApiErrors) {
|
|
534
|
+
let errorsHash = errorsArrayToHash(jsonApiErrors);
|
|
535
|
+
let errorKeys = Object.keys(errorsHash);
|
|
536
|
+
|
|
537
|
+
for (let i = 0; i < errorKeys.length; i++) {
|
|
538
|
+
errors._add(errorKeys[i], errorsHash[errorKeys[i]]);
|
|
582
539
|
}
|
|
583
540
|
}
|
|
584
541
|
}
|
|
@@ -593,22 +550,12 @@ class Model extends EmberObject {
|
|
|
593
550
|
@public
|
|
594
551
|
@type {AdapterError}
|
|
595
552
|
*/
|
|
596
|
-
@
|
|
553
|
+
@dependentKeyCompat
|
|
597
554
|
get adapterError() {
|
|
598
|
-
|
|
599
|
-
return this.currentState.adapterError;
|
|
600
|
-
}
|
|
601
|
-
let tag = peekTag(this, 'adapterError');
|
|
602
|
-
tag.value = tag.value || null;
|
|
603
|
-
return tag.value;
|
|
555
|
+
return this.currentState.adapterError;
|
|
604
556
|
}
|
|
605
557
|
set adapterError(v) {
|
|
606
|
-
|
|
607
|
-
throw new Error(`adapterError is not directly settable when REQUEST_SERVICE is enabled`);
|
|
608
|
-
} else {
|
|
609
|
-
let tag = peekTag(this, 'adapterError');
|
|
610
|
-
tag.value = v;
|
|
611
|
-
}
|
|
558
|
+
throw new Error(`adapterError is not directly settable`);
|
|
612
559
|
}
|
|
613
560
|
|
|
614
561
|
/**
|
|
@@ -630,92 +577,6 @@ class Model extends EmberObject {
|
|
|
630
577
|
return this._internalModel.createSnapshot().serialize(options);
|
|
631
578
|
}
|
|
632
579
|
|
|
633
|
-
/**
|
|
634
|
-
Fired when the record is ready to be interacted with,
|
|
635
|
-
that is either loaded from the server or created locally.
|
|
636
|
-
|
|
637
|
-
@deprecated
|
|
638
|
-
@public
|
|
639
|
-
@event ready
|
|
640
|
-
*/
|
|
641
|
-
|
|
642
|
-
/**
|
|
643
|
-
Fired when the record is loaded from the server.
|
|
644
|
-
|
|
645
|
-
@deprecated
|
|
646
|
-
@public
|
|
647
|
-
@event didLoad
|
|
648
|
-
*/
|
|
649
|
-
|
|
650
|
-
/**
|
|
651
|
-
Fired when the record is updated.
|
|
652
|
-
|
|
653
|
-
@deprecated
|
|
654
|
-
@public
|
|
655
|
-
@event didUpdate
|
|
656
|
-
*/
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
Fired when a new record is commited to the server.
|
|
660
|
-
|
|
661
|
-
@deprecated
|
|
662
|
-
@public
|
|
663
|
-
@event didCreate
|
|
664
|
-
*/
|
|
665
|
-
|
|
666
|
-
/**
|
|
667
|
-
Fired when the record is deleted.
|
|
668
|
-
|
|
669
|
-
@deprecated
|
|
670
|
-
@public
|
|
671
|
-
@event didDelete
|
|
672
|
-
*/
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
Fired when the record becomes invalid.
|
|
676
|
-
|
|
677
|
-
@deprecated
|
|
678
|
-
@public
|
|
679
|
-
@event becameInvalid
|
|
680
|
-
*/
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
Fired when the record enters the error state.
|
|
684
|
-
|
|
685
|
-
@deprecated
|
|
686
|
-
@public
|
|
687
|
-
@event becameError
|
|
688
|
-
*/
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
Fired when the record is rolled back.
|
|
692
|
-
|
|
693
|
-
@deprecated
|
|
694
|
-
@public
|
|
695
|
-
@event rolledBack
|
|
696
|
-
*/
|
|
697
|
-
|
|
698
|
-
/**
|
|
699
|
-
@deprecated
|
|
700
|
-
@method send
|
|
701
|
-
@private
|
|
702
|
-
@param {String} name
|
|
703
|
-
@param {Object} context
|
|
704
|
-
*/
|
|
705
|
-
send(name, context) {
|
|
706
|
-
return this._internalModel.send(name, context);
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
/**
|
|
710
|
-
@deprecated
|
|
711
|
-
@method transitionTo
|
|
712
|
-
@private
|
|
713
|
-
@param {String} name
|
|
714
|
-
*/
|
|
715
|
-
transitionTo(name) {
|
|
716
|
-
return this._internalModel.transitionTo(name);
|
|
717
|
-
}
|
|
718
|
-
|
|
719
580
|
/*
|
|
720
581
|
We hook the default implementation to ensure
|
|
721
582
|
our tagged properties are properly notified
|
|
@@ -766,11 +627,7 @@ class Model extends EmberObject {
|
|
|
766
627
|
@public
|
|
767
628
|
*/
|
|
768
629
|
deleteRecord() {
|
|
769
|
-
|
|
770
|
-
this.store.deleteRecord(this);
|
|
771
|
-
} else {
|
|
772
|
-
this._internalModel.deleteRecord();
|
|
773
|
-
}
|
|
630
|
+
this.store.deleteRecord(this);
|
|
774
631
|
}
|
|
775
632
|
|
|
776
633
|
/**
|
|
@@ -839,11 +696,7 @@ class Model extends EmberObject {
|
|
|
839
696
|
if (this.isDestroyed) {
|
|
840
697
|
return;
|
|
841
698
|
}
|
|
842
|
-
|
|
843
|
-
this.store.unloadRecord(this);
|
|
844
|
-
} else {
|
|
845
|
-
this._internalModel.unloadRecord();
|
|
846
|
-
}
|
|
699
|
+
this.store.unloadRecord(this);
|
|
847
700
|
}
|
|
848
701
|
|
|
849
702
|
/**
|
|
@@ -933,9 +786,7 @@ class Model extends EmberObject {
|
|
|
933
786
|
*/
|
|
934
787
|
rollbackAttributes() {
|
|
935
788
|
this._internalModel.rollbackAttributes();
|
|
936
|
-
|
|
937
|
-
this.currentState.cleanErrorRequests();
|
|
938
|
-
}
|
|
789
|
+
this.currentState.cleanErrorRequests();
|
|
939
790
|
}
|
|
940
791
|
|
|
941
792
|
/**
|
|
@@ -2144,38 +1995,6 @@ if (HAS_DEBUG_PACKAGE) {
|
|
|
2144
1995
|
};
|
|
2145
1996
|
}
|
|
2146
1997
|
|
|
2147
|
-
if (DEPRECATE_EVENTED_API_USAGE) {
|
|
2148
|
-
/**
|
|
2149
|
-
Override the default event firing from Ember.Evented to
|
|
2150
|
-
also call methods with the given name.
|
|
2151
|
-
|
|
2152
|
-
@method trigger
|
|
2153
|
-
@private
|
|
2154
|
-
@param {String} name
|
|
2155
|
-
*/
|
|
2156
|
-
Model.reopen(DeprecatedEvented, {
|
|
2157
|
-
trigger(name) {
|
|
2158
|
-
if (DEPRECATE_RECORD_LIFECYCLE_EVENT_METHODS) {
|
|
2159
|
-
let fn = this[name];
|
|
2160
|
-
if (typeof fn === 'function') {
|
|
2161
|
-
let length = arguments.length;
|
|
2162
|
-
let args = new Array(length - 1);
|
|
2163
|
-
|
|
2164
|
-
for (let i = 1; i < length; i++) {
|
|
2165
|
-
args[i - 1] = arguments[i];
|
|
2166
|
-
}
|
|
2167
|
-
fn.apply(this, args);
|
|
2168
|
-
}
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
|
-
const _hasEvent = DEBUG ? this._has(name) : this.has(name);
|
|
2172
|
-
if (_hasEvent) {
|
|
2173
|
-
this._super(...arguments);
|
|
2174
|
-
}
|
|
2175
|
-
},
|
|
2176
|
-
});
|
|
2177
|
-
}
|
|
2178
|
-
|
|
2179
1998
|
if (DEBUG) {
|
|
2180
1999
|
let lookupDescriptor = function lookupDescriptor(obj, keyName) {
|
|
2181
2000
|
let current = obj;
|
|
@@ -2199,42 +2018,10 @@ if (DEBUG) {
|
|
|
2199
2018
|
return isBasicDesc(instanceDesc) && lookupDescriptor(obj.constructor, keyName) === null;
|
|
2200
2019
|
};
|
|
2201
2020
|
|
|
2202
|
-
let lookupDeprecations;
|
|
2203
|
-
let _deprecatedLifecycleMethods;
|
|
2204
|
-
|
|
2205
|
-
if (DEPRECATE_RECORD_LIFECYCLE_EVENT_METHODS) {
|
|
2206
|
-
const INSTANCE_DEPRECATIONS = new WeakMap();
|
|
2207
|
-
_deprecatedLifecycleMethods = [
|
|
2208
|
-
'becameError',
|
|
2209
|
-
'becameInvalid',
|
|
2210
|
-
'didCreate',
|
|
2211
|
-
'didDelete',
|
|
2212
|
-
'didLoad',
|
|
2213
|
-
'didUpdate',
|
|
2214
|
-
'ready',
|
|
2215
|
-
'rolledBack',
|
|
2216
|
-
];
|
|
2217
|
-
|
|
2218
|
-
lookupDeprecations = function lookupInstanceDeprecations(instance) {
|
|
2219
|
-
let deprecations = INSTANCE_DEPRECATIONS.get(instance);
|
|
2220
|
-
|
|
2221
|
-
if (!deprecations) {
|
|
2222
|
-
deprecations = new Set();
|
|
2223
|
-
INSTANCE_DEPRECATIONS.set(instance, deprecations);
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
|
-
return deprecations;
|
|
2227
|
-
};
|
|
2228
|
-
}
|
|
2229
|
-
|
|
2230
2021
|
Model.reopen({
|
|
2231
2022
|
init() {
|
|
2232
2023
|
this._super(...arguments);
|
|
2233
2024
|
|
|
2234
|
-
if (DEPRECATE_EVENTED_API_USAGE) {
|
|
2235
|
-
this._getDeprecatedEventedInfo = () => `${this._internalModel.modelName}#${this.id}`;
|
|
2236
|
-
}
|
|
2237
|
-
|
|
2238
2025
|
if (!isDefaultEmptyDescriptor(this, '_internalModel') || !(this._internalModel instanceof InternalModel)) {
|
|
2239
2026
|
throw new Error(
|
|
2240
2027
|
`'_internalModel' is a reserved property name on instances of classes extending Model. Please choose a different property name for ${this.constructor.toString()}`
|
|
@@ -2258,31 +2045,6 @@ if (DEBUG) {
|
|
|
2258
2045
|
`You may not set 'id' as an attribute on your model. Please remove any lines that look like: \`id: attr('<type>')\` from ${this.constructor.toString()}`
|
|
2259
2046
|
);
|
|
2260
2047
|
}
|
|
2261
|
-
|
|
2262
|
-
if (DEPRECATE_RECORD_LIFECYCLE_EVENT_METHODS) {
|
|
2263
|
-
let lifecycleDeprecations = lookupDeprecations(this.constructor);
|
|
2264
|
-
|
|
2265
|
-
_deprecatedLifecycleMethods.forEach((methodName) => {
|
|
2266
|
-
if (typeof this[methodName] === 'function' && !lifecycleDeprecations.has(methodName)) {
|
|
2267
|
-
deprecate(
|
|
2268
|
-
`You defined a \`${methodName}\` method for ${this.constructor.toString()} but lifecycle events for models have been deprecated.`,
|
|
2269
|
-
false,
|
|
2270
|
-
{
|
|
2271
|
-
id: 'ember-data:record-lifecycle-event-methods',
|
|
2272
|
-
until: '4.0',
|
|
2273
|
-
url: 'https://deprecations.emberjs.com/ember-data/v3.x#toc_record-lifecycle-event-methods',
|
|
2274
|
-
for: '@ember-data/model',
|
|
2275
|
-
since: {
|
|
2276
|
-
available: '3.12',
|
|
2277
|
-
enabled: '3.12',
|
|
2278
|
-
},
|
|
2279
|
-
}
|
|
2280
|
-
);
|
|
2281
|
-
|
|
2282
|
-
lifecycleDeprecations.add(methodName);
|
|
2283
|
-
}
|
|
2284
|
-
});
|
|
2285
|
-
}
|
|
2286
2048
|
},
|
|
2287
2049
|
});
|
|
2288
2050
|
}
|
|
@@ -8,7 +8,7 @@ import EmberObject, { get } from '@ember/object';
|
|
|
8
8
|
|
|
9
9
|
import { all } from 'rsvp';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { PromiseArray, recordDataFor } from '@ember-data/store/-private';
|
|
12
12
|
|
|
13
13
|
import diffArray from './diff-array';
|
|
14
14
|
|
|
@@ -55,9 +55,9 @@ import diffArray from './diff-array';
|
|
|
55
55
|
@class ManyArray
|
|
56
56
|
@public
|
|
57
57
|
@extends Ember.EmberObject
|
|
58
|
-
@uses Ember.MutableArray
|
|
58
|
+
@uses Ember.MutableArray
|
|
59
59
|
*/
|
|
60
|
-
export default EmberObject.extend(MutableArray,
|
|
60
|
+
export default EmberObject.extend(MutableArray, {
|
|
61
61
|
isAsync: false,
|
|
62
62
|
isLoaded: false,
|
|
63
63
|
|
|
@@ -6,8 +6,6 @@ import Ember from 'ember';
|
|
|
6
6
|
|
|
7
7
|
import { resolve } from 'rsvp';
|
|
8
8
|
|
|
9
|
-
import { DEPRECATE_EVENTED_API_USAGE } from '@ember-data/private-build-infra/deprecations';
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
10
|
@module @ember-data/model
|
|
13
11
|
*/
|
|
@@ -330,12 +328,3 @@ InheritedProxyMethods.forEach((method) => {
|
|
|
330
328
|
return this.content[method](...args);
|
|
331
329
|
};
|
|
332
330
|
});
|
|
333
|
-
|
|
334
|
-
if (DEPRECATE_EVENTED_API_USAGE) {
|
|
335
|
-
['on', 'has', 'trigger', 'off', 'one'].forEach((method) => {
|
|
336
|
-
PromiseManyArray.prototype[method] = function proxiedMethod(...args) {
|
|
337
|
-
assert(`Cannot call ${method} before content is assigned.`, this.content);
|
|
338
|
-
return this.content[method](...args);
|
|
339
|
-
};
|
|
340
|
-
});
|
|
341
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data/model",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-alpha.0",
|
|
4
4
|
"description": "The default blueprint for ember-cli addons.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -18,44 +18,44 @@
|
|
|
18
18
|
"test:node": "mocha"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@ember-data/canary-features": "4.
|
|
22
|
-
"@ember-data/private-build-infra": "4.
|
|
23
|
-
"@ember-data/store": "4.
|
|
21
|
+
"@ember-data/canary-features": "4.4.0-alpha.0",
|
|
22
|
+
"@ember-data/private-build-infra": "4.4.0-alpha.0",
|
|
23
|
+
"@ember-data/store": "4.4.0-alpha.0",
|
|
24
24
|
"@ember/edition-utils": "^1.2.0",
|
|
25
25
|
"@ember/string": "^3.0.0",
|
|
26
26
|
"ember-auto-import": "^2.2.4",
|
|
27
27
|
"ember-cached-decorator-polyfill": "^0.1.4",
|
|
28
|
-
"ember-cli-babel": "^7.26.
|
|
28
|
+
"ember-cli-babel": "^7.26.11",
|
|
29
29
|
"ember-cli-string-utils": "^1.1.0",
|
|
30
30
|
"ember-cli-test-info": "^1.0.0",
|
|
31
|
-
"ember-cli-typescript": "^
|
|
31
|
+
"ember-cli-typescript": "^5.0.0",
|
|
32
32
|
"ember-compatibility-helpers": "^1.2.0",
|
|
33
33
|
"inflection": "~1.13.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@ember-data/unpublished-test-infra": "4.
|
|
36
|
+
"@ember-data/unpublished-test-infra": "4.4.0-alpha.0",
|
|
37
37
|
"@ember/optional-features": "^2.0.0",
|
|
38
38
|
"@ember/test-helpers": "^2.6.0",
|
|
39
39
|
"broccoli-asset-rev": "^3.0.0",
|
|
40
|
-
"ember-cli": "~
|
|
40
|
+
"ember-cli": "~4.1.1",
|
|
41
41
|
"ember-cli-blueprint-test-helpers": "^0.19.1",
|
|
42
42
|
"ember-cli-dependency-checker": "^3.2.0",
|
|
43
|
-
"ember-cli-htmlbars": "^
|
|
43
|
+
"ember-cli-htmlbars": "^6.0.1",
|
|
44
44
|
"ember-cli-inject-live-reload": "^2.0.2",
|
|
45
45
|
"ember-cli-sri": "^2.1.1",
|
|
46
46
|
"ember-cli-terser": "~4.0.1",
|
|
47
47
|
"ember-disable-prototype-extensions": "^1.1.3",
|
|
48
48
|
"ember-export-application-global": "^2.0.1",
|
|
49
49
|
"ember-load-initializers": "^2.1.1",
|
|
50
|
-
"ember-maybe-import-regenerator": "^0.
|
|
50
|
+
"ember-maybe-import-regenerator": "^1.0.0",
|
|
51
51
|
"ember-qunit": "^5.1.5",
|
|
52
|
-
"ember-resolver": "^8.0.
|
|
53
|
-
"ember-source": "~4.
|
|
52
|
+
"ember-resolver": "^8.0.3",
|
|
53
|
+
"ember-source": "~4.2.0",
|
|
54
54
|
"ember-source-channel-url": "^3.0.0",
|
|
55
|
-
"ember-try": "^
|
|
55
|
+
"ember-try": "^2.0.0",
|
|
56
56
|
"loader.js": "^4.7.0",
|
|
57
|
-
"qunit": "^2.
|
|
58
|
-
"qunit-dom": "^
|
|
57
|
+
"qunit": "^2.17.0",
|
|
58
|
+
"qunit-dom": "^2.0.0",
|
|
59
59
|
"silent-error": "^1.1.1",
|
|
60
60
|
"webpack": "^5.37.1"
|
|
61
61
|
},
|