@warp-drive/legacy 5.9.0-alpha.20 → 5.9.0-alpha.21

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.
@@ -124,7 +124,7 @@ export declare class RecordReference {
124
124
  normalized hash of data and the object represented by the reference
125
125
  will update.
126
126
 
127
- If you pass a promise to `push`, Ember Data will not ask the adapter
127
+ If you pass a promise to `push`, WarpDrive will not ask the adapter
128
128
  for the data if another attempt to fetch it is made in the
129
129
  interim. When the promise resolves, the underlying object is updated
130
130
  with the new data, and the promise returned by *this function* is resolved
@@ -171,7 +171,7 @@ export declare class RecordReference {
171
171
  ```
172
172
 
173
173
  @public
174
- @return {Model} the record for this RecordReference
174
+ @return the record for this RecordReference
175
175
  */
176
176
  value(): OpaqueRecordInstance | null;
177
177
  /**
package/dist/store.js CHANGED
@@ -108,12 +108,11 @@ function resourceIsFullyDeleted(instanceCache, identifier) {
108
108
  class RecordReference {
109
109
  /** @internal */
110
110
 
111
- /** @internal */
112
111
  // unsubscribe token given to us by the notification manager
112
+ /** @internal */
113
113
  ___token;
114
114
  /** @internal */
115
115
  ___identifier;
116
-
117
116
  /** @internal */
118
117
 
119
118
  constructor(store, identifier) {
@@ -144,7 +143,7 @@ class RecordReference {
144
143
  userRef.id(); // '1'
145
144
  ```
146
145
  @public
147
- @return The id of the record.
146
+ @return The id of the record.
148
147
  */
149
148
  id() {
150
149
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
@@ -162,7 +161,7 @@ class RecordReference {
162
161
  userRef.identifier(); // '1'
163
162
  ```
164
163
  @public
165
- @return The identifier of the record.
164
+ @return The identifier of the record.
166
165
  */
167
166
  identifier() {
168
167
  return this.___identifier;
@@ -188,7 +187,7 @@ class RecordReference {
188
187
  simplest usage of this API is similar to `store.push`: you provide a
189
188
  normalized hash of data and the object represented by the reference
190
189
  will update.
191
- If you pass a promise to `push`, Ember Data will not ask the adapter
190
+ If you pass a promise to `push`, WarpDrive will not ask the adapter
192
191
  for the data if another attempt to fetch it is made in the
193
192
  interim. When the promise resolves, the underlying object is updated
194
193
  with the new data, and the promise returned by *this function* is resolved
@@ -232,7 +231,7 @@ class RecordReference {
232
231
  userRef.value(); // user
233
232
  ```
234
233
  @public
235
- @return {Model} the record for this RecordReference
234
+ @return the record for this RecordReference
236
235
  */
237
236
  value() {
238
237
  return this.store.peekRecord(this.___identifier);
@@ -527,7 +526,14 @@ function restoreDeprecatedStoreBehaviors(StoreKlass) {
527
526
  };
528
527
 
529
528
  // do not put a ts-expect-error here, because typedoc will fail to
530
- // build due to this error only occurring when references are in use in the editor
529
+ // build due to this error only occurring when references are in use in the editor.
530
+ // The return statement below casts to `PrivateStore['getReference']`'s return
531
+ // type rather than annotating this function `: RecordReference` directly,
532
+ // since this package's `RecordReference` and core's `deprecated/-private.ts`
533
+ // copy are structurally identical but nominally distinct classes (TS treats
534
+ // their private fields as separate brands); casting only the return value
535
+ // (instead of the whole function) keeps `this` contextually typed from the
536
+ // assignment target below.
531
537
  StoreKlass.prototype.getReference = function (resource, id) {
532
538
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
533
539
  if (!test) {
@@ -108,12 +108,11 @@ function resourceIsFullyDeleted(instanceCache, identifier) {
108
108
  class RecordReference {
109
109
  /** @internal */
110
110
 
111
- /** @internal */
112
111
  // unsubscribe token given to us by the notification manager
112
+ /** @internal */
113
113
  ___token;
114
114
  /** @internal */
115
115
  ___identifier;
116
-
117
116
  /** @internal */
118
117
 
119
118
  constructor(store, identifier) {
@@ -144,7 +143,7 @@ class RecordReference {
144
143
  userRef.id(); // '1'
145
144
  ```
146
145
  @public
147
- @return The id of the record.
146
+ @return The id of the record.
148
147
  */
149
148
  id() {
150
149
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
@@ -162,7 +161,7 @@ class RecordReference {
162
161
  userRef.identifier(); // '1'
163
162
  ```
164
163
  @public
165
- @return The identifier of the record.
164
+ @return The identifier of the record.
166
165
  */
167
166
  identifier() {
168
167
  return this.___identifier;
@@ -188,7 +187,7 @@ class RecordReference {
188
187
  simplest usage of this API is similar to `store.push`: you provide a
189
188
  normalized hash of data and the object represented by the reference
190
189
  will update.
191
- If you pass a promise to `push`, Ember Data will not ask the adapter
190
+ If you pass a promise to `push`, WarpDrive will not ask the adapter
192
191
  for the data if another attempt to fetch it is made in the
193
192
  interim. When the promise resolves, the underlying object is updated
194
193
  with the new data, and the promise returned by *this function* is resolved
@@ -232,7 +231,7 @@ class RecordReference {
232
231
  userRef.value(); // user
233
232
  ```
234
233
  @public
235
- @return {Model} the record for this RecordReference
234
+ @return the record for this RecordReference
236
235
  */
237
236
  value() {
238
237
  return this.store.peekRecord(this.___identifier);
@@ -535,7 +534,14 @@ function restoreDeprecatedStoreBehaviors(StoreKlass) {
535
534
  };
536
535
 
537
536
  // do not put a ts-expect-error here, because typedoc will fail to
538
- // build due to this error only occurring when references are in use in the editor
537
+ // build due to this error only occurring when references are in use in the editor.
538
+ // The return statement below casts to `PrivateStore['getReference']`'s return
539
+ // type rather than annotating this function `: RecordReference` directly,
540
+ // since this package's `RecordReference` and core's `deprecated/-private.ts`
541
+ // copy are structurally identical but nominally distinct classes (TS treats
542
+ // their private fields as separate brands); casting only the return value
543
+ // (instead of the whole function) keeps `this` contextually typed from the
544
+ // assignment target below.
539
545
  StoreKlass.prototype.getReference = function (resource, id) {
540
546
  (test => {
541
547
  if (!test) {
@@ -108,12 +108,11 @@ function resourceIsFullyDeleted(instanceCache, identifier) {
108
108
  class RecordReference {
109
109
  /** @internal */
110
110
 
111
- /** @internal */
112
111
  // unsubscribe token given to us by the notification manager
112
+ /** @internal */
113
113
  ___token;
114
114
  /** @internal */
115
115
  ___identifier;
116
-
117
116
  /** @internal */
118
117
 
119
118
  constructor(store, identifier) {
@@ -144,7 +143,7 @@ class RecordReference {
144
143
  userRef.id(); // '1'
145
144
  ```
146
145
  @public
147
- @return The id of the record.
146
+ @return The id of the record.
148
147
  */
149
148
  id() {
150
149
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
@@ -162,7 +161,7 @@ class RecordReference {
162
161
  userRef.identifier(); // '1'
163
162
  ```
164
163
  @public
165
- @return The identifier of the record.
164
+ @return The identifier of the record.
166
165
  */
167
166
  identifier() {
168
167
  return this.___identifier;
@@ -188,7 +187,7 @@ class RecordReference {
188
187
  simplest usage of this API is similar to `store.push`: you provide a
189
188
  normalized hash of data and the object represented by the reference
190
189
  will update.
191
- If you pass a promise to `push`, Ember Data will not ask the adapter
190
+ If you pass a promise to `push`, WarpDrive will not ask the adapter
192
191
  for the data if another attempt to fetch it is made in the
193
192
  interim. When the promise resolves, the underlying object is updated
194
193
  with the new data, and the promise returned by *this function* is resolved
@@ -232,7 +231,7 @@ class RecordReference {
232
231
  userRef.value(); // user
233
232
  ```
234
233
  @public
235
- @return {Model} the record for this RecordReference
234
+ @return the record for this RecordReference
236
235
  */
237
236
  value() {
238
237
  return this.store.peekRecord(this.___identifier);
@@ -535,7 +534,14 @@ function restoreDeprecatedStoreBehaviors(StoreKlass) {
535
534
  };
536
535
 
537
536
  // do not put a ts-expect-error here, because typedoc will fail to
538
- // build due to this error only occurring when references are in use in the editor
537
+ // build due to this error only occurring when references are in use in the editor.
538
+ // The return statement below casts to `PrivateStore['getReference']`'s return
539
+ // type rather than annotating this function `: RecordReference` directly,
540
+ // since this package's `RecordReference` and core's `deprecated/-private.ts`
541
+ // copy are structurally identical but nominally distinct classes (TS treats
542
+ // their private fields as separate brands); casting only the return value
543
+ // (instead of the whole function) keeps `this` contextually typed from the
544
+ // assignment target below.
539
545
  StoreKlass.prototype.getReference = function (resource, id) {
540
546
  (test => {
541
547
  if (!test) {
@@ -98,12 +98,11 @@ function resourceIsFullyDeleted(instanceCache, identifier) {
98
98
  class RecordReference {
99
99
  /** @internal */
100
100
 
101
- /** @internal */
102
101
  // unsubscribe token given to us by the notification manager
102
+ /** @internal */
103
103
  ___token;
104
104
  /** @internal */
105
105
  ___identifier;
106
-
107
106
  /** @internal */
108
107
 
109
108
  constructor(store, identifier) {
@@ -134,7 +133,7 @@ class RecordReference {
134
133
  userRef.id(); // '1'
135
134
  ```
136
135
  @public
137
- @return The id of the record.
136
+ @return The id of the record.
138
137
  */
139
138
  id() {
140
139
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
@@ -152,7 +151,7 @@ class RecordReference {
152
151
  userRef.identifier(); // '1'
153
152
  ```
154
153
  @public
155
- @return The identifier of the record.
154
+ @return The identifier of the record.
156
155
  */
157
156
  identifier() {
158
157
  return this.___identifier;
@@ -178,7 +177,7 @@ class RecordReference {
178
177
  simplest usage of this API is similar to `store.push`: you provide a
179
178
  normalized hash of data and the object represented by the reference
180
179
  will update.
181
- If you pass a promise to `push`, Ember Data will not ask the adapter
180
+ If you pass a promise to `push`, WarpDrive will not ask the adapter
182
181
  for the data if another attempt to fetch it is made in the
183
182
  interim. When the promise resolves, the underlying object is updated
184
183
  with the new data, and the promise returned by *this function* is resolved
@@ -222,7 +221,7 @@ class RecordReference {
222
221
  userRef.value(); // user
223
222
  ```
224
223
  @public
225
- @return {Model} the record for this RecordReference
224
+ @return the record for this RecordReference
226
225
  */
227
226
  value() {
228
227
  return this.store.peekRecord(this.___identifier);
@@ -445,7 +444,14 @@ function restoreDeprecatedStoreBehaviors(StoreKlass) {
445
444
  };
446
445
 
447
446
  // do not put a ts-expect-error here, because typedoc will fail to
448
- // build due to this error only occurring when references are in use in the editor
447
+ // build due to this error only occurring when references are in use in the editor.
448
+ // The return statement below casts to `PrivateStore['getReference']`'s return
449
+ // type rather than annotating this function `: RecordReference` directly,
450
+ // since this package's `RecordReference` and core's `deprecated/-private.ts`
451
+ // copy are structurally identical but nominally distinct classes (TS treats
452
+ // their private fields as separate brands); casting only the return value
453
+ // (instead of the whole function) keeps `this` contextually typed from the
454
+ // assignment target below.
449
455
  StoreKlass.prototype.getReference = function (resource, id) {
450
456
  let resourceIdentifier;
451
457
  if (arguments.length === 1 && isMaybeIdentifier(resource)) {
@@ -98,12 +98,11 @@ function resourceIsFullyDeleted(instanceCache, identifier) {
98
98
  class RecordReference {
99
99
  /** @internal */
100
100
 
101
- /** @internal */
102
101
  // unsubscribe token given to us by the notification manager
102
+ /** @internal */
103
103
  ___token;
104
104
  /** @internal */
105
105
  ___identifier;
106
-
107
106
  /** @internal */
108
107
 
109
108
  constructor(store, identifier) {
@@ -134,7 +133,7 @@ class RecordReference {
134
133
  userRef.id(); // '1'
135
134
  ```
136
135
  @public
137
- @return The id of the record.
136
+ @return The id of the record.
138
137
  */
139
138
  id() {
140
139
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
@@ -152,7 +151,7 @@ class RecordReference {
152
151
  userRef.identifier(); // '1'
153
152
  ```
154
153
  @public
155
- @return The identifier of the record.
154
+ @return The identifier of the record.
156
155
  */
157
156
  identifier() {
158
157
  return this.___identifier;
@@ -178,7 +177,7 @@ class RecordReference {
178
177
  simplest usage of this API is similar to `store.push`: you provide a
179
178
  normalized hash of data and the object represented by the reference
180
179
  will update.
181
- If you pass a promise to `push`, Ember Data will not ask the adapter
180
+ If you pass a promise to `push`, WarpDrive will not ask the adapter
182
181
  for the data if another attempt to fetch it is made in the
183
182
  interim. When the promise resolves, the underlying object is updated
184
183
  with the new data, and the promise returned by *this function* is resolved
@@ -222,7 +221,7 @@ class RecordReference {
222
221
  userRef.value(); // user
223
222
  ```
224
223
  @public
225
- @return {Model} the record for this RecordReference
224
+ @return the record for this RecordReference
226
225
  */
227
226
  value() {
228
227
  return this.store.peekRecord(this.___identifier);
@@ -445,7 +444,14 @@ function restoreDeprecatedStoreBehaviors(StoreKlass) {
445
444
  };
446
445
 
447
446
  // do not put a ts-expect-error here, because typedoc will fail to
448
- // build due to this error only occurring when references are in use in the editor
447
+ // build due to this error only occurring when references are in use in the editor.
448
+ // The return statement below casts to `PrivateStore['getReference']`'s return
449
+ // type rather than annotating this function `: RecordReference` directly,
450
+ // since this package's `RecordReference` and core's `deprecated/-private.ts`
451
+ // copy are structurally identical but nominally distinct classes (TS treats
452
+ // their private fields as separate brands); casting only the return value
453
+ // (instead of the whole function) keeps `this` contextually typed from the
454
+ // assignment target below.
449
455
  StoreKlass.prototype.getReference = function (resource, id) {
450
456
  let resourceIdentifier;
451
457
  if (arguments.length === 1 && isMaybeIdentifier(resource)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warp-drive/legacy",
3
- "version": "5.9.0-alpha.20",
3
+ "version": "5.9.0-alpha.21",
4
4
  "description": "Decommissioned Packages for WarpDrive | Things your app might still want to maintain use of for a little longer.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -40,8 +40,8 @@
40
40
  }
41
41
  },
42
42
  "peerDependencies": {
43
- "@warp-drive/core": "5.9.0-alpha.20",
44
- "@warp-drive/utilities": "5.9.0-alpha.20"
43
+ "@warp-drive/core": "5.9.0-alpha.21",
44
+ "@warp-drive/utilities": "5.9.0-alpha.21"
45
45
  },
46
46
  "dependencies": {
47
47
  "@embroider/macros": "^1.20.6"
@@ -51,9 +51,9 @@
51
51
  "@babel/plugin-transform-typescript": "^7.28.0",
52
52
  "@babel/preset-typescript": "^7.27.1",
53
53
  "@types/jquery": "^3.5.33",
54
- "@warp-drive/core": "5.9.0-alpha.20",
55
- "@warp-drive/internal-config": "5.9.0-alpha.20",
56
- "@warp-drive/utilities": "5.9.0-alpha.20",
54
+ "@warp-drive/core": "5.9.0-alpha.21",
55
+ "@warp-drive/internal-config": "5.9.0-alpha.21",
56
+ "@warp-drive/utilities": "5.9.0-alpha.21",
57
57
  "decorator-transforms": "^2.3.0",
58
58
  "ember-source": "~6.12.0",
59
59
  "expect-type": "^1.2.2",