@warp-drive/build-config 4.13.0-alpha.3 → 5.4.0-alpha.128
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/dist/addon-shim.cjs.map +1 -1
- package/dist/babel-macros.js +1 -1
- package/dist/babel-macros.js.map +1 -1
- package/dist/babel-plugin-transform-asserts.cjs.map +1 -1
- package/dist/babel-plugin-transform-deprecations.cjs.map +1 -1
- package/dist/babel-plugin-transform-features.cjs.map +1 -1
- package/dist/babel-plugin-transform-logging.cjs.map +1 -1
- package/dist/canary-features-BzGSGY5j.js.map +1 -1
- package/dist/cjs-set-config.cjs +65 -644
- package/dist/cjs-set-config.cjs.map +1 -1
- package/dist/debugging-BzogyWJo.js.map +1 -1
- package/dist/deprecations-ChFQtx-4.js +32 -0
- package/dist/deprecations-ChFQtx-4.js.map +1 -0
- package/dist/deprecations.js +1 -1
- package/dist/env.js.map +1 -1
- package/dist/index.js +65 -644
- package/dist/index.js.map +1 -1
- package/dist/macros.js.map +1 -1
- package/package.json +2 -2
- package/unstable-preview-types/deprecation-versions.d.ts +58 -602
- package/unstable-preview-types/deprecation-versions.d.ts.map +1 -1
- package/unstable-preview-types/deprecations.d.ts +3 -20
- package/unstable-preview-types/deprecations.d.ts.map +1 -1
- package/dist/deprecations-BjnhZL6k.js +0 -67
- package/dist/deprecations-BjnhZL6k.js.map +0 -1
package/dist/cjs-set-config.cjs
CHANGED
|
@@ -122,621 +122,6 @@ function getEnv() {
|
|
|
122
122
|
* @public
|
|
123
123
|
*/
|
|
124
124
|
const DEPRECATE_CATCH_ALL = '99.0';
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* **id: ember-data:rsvp-unresolved-async**
|
|
128
|
-
*
|
|
129
|
-
* Deprecates when a request promise did not resolve prior to the store tearing down.
|
|
130
|
-
*
|
|
131
|
-
* Note: in most cases even with the promise guard that is now being deprecated
|
|
132
|
-
* a test crash would still be encountered.
|
|
133
|
-
*
|
|
134
|
-
* To resolve: Tests or Fastboot instances which crash need to find triggers requests
|
|
135
|
-
* and properly await them before tearing down.
|
|
136
|
-
*
|
|
137
|
-
* @property DEPRECATE_RSVP_PROMISE
|
|
138
|
-
* @since 4.4
|
|
139
|
-
* @until 5.0
|
|
140
|
-
* @public
|
|
141
|
-
*/
|
|
142
|
-
const DEPRECATE_RSVP_PROMISE = '4.4';
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* **id: ember-data:model-save-promise**
|
|
146
|
-
*
|
|
147
|
-
* Affects
|
|
148
|
-
* - model.save / store.saveRecord
|
|
149
|
-
* - model.reload
|
|
150
|
-
*
|
|
151
|
-
* Deprecates the promise-proxy returned by these methods in favor of
|
|
152
|
-
* a Promise return value.
|
|
153
|
-
*
|
|
154
|
-
* To resolve this deprecation, `await` or `.then` the return value
|
|
155
|
-
* before doing work with the result instead of accessing values via
|
|
156
|
-
* the proxy.
|
|
157
|
-
*
|
|
158
|
-
* To continue utilizing flags such as `isPending` in your templates
|
|
159
|
-
* consider using [ember-promise-helpers](https://github.com/fivetanley/ember-promise-helpers)
|
|
160
|
-
*
|
|
161
|
-
* @property DEPRECATE_SAVE_PROMISE_ACCESS
|
|
162
|
-
* @since 4.4
|
|
163
|
-
* @until 5.0
|
|
164
|
-
* @public
|
|
165
|
-
*/
|
|
166
|
-
const DEPRECATE_SAVE_PROMISE_ACCESS = '4.4';
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* **id: ember-data:deprecate-snapshot-model-class-access**
|
|
170
|
-
*
|
|
171
|
-
* Deprecates accessing the factory class for a given resource type
|
|
172
|
-
* via properties on various classes.
|
|
173
|
-
*
|
|
174
|
-
* Guards
|
|
175
|
-
*
|
|
176
|
-
* - SnapshotRecordArray.type
|
|
177
|
-
* - Snapshot.type
|
|
178
|
-
* - RecordArray.type
|
|
179
|
-
*
|
|
180
|
-
* Use `store.modelFor(<resource-type>)` instead.
|
|
181
|
-
*
|
|
182
|
-
* @property DEPRECATE_SNAPSHOT_MODEL_CLASS_ACCESS
|
|
183
|
-
* @since 4.5
|
|
184
|
-
* @until 5.0
|
|
185
|
-
* @public
|
|
186
|
-
*/
|
|
187
|
-
const DEPRECATE_SNAPSHOT_MODEL_CLASS_ACCESS = '4.5';
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* **id: ember-data:deprecate-store-find**
|
|
191
|
-
*
|
|
192
|
-
* Deprecates using `store.find` instead of `store.findRecord`. Typically
|
|
193
|
-
* `store.find` is a mistaken call that occurs when using implicit route behaviors
|
|
194
|
-
* in Ember which attempt to derive how to load data via parsing the route params
|
|
195
|
-
* for a route which does not implement a `model` hook.
|
|
196
|
-
*
|
|
197
|
-
* To resolve, use `store.findRecord`. This may require implementing an associated
|
|
198
|
-
* route's `model() {}` hook.
|
|
199
|
-
*
|
|
200
|
-
* @property DEPRECATE_STORE_FIND
|
|
201
|
-
* @since 4.5
|
|
202
|
-
* @until 5.0
|
|
203
|
-
* @public
|
|
204
|
-
*/
|
|
205
|
-
const DEPRECATE_STORE_FIND = '4.5';
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* **id: ember-data:deprecate-has-record-for-id**
|
|
209
|
-
*
|
|
210
|
-
* Deprecates `store.hasRecordForId(type, id)` in favor of `store.peekRecord({ type, id }) !== null`.
|
|
211
|
-
*
|
|
212
|
-
* Broadly speaking, while the ability to query for presence is important, a key distinction exists
|
|
213
|
-
* between these methods that make relying on `hasRecordForId` unsafe, as it may report `true` for a
|
|
214
|
-
* record which is not-yet loaded and un-peekable. `peekRecord` offers a safe mechanism by which to check
|
|
215
|
-
* for whether a record is present in a usable manner.
|
|
216
|
-
*
|
|
217
|
-
* @property DEPRECATE_HAS_RECORD
|
|
218
|
-
* @since 4.5
|
|
219
|
-
* @until 5.0
|
|
220
|
-
* @public
|
|
221
|
-
*/
|
|
222
|
-
const DEPRECATE_HAS_RECORD = '4.5';
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* **id: ember-data:deprecate-string-arg-schemas**
|
|
226
|
-
*
|
|
227
|
-
* Deprecates `schema.attributesDefinitionFor(type)` and
|
|
228
|
-
* `schema.relationshipsDefinitionFor(type)` in favor of
|
|
229
|
-
* a consistent object signature (`identifier | { type }`).
|
|
230
|
-
*
|
|
231
|
-
* To resolve change
|
|
232
|
-
*
|
|
233
|
-
* ```diff
|
|
234
|
-
* - store.getSchemaDefinitionService().attributesDefinitionFor('user')
|
|
235
|
-
* + store.getSchemaDefinitionService().attributesDefinitionFor({ type: 'user' })
|
|
236
|
-
* ```
|
|
237
|
-
*
|
|
238
|
-
* @property DEPRECATE_STRING_ARG_SCHEMAS
|
|
239
|
-
* @since 4.5
|
|
240
|
-
* @until 5.0
|
|
241
|
-
* @public
|
|
242
|
-
*/
|
|
243
|
-
const DEPRECATE_STRING_ARG_SCHEMAS = '4.5';
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* **id: ember-data:deprecate-secret-adapter-fallback**
|
|
247
|
-
*
|
|
248
|
-
* Deprecates the secret `-json-api` fallback adapter in favor
|
|
249
|
-
* or an explicit "catch all" application adapter. In addition
|
|
250
|
-
* to this deprecation ensuring the user has explicitly chosen an
|
|
251
|
-
* adapter, this ensures that the user may choose to use no adapter
|
|
252
|
-
* at all.
|
|
253
|
-
*
|
|
254
|
-
* Simplest fix:
|
|
255
|
-
*
|
|
256
|
-
* *<project>/app/adapters/application.js*
|
|
257
|
-
* ```js
|
|
258
|
-
* export { default } from '@ember-data/adapter/json-api';
|
|
259
|
-
* ```
|
|
260
|
-
*
|
|
261
|
-
* @property DEPRECATE_JSON_API_FALLBACK
|
|
262
|
-
* @since 4.5
|
|
263
|
-
* @until 5.0
|
|
264
|
-
* @public
|
|
265
|
-
*/
|
|
266
|
-
const DEPRECATE_JSON_API_FALLBACK = '4.5';
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* **id: ember-data:deprecate-model-reopen**
|
|
270
|
-
*
|
|
271
|
-
* ----
|
|
272
|
-
*
|
|
273
|
-
* For properties known ahead of time, instead of
|
|
274
|
-
*
|
|
275
|
-
* ```ts
|
|
276
|
-
* class User extends Model { @attr firstName; }
|
|
277
|
-
*
|
|
278
|
-
* User.reopen({ lastName: attr() });
|
|
279
|
-
* ```
|
|
280
|
-
*
|
|
281
|
-
* Extend `User` again or include it in the initial definition.
|
|
282
|
-
*
|
|
283
|
-
* ```ts
|
|
284
|
-
* class User extends Model { @attr firstName; @attr lastName }
|
|
285
|
-
* ```
|
|
286
|
-
*
|
|
287
|
-
* For properties generated dynamically, consider registering
|
|
288
|
-
* a `SchemaDefinitionService` with the store , as such services
|
|
289
|
-
* are capable of dynamically adjusting their schemas, and utilize
|
|
290
|
-
* the `instantiateRecord` hook to create a Proxy based class that
|
|
291
|
-
* can react to the changes in the schema.
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
* Use Foo extends Model to extend your class instead
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
* **id: ember-data:deprecate-model-reopenclass**
|
|
300
|
-
*
|
|
301
|
-
* ----
|
|
302
|
-
*
|
|
303
|
-
* Instead of reopenClass, define `static` properties with native class syntax
|
|
304
|
-
* or add them to the final object.
|
|
305
|
-
*
|
|
306
|
-
* ```ts
|
|
307
|
-
* // instead of
|
|
308
|
-
* User.reopenClass({ aStaticMethod() {} });
|
|
309
|
-
*
|
|
310
|
-
* // do this
|
|
311
|
-
* class User {
|
|
312
|
-
* static aStaticMethod() {}
|
|
313
|
-
* }
|
|
314
|
-
*
|
|
315
|
-
* // or do this
|
|
316
|
-
* User.aStaticMethod = function() {}
|
|
317
|
-
* ```
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* @property DEPRECATE_MODEL_REOPEN
|
|
321
|
-
* @since 4.7
|
|
322
|
-
* @until 5.0
|
|
323
|
-
* @public
|
|
324
|
-
*/
|
|
325
|
-
const DEPRECATE_MODEL_REOPEN = '4.7';
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* **id: ember-data:deprecate-early-static**
|
|
329
|
-
*
|
|
330
|
-
* This deprecation triggers if static computed properties
|
|
331
|
-
* or methods are triggered without looking up the record
|
|
332
|
-
* via the store service's `modelFor` hook. Accessing this
|
|
333
|
-
* static information without looking up the model via the
|
|
334
|
-
* store most commonly occurs when
|
|
335
|
-
*
|
|
336
|
-
* - using ember-cli-mirage (to fix, refactor to not use its auto-discovery of ember-data models)
|
|
337
|
-
* - importing a model class and accessing its static information via the import
|
|
338
|
-
*
|
|
339
|
-
* Instead of
|
|
340
|
-
*
|
|
341
|
-
* ```js
|
|
342
|
-
* import User from 'my-app/models/user';
|
|
343
|
-
*
|
|
344
|
-
* const relationships = User.relationshipsByName;
|
|
345
|
-
* ```
|
|
346
|
-
*
|
|
347
|
-
* Do *at least* this
|
|
348
|
-
*
|
|
349
|
-
* ```js
|
|
350
|
-
* const relationships = store.modelFor('user').relationshipsByName;
|
|
351
|
-
* ```
|
|
352
|
-
*
|
|
353
|
-
* However, the much more future proof refactor is to not use `modelFor` at all but instead
|
|
354
|
-
* to utilize the schema service for this static information.
|
|
355
|
-
*
|
|
356
|
-
* ```js
|
|
357
|
-
* const relationships = store.getSchemaDefinitionService().relationshipsDefinitionFor({ type: 'user' });
|
|
358
|
-
* ```
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
* @property DEPRECATE_EARLY_STATIC
|
|
362
|
-
* @since 4.7
|
|
363
|
-
* @until 5.0
|
|
364
|
-
* @public
|
|
365
|
-
*/
|
|
366
|
-
const DEPRECATE_EARLY_STATIC = '4.7';
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* **id: ember-data:deprecate-errors-hash-to-array-helper**
|
|
370
|
-
* **id: ember-data:deprecate-errors-array-to-hash-helper**
|
|
371
|
-
* **id: ember-data:deprecate-normalize-modelname-helper**
|
|
372
|
-
*
|
|
373
|
-
* Deprecates `errorsHashToArray` `errorsArrayToHash` and `normalizeModelName`
|
|
374
|
-
*
|
|
375
|
-
* Users making use of these (already private) utilities can trivially copy them
|
|
376
|
-
* into their own codebase to continue using them, though we recommend refactoring
|
|
377
|
-
* to a more direct conversion into the expected errors format for the errors helpers.
|
|
378
|
-
*
|
|
379
|
-
* For refactoring normalizeModelName we also recommend following the guidance in
|
|
380
|
-
* [RFC#740 Deprecate Non-Strict Types](https://github.com/emberjs/rfcs/pull/740).
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
* @property DEPRECATE_HELPERS
|
|
384
|
-
* @since 4.7
|
|
385
|
-
* @until 5.0
|
|
386
|
-
* @public
|
|
387
|
-
*/
|
|
388
|
-
const DEPRECATE_HELPERS = '4.7';
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* **id: ember-data:deprecate-promise-many-array-behavior**
|
|
392
|
-
*
|
|
393
|
-
* [RFC Documentation](https://rfcs.emberjs.com/id/0745-ember-data-deprecate-methods-on-promise-many-array)
|
|
394
|
-
*
|
|
395
|
-
* This deprecation deprecates accessing values on the asynchronous proxy
|
|
396
|
-
* in favor of first "resolving" or "awaiting" the promise to retrieve a
|
|
397
|
-
* synchronous value.
|
|
398
|
-
*
|
|
399
|
-
* Template iteration of the asynchronous value will still work and not trigger
|
|
400
|
-
* the deprecation, but all JS access should be avoided and HBS access for anything
|
|
401
|
-
* but `{{#each}}` should also be refactored.
|
|
402
|
-
*
|
|
403
|
-
* Recommended approaches include using the addon `ember-promise-helpers`, using
|
|
404
|
-
* Ember's `resource` pattern (including potentially the addon `ember-data-resources`),
|
|
405
|
-
* resolving the value in routes/provider components, or using the references API.
|
|
406
|
-
*
|
|
407
|
-
* An example of using the [hasMany](https://api.emberjs.com/ember-data/4.11/classes/Model/methods/hasMany?anchor=hasMany) [reference API](https://api.emberjs.com/ember-data/release/classes/HasManyReference):
|
|
408
|
-
*
|
|
409
|
-
* ```ts
|
|
410
|
-
* // get the synchronous "ManyArray" value for the asynchronous "friends" relationship.
|
|
411
|
-
* // note, this will return `null` if the relationship has not been loaded yet
|
|
412
|
-
* const value = person.hasMany('friends').value();
|
|
413
|
-
*
|
|
414
|
-
* // to get just the list of related IDs
|
|
415
|
-
* const ids = person.hasMany('friends').ids();
|
|
416
|
-
* ```
|
|
417
|
-
*
|
|
418
|
-
* References participate in autotracking and getters/cached getters etc. which consume them
|
|
419
|
-
* will recompute if the value changes.
|
|
420
|
-
*
|
|
421
|
-
* @property DEPRECATE_PROMISE_MANY_ARRAY_BEHAVIORS
|
|
422
|
-
* @since 4.7
|
|
423
|
-
* @until 5.0
|
|
424
|
-
* @public
|
|
425
|
-
*/
|
|
426
|
-
const DEPRECATE_PROMISE_MANY_ARRAY_BEHAVIORS = '4.7';
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* **id: ember-data:deprecate-non-strict-relationships**
|
|
430
|
-
*
|
|
431
|
-
* Deprecates when belongsTo and hasMany relationships are defined
|
|
432
|
-
* without specifying the inverse record's type.
|
|
433
|
-
*
|
|
434
|
-
* Instead of
|
|
435
|
-
*
|
|
436
|
-
* ```ts
|
|
437
|
-
* class Company extends Model {
|
|
438
|
-
* @hasMany() employees;
|
|
439
|
-
* }
|
|
440
|
-
* class Employee extends Model {
|
|
441
|
-
* @belongsTo() company;
|
|
442
|
-
* }
|
|
443
|
-
* ```
|
|
444
|
-
*
|
|
445
|
-
* Use
|
|
446
|
-
*
|
|
447
|
-
* ```ts
|
|
448
|
-
* class Company extends Model {
|
|
449
|
-
* @hasMany('employee', { async: true, inverse: 'company' }) employees;
|
|
450
|
-
* }
|
|
451
|
-
*
|
|
452
|
-
* class Employee extends Model {
|
|
453
|
-
* @belongsTo('company', { async: true, inverse: 'employees' }) company;
|
|
454
|
-
* }
|
|
455
|
-
* ```
|
|
456
|
-
*
|
|
457
|
-
* @property DEPRECATE_RELATIONSHIPS_WITHOUT_TYPE
|
|
458
|
-
* @since 4.7
|
|
459
|
-
* @until 5.0
|
|
460
|
-
* @public
|
|
461
|
-
*/
|
|
462
|
-
const DEPRECATE_RELATIONSHIPS_WITHOUT_TYPE = '4.7';
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* **id: ember-data:deprecate-non-strict-relationships**
|
|
466
|
-
*
|
|
467
|
-
* Deprecates when belongsTo and hasMany relationships are defined
|
|
468
|
-
* without specifying whether the relationship is asynchronous.
|
|
469
|
-
*
|
|
470
|
-
* The current behavior is that relationships which do not define
|
|
471
|
-
* this setting are aschronous (`{ async: true }`).
|
|
472
|
-
*
|
|
473
|
-
* Instead of
|
|
474
|
-
*
|
|
475
|
-
* ```ts
|
|
476
|
-
* class Company extends Model {
|
|
477
|
-
* @hasMany('employee') employees;
|
|
478
|
-
* }
|
|
479
|
-
* class Employee extends Model {
|
|
480
|
-
* @belongsTo('company') company;
|
|
481
|
-
* }
|
|
482
|
-
* ```
|
|
483
|
-
*
|
|
484
|
-
* Use
|
|
485
|
-
*
|
|
486
|
-
* ```ts
|
|
487
|
-
* class Company extends Model {
|
|
488
|
-
* @hasMany('employee', { async: true, inverse: 'company' }) employees;
|
|
489
|
-
* }
|
|
490
|
-
*
|
|
491
|
-
* class Employee extends Model {
|
|
492
|
-
* @belongsTo('company', { async: true, inverse: 'employees' }) company;
|
|
493
|
-
* }
|
|
494
|
-
* ```
|
|
495
|
-
*
|
|
496
|
-
* @property DEPRECATE_RELATIONSHIPS_WITHOUT_ASYNC
|
|
497
|
-
* @since 4.7
|
|
498
|
-
* @until 5.0
|
|
499
|
-
* @public
|
|
500
|
-
*/
|
|
501
|
-
const DEPRECATE_RELATIONSHIPS_WITHOUT_ASYNC = '4.7';
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* **id: ember-data:deprecate-non-strict-relationships**
|
|
505
|
-
*
|
|
506
|
-
* Deprecates when belongsTo and hasMany relationships are defined
|
|
507
|
-
* without specifying the inverse field on the related type.
|
|
508
|
-
*
|
|
509
|
-
* The current behavior is that relationships which do not define
|
|
510
|
-
* this setting have their inverse determined at runtime, which is
|
|
511
|
-
* potentially non-deterministic when mixins and polymorphism are involved.
|
|
512
|
-
*
|
|
513
|
-
* If an inverse relationship exists and you wish changes on one side to
|
|
514
|
-
* reflect onto the other side, use the inverse key. If you wish to not have
|
|
515
|
-
* changes reflected or no inverse relationship exists, specify `inverse: null`.
|
|
516
|
-
*
|
|
517
|
-
* Instead of
|
|
518
|
-
*
|
|
519
|
-
* ```ts
|
|
520
|
-
* class Company extends Model {
|
|
521
|
-
* @hasMany('employee') employees;
|
|
522
|
-
* }
|
|
523
|
-
* class Employee extends Model {
|
|
524
|
-
* @belongsTo('company') company;
|
|
525
|
-
* }
|
|
526
|
-
* ```
|
|
527
|
-
*
|
|
528
|
-
* Use
|
|
529
|
-
*
|
|
530
|
-
* ```ts
|
|
531
|
-
* class Company extends Model {
|
|
532
|
-
* @hasMany('employee', { async: true, inverse: 'company' }) employees;
|
|
533
|
-
* }
|
|
534
|
-
*
|
|
535
|
-
* class Employee extends Model {
|
|
536
|
-
* @belongsTo('company', { async: true, inverse: 'employees' }) company;
|
|
537
|
-
* }
|
|
538
|
-
* ```
|
|
539
|
-
*
|
|
540
|
-
* Instead of
|
|
541
|
-
*
|
|
542
|
-
* ```ts
|
|
543
|
-
* class Company extends Model {
|
|
544
|
-
* @hasMany('employee') employees;
|
|
545
|
-
* }
|
|
546
|
-
* class Employee extends Model {
|
|
547
|
-
* @attr name;
|
|
548
|
-
* }
|
|
549
|
-
* ```
|
|
550
|
-
*
|
|
551
|
-
* Use
|
|
552
|
-
*
|
|
553
|
-
* ```ts
|
|
554
|
-
* class Company extends Model {
|
|
555
|
-
* @hasMany('employee', { async: true, inverse: null }) employees;
|
|
556
|
-
* }
|
|
557
|
-
*
|
|
558
|
-
* class Employee extends Model {
|
|
559
|
-
* @attr name;
|
|
560
|
-
* }
|
|
561
|
-
* ```
|
|
562
|
-
*
|
|
563
|
-
* @property DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE
|
|
564
|
-
* @since 4.7
|
|
565
|
-
* @until 5.0
|
|
566
|
-
* @public
|
|
567
|
-
*/
|
|
568
|
-
const DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE = '4.7';
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* **id: ember-data:no-a-with-array-like**
|
|
572
|
-
*
|
|
573
|
-
* Deprecates when calling `A()` on an EmberData ArrayLike class
|
|
574
|
-
* is detected. This deprecation may not always trigger due to complexities
|
|
575
|
-
* in ember-source versions and the use (or disabling) of prototype extensions.
|
|
576
|
-
*
|
|
577
|
-
* To fix, just use the native array methods instead of the EmberArray methods
|
|
578
|
-
* and refrain from wrapping the array in `A()`.
|
|
579
|
-
*
|
|
580
|
-
* Note that some computed property macros may themselves utilize `A()`, in which
|
|
581
|
-
* scenario the computed properties need to be upgraded to octane syntax.
|
|
582
|
-
*
|
|
583
|
-
* For instance, instead of:
|
|
584
|
-
*
|
|
585
|
-
* ```ts
|
|
586
|
-
* class extends Component {
|
|
587
|
-
* @filterBy('items', 'isComplete') completedItems;
|
|
588
|
-
* }
|
|
589
|
-
* ```
|
|
590
|
-
*
|
|
591
|
-
* Use the following:
|
|
592
|
-
*
|
|
593
|
-
* ```ts
|
|
594
|
-
* class extends Component {
|
|
595
|
-
* get completedItems() {
|
|
596
|
-
* return this.items.filter(item => item.isComplete);
|
|
597
|
-
* }
|
|
598
|
-
* }
|
|
599
|
-
* ```
|
|
600
|
-
*
|
|
601
|
-
* @property DEPRECATE_A_USAGE
|
|
602
|
-
* @since 4.7
|
|
603
|
-
* @until 5.0
|
|
604
|
-
* @public
|
|
605
|
-
*/
|
|
606
|
-
const DEPRECATE_A_USAGE = '4.7';
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* **id: ember-data:deprecate-promise-proxies**
|
|
610
|
-
*
|
|
611
|
-
* Additional Reading: [RFC#846 Deprecate Proxies](https://rfcs.emberjs.com/id/0846-ember-data-deprecate-proxies)
|
|
612
|
-
*
|
|
613
|
-
* Deprecates using the proxy object/proxy array capabilities of values returned from
|
|
614
|
-
*
|
|
615
|
-
* - `store.findRecord`
|
|
616
|
-
* - `store.findAll`
|
|
617
|
-
* - `store.query`
|
|
618
|
-
* - `store.queryRecord`
|
|
619
|
-
* - `record.save`
|
|
620
|
-
* - `recordArray.save`
|
|
621
|
-
* - `recordArray.update`
|
|
622
|
-
*
|
|
623
|
-
* These methods will now return a native Promise that resolves with the value.
|
|
624
|
-
*
|
|
625
|
-
* Note that this does not deprecate the proxy behaviors of `PromiseBelongsTo`. See RFC for reasoning.
|
|
626
|
-
* The opportunity should still be taken if available to stop using these proxy behaviors; however, this class
|
|
627
|
-
* will remain until `import Model from '@ember-data/model';` is deprecated more broadly.
|
|
628
|
-
*
|
|
629
|
-
* @property DEPRECATE_PROMISE_PROXIES
|
|
630
|
-
* @since 4.7
|
|
631
|
-
* @until 5.0
|
|
632
|
-
* @public
|
|
633
|
-
*/
|
|
634
|
-
const DEPRECATE_PROMISE_PROXIES = '4.7';
|
|
635
|
-
|
|
636
|
-
/**
|
|
637
|
-
* **id: ember-data:deprecate-array-like**
|
|
638
|
-
*
|
|
639
|
-
* Deprecates Ember "Array-like" methods on RecordArray and ManyArray.
|
|
640
|
-
*
|
|
641
|
-
* These are the arrays returned respectively by `store.peekAll()`, `store.findAll()`and
|
|
642
|
-
* hasMany relationships on instance of Model or `record.hasMany('relationshipName').value()`.
|
|
643
|
-
*
|
|
644
|
-
* The appropriate refactor is to treat these arrays as native arrays and to use native array methods.
|
|
645
|
-
*
|
|
646
|
-
* For instance, instead of:
|
|
647
|
-
*
|
|
648
|
-
* ```ts
|
|
649
|
-
* users.firstObject;
|
|
650
|
-
* ```
|
|
651
|
-
*
|
|
652
|
-
* Use:
|
|
653
|
-
*
|
|
654
|
-
* ```ts
|
|
655
|
-
* users[0];
|
|
656
|
-
* // or
|
|
657
|
-
* users.at(0);
|
|
658
|
-
* ```
|
|
659
|
-
*
|
|
660
|
-
* @property DEPRECATE_ARRAY_LIKE
|
|
661
|
-
* @since 4.7
|
|
662
|
-
* @until 5.0
|
|
663
|
-
* @public
|
|
664
|
-
*/
|
|
665
|
-
const DEPRECATE_ARRAY_LIKE = '4.7';
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* **id: <none yet assigned>**
|
|
669
|
-
*
|
|
670
|
-
* This is a planned deprecation which will trigger when observer or computed
|
|
671
|
-
* chains are used to watch for changes on any EmberData RecordArray, ManyArray
|
|
672
|
-
* or PromiseManyArray.
|
|
673
|
-
*
|
|
674
|
-
* Support for these chains is currently guarded by the inactive deprecation flag
|
|
675
|
-
* listed here.
|
|
676
|
-
*
|
|
677
|
-
* @property DEPRECATE_COMPUTED_CHAINS
|
|
678
|
-
* @since 5.0
|
|
679
|
-
* @until 6.0
|
|
680
|
-
* @public
|
|
681
|
-
*/
|
|
682
|
-
const DEPRECATE_COMPUTED_CHAINS = '5.0';
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
* **id: ember-data:non-explicit-relationships**
|
|
686
|
-
*
|
|
687
|
-
* Deprecates when polymorphic relationships are detected via inheritance or mixins
|
|
688
|
-
* and no polymorphic relationship configuration has been setup.
|
|
689
|
-
*
|
|
690
|
-
* For further reading please review [RFC#793](https://rfcs.emberjs.com/id/0793-polymporphic-relations-without-inheritance)
|
|
691
|
-
* which introduced support for explicit relationship polymorphism without
|
|
692
|
-
* mixins or inheritance.
|
|
693
|
-
*
|
|
694
|
-
* You may still use mixins and inheritance to setup your polymorphism; however, the class
|
|
695
|
-
* structure is no longer what drives the design. Instead polymorphism is "traits" based or "structural":
|
|
696
|
-
* so long as each model which can satisfy the polymorphic relationship defines the inverse in the same
|
|
697
|
-
* way they work.
|
|
698
|
-
*
|
|
699
|
-
* Notably: `inverse: null` relationships can receive any type as a record with no additional configuration
|
|
700
|
-
* at all.
|
|
701
|
-
*
|
|
702
|
-
* Example Polymorphic Relationship Configuration
|
|
703
|
-
*
|
|
704
|
-
* ```ts
|
|
705
|
-
* // polymorphic relationship
|
|
706
|
-
* class Tag extends Model {
|
|
707
|
-
* @hasMany("taggable", { async: false, polymorphic: true, inverse: "tags" }) tagged;
|
|
708
|
-
* }
|
|
709
|
-
*
|
|
710
|
-
* // an inverse concrete relationship (e.g. satisfies "taggable")
|
|
711
|
-
* class Post extends Model {
|
|
712
|
-
* @hasMany("tag", { async: false, inverse: "tagged", as: "taggable" }) tags;
|
|
713
|
-
* }
|
|
714
|
-
* ```
|
|
715
|
-
*
|
|
716
|
-
* @property DEPRECATE_NON_EXPLICIT_POLYMORPHISM
|
|
717
|
-
* @since 4.7
|
|
718
|
-
* @until 5.0
|
|
719
|
-
* @public
|
|
720
|
-
*/
|
|
721
|
-
const DEPRECATE_NON_EXPLICIT_POLYMORPHISM = '4.7';
|
|
722
|
-
|
|
723
|
-
/**
|
|
724
|
-
* **id: ember-data:deprecate-many-array-duplicates**
|
|
725
|
-
*
|
|
726
|
-
* When the flag is `true` (default), adding duplicate records to a `ManyArray`
|
|
727
|
-
* is deprecated in non-production environments. In production environments,
|
|
728
|
-
* duplicate records added to a `ManyArray` will be deduped and no error will
|
|
729
|
-
* be thrown.
|
|
730
|
-
*
|
|
731
|
-
* When the flag is `false`, an error will be thrown when duplicates are added.
|
|
732
|
-
*
|
|
733
|
-
* @property DEPRECATE_MANY_ARRAY_DUPLICATES
|
|
734
|
-
* @since 5.3
|
|
735
|
-
* @until 6.0
|
|
736
|
-
* @public
|
|
737
|
-
*/
|
|
738
|
-
const DEPRECATE_MANY_ARRAY_DUPLICATES = '4.12'; // '5.3';
|
|
739
|
-
|
|
740
125
|
/**
|
|
741
126
|
* **id: ember-data:deprecate-non-strict-types**
|
|
742
127
|
*
|
|
@@ -795,6 +180,42 @@ const DEPRECATE_NON_STRICT_TYPES = '5.3';
|
|
|
795
180
|
*/
|
|
796
181
|
const DEPRECATE_NON_STRICT_ID = '5.3';
|
|
797
182
|
|
|
183
|
+
/**
|
|
184
|
+
* **id: <none yet assigned>**
|
|
185
|
+
*
|
|
186
|
+
* This is a planned deprecation which will trigger when observer or computed
|
|
187
|
+
* chains are used to watch for changes on any EmberData LiveArray, CollectionRecordArray,
|
|
188
|
+
* ManyArray or PromiseManyArray.
|
|
189
|
+
*
|
|
190
|
+
* Support for these chains is currently guarded by the deprecation flag
|
|
191
|
+
* listed here, enabling removal of the behavior if desired.
|
|
192
|
+
*
|
|
193
|
+
* @property DEPRECATE_COMPUTED_CHAINS
|
|
194
|
+
* @since 5.0
|
|
195
|
+
* @until 6.0
|
|
196
|
+
* @public
|
|
197
|
+
*/
|
|
198
|
+
const DEPRECATE_COMPUTED_CHAINS = '5.0';
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* **id: ember-data:deprecate-legacy-imports**
|
|
202
|
+
*
|
|
203
|
+
* Deprecates when importing from `ember-data/*` instead of `@ember-data/*`
|
|
204
|
+
* in order to prepare for the eventual removal of the legacy `ember-data/*`
|
|
205
|
+
*
|
|
206
|
+
* All imports from `ember-data/*` should be updated to `@ember-data/*`
|
|
207
|
+
* except for `ember-data/store`. When you are using `ember-data` (as opposed to
|
|
208
|
+
* installing the indivudal packages) you should import from `ember-data/store`
|
|
209
|
+
* instead of `@ember-data/store` in order to receive the appropriate configuration
|
|
210
|
+
* of defaults.
|
|
211
|
+
*
|
|
212
|
+
* @property DEPRECATE_LEGACY_IMPORTS
|
|
213
|
+
* @since 5.3
|
|
214
|
+
* @until 6.0
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
const DEPRECATE_LEGACY_IMPORTS = '5.3';
|
|
218
|
+
|
|
798
219
|
/**
|
|
799
220
|
* **id: ember-data:deprecate-non-unique-collection-payloads**
|
|
800
221
|
*
|
|
@@ -985,6 +406,23 @@ const DEPRECATE_NON_UNIQUE_PAYLOADS = '5.3';
|
|
|
985
406
|
*/
|
|
986
407
|
const DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE = '5.3';
|
|
987
408
|
|
|
409
|
+
/**
|
|
410
|
+
* **id: ember-data:deprecate-many-array-duplicates**
|
|
411
|
+
*
|
|
412
|
+
* When the flag is `true` (default), adding duplicate records to a `ManyArray`
|
|
413
|
+
* is deprecated in non-production environments. In production environments,
|
|
414
|
+
* duplicate records added to a `ManyArray` will be deduped and no error will
|
|
415
|
+
* be thrown.
|
|
416
|
+
*
|
|
417
|
+
* When the flag is `false`, an error will be thrown when duplicates are added.
|
|
418
|
+
*
|
|
419
|
+
* @property DEPRECATE_MANY_ARRAY_DUPLICATES
|
|
420
|
+
* @since 5.3
|
|
421
|
+
* @until 6.0
|
|
422
|
+
* @public
|
|
423
|
+
*/
|
|
424
|
+
const DEPRECATE_MANY_ARRAY_DUPLICATES = '5.3';
|
|
425
|
+
|
|
988
426
|
/**
|
|
989
427
|
* **id: ember-data:deprecate-store-extends-ember-object**
|
|
990
428
|
*
|
|
@@ -1057,52 +495,35 @@ const ENABLE_LEGACY_SCHEMA_SERVICE = '5.4';
|
|
|
1057
495
|
const DEPRECATE_EMBER_INFLECTOR = '5.3';
|
|
1058
496
|
|
|
1059
497
|
/**
|
|
1060
|
-
* This is a special flag that can be used to opt-in early to receiving deprecations introduced in
|
|
1061
|
-
* which have had their infra backported to
|
|
498
|
+
* This is a special flag that can be used to opt-in early to receiving deprecations introduced in 6.x
|
|
499
|
+
* which have had their infra backported to 5.x versions of EmberData.
|
|
1062
500
|
*
|
|
1063
|
-
* When this flag is not present or set to `true`, the deprecations from the
|
|
501
|
+
* When this flag is not present or set to `true`, the deprecations from the 6.x branch
|
|
1064
502
|
* will not print their messages and the deprecation cannot be resolved.
|
|
1065
503
|
*
|
|
1066
|
-
* When this flag is present and set to `false`, the deprecations from the
|
|
504
|
+
* When this flag is present and set to `false`, the deprecations from the 6.x branch will
|
|
1067
505
|
* print and can be resolved.
|
|
1068
506
|
*
|
|
1069
|
-
* @property
|
|
1070
|
-
* @since
|
|
1071
|
-
* @until
|
|
507
|
+
* @property DISABLE_7X_DEPRECATIONS
|
|
508
|
+
* @since 5.3
|
|
509
|
+
* @until 7.0
|
|
1072
510
|
* @public
|
|
1073
511
|
*/
|
|
1074
|
-
const
|
|
512
|
+
const DISABLE_7X_DEPRECATIONS = '7.0';
|
|
1075
513
|
|
|
1076
514
|
const CURRENT_DEPRECATIONS = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
1077
515
|
__proto__: null,
|
|
1078
|
-
DEPRECATE_ARRAY_LIKE,
|
|
1079
|
-
DEPRECATE_A_USAGE,
|
|
1080
516
|
DEPRECATE_CATCH_ALL,
|
|
1081
517
|
DEPRECATE_COMPUTED_CHAINS,
|
|
1082
|
-
DEPRECATE_EARLY_STATIC,
|
|
1083
518
|
DEPRECATE_EMBER_INFLECTOR,
|
|
1084
|
-
|
|
1085
|
-
DEPRECATE_HELPERS,
|
|
1086
|
-
DEPRECATE_JSON_API_FALLBACK,
|
|
519
|
+
DEPRECATE_LEGACY_IMPORTS,
|
|
1087
520
|
DEPRECATE_MANY_ARRAY_DUPLICATES,
|
|
1088
|
-
DEPRECATE_MODEL_REOPEN,
|
|
1089
|
-
DEPRECATE_NON_EXPLICIT_POLYMORPHISM,
|
|
1090
521
|
DEPRECATE_NON_STRICT_ID,
|
|
1091
522
|
DEPRECATE_NON_STRICT_TYPES,
|
|
1092
523
|
DEPRECATE_NON_UNIQUE_PAYLOADS,
|
|
1093
|
-
DEPRECATE_PROMISE_MANY_ARRAY_BEHAVIORS,
|
|
1094
|
-
DEPRECATE_PROMISE_PROXIES,
|
|
1095
|
-
DEPRECATE_RELATIONSHIPS_WITHOUT_ASYNC,
|
|
1096
|
-
DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE,
|
|
1097
|
-
DEPRECATE_RELATIONSHIPS_WITHOUT_TYPE,
|
|
1098
524
|
DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE,
|
|
1099
|
-
DEPRECATE_RSVP_PROMISE,
|
|
1100
|
-
DEPRECATE_SAVE_PROMISE_ACCESS,
|
|
1101
|
-
DEPRECATE_SNAPSHOT_MODEL_CLASS_ACCESS,
|
|
1102
525
|
DEPRECATE_STORE_EXTENDS_EMBER_OBJECT,
|
|
1103
|
-
|
|
1104
|
-
DEPRECATE_STRING_ARG_SCHEMAS,
|
|
1105
|
-
DISABLE_6X_DEPRECATIONS,
|
|
526
|
+
DISABLE_7X_DEPRECATIONS,
|
|
1106
527
|
ENABLE_LEGACY_SCHEMA_SERVICE
|
|
1107
528
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
1108
529
|
|
|
@@ -1116,10 +537,10 @@ function deprecationIsNextMajorCycle(deprecatedSince) {
|
|
|
1116
537
|
function getDeprecations(compatVersion, deprecations) {
|
|
1117
538
|
const flags = {};
|
|
1118
539
|
const keys = Object.keys(CURRENT_DEPRECATIONS);
|
|
1119
|
-
const
|
|
540
|
+
const DISABLE_7X_DEPRECATIONS = deprecations?.DISABLE_7X_DEPRECATIONS ?? true;
|
|
1120
541
|
keys.forEach(flag => {
|
|
1121
542
|
const deprecatedSince = CURRENT_DEPRECATIONS[flag];
|
|
1122
|
-
const isDeactivatedDeprecationNotice =
|
|
543
|
+
const isDeactivatedDeprecationNotice = DISABLE_7X_DEPRECATIONS && deprecationIsNextMajorCycle(deprecatedSince);
|
|
1123
544
|
let flagState = true; // default to no code-stripping
|
|
1124
545
|
|
|
1125
546
|
if (!isDeactivatedDeprecationNotice) {
|