@warp-drive-mirror/build-config 5.6.0-alpha.3 → 5.6.0-alpha.4

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.
Files changed (49) hide show
  1. package/dist/babel-macros.js +45 -12
  2. package/dist/babel-macros.js.map +1 -1
  3. package/dist/babel-plugin-transform-asserts.cjs +2 -2
  4. package/dist/babel-plugin-transform-asserts.cjs.map +1 -1
  5. package/dist/babel-plugin-transform-deprecations.cjs +2 -2
  6. package/dist/babel-plugin-transform-deprecations.cjs.map +1 -1
  7. package/dist/babel-plugin-transform-features.cjs +2 -2
  8. package/dist/babel-plugin-transform-features.cjs.map +1 -1
  9. package/dist/babel-plugin-transform-logging.cjs +2 -2
  10. package/dist/babel-plugin-transform-logging.cjs.map +1 -1
  11. package/dist/canary-features-DF5hbs2w.js +170 -0
  12. package/dist/canary-features-DF5hbs2w.js.map +1 -0
  13. package/dist/canary-features.js +1 -1
  14. package/dist/cjs-set-config.cjs +174 -602
  15. package/dist/cjs-set-config.cjs.map +1 -1
  16. package/dist/{debugging-BtpYr1v0.js → debugging-VdsvkNjX.js} +80 -62
  17. package/dist/debugging-VdsvkNjX.js.map +1 -0
  18. package/dist/debugging.js +1 -1
  19. package/dist/deprecations-BVxAmwe9.js +549 -0
  20. package/dist/deprecations-BVxAmwe9.js.map +1 -0
  21. package/dist/deprecations.js +1 -1
  22. package/dist/env.js +124 -0
  23. package/dist/env.js.map +1 -1
  24. package/dist/index.js +12 -515
  25. package/dist/index.js.map +1 -1
  26. package/dist/macros.js +18 -0
  27. package/dist/macros.js.map +1 -1
  28. package/package.json +2 -5
  29. package/unstable-preview-types/babel-macros.d.ts +10 -0
  30. package/unstable-preview-types/babel-macros.d.ts.map +1 -1
  31. package/unstable-preview-types/canary-features.d.ts +97 -40
  32. package/unstable-preview-types/canary-features.d.ts.map +1 -1
  33. package/unstable-preview-types/debugging.d.ts +59 -48
  34. package/unstable-preview-types/debugging.d.ts.map +1 -1
  35. package/unstable-preview-types/deprecation-versions.d.ts +0 -469
  36. package/unstable-preview-types/deprecation-versions.d.ts.map +1 -1
  37. package/unstable-preview-types/deprecations.d.ts +504 -1
  38. package/unstable-preview-types/deprecations.d.ts.map +1 -1
  39. package/unstable-preview-types/env.d.ts +123 -0
  40. package/unstable-preview-types/env.d.ts.map +1 -1
  41. package/unstable-preview-types/index.d.ts +77 -13
  42. package/unstable-preview-types/index.d.ts.map +1 -1
  43. package/unstable-preview-types/macros.d.ts +16 -0
  44. package/unstable-preview-types/macros.d.ts.map +1 -1
  45. package/dist/canary-features-D1wplYmb.js +0 -113
  46. package/dist/canary-features-D1wplYmb.js.map +0 -1
  47. package/dist/debugging-BtpYr1v0.js.map +0 -1
  48. package/dist/deprecations-D_dBAPC9.js +0 -34
  49. package/dist/deprecations-D_dBAPC9.js.map +0 -1
@@ -32,9 +32,6 @@ function getEnv() {
32
32
  };
33
33
  }
34
34
 
35
- /**
36
- * @module @warp-drive-mirror/build-config
37
- */
38
35
  // ========================
39
36
  // FOR CONTRIBUTING AUTHORS
40
37
  //
@@ -52,496 +49,18 @@ function getEnv() {
52
49
  //
53
50
  // ========================
54
51
  //
55
-
56
- /**
57
- * ## Deprecation Management
58
- *
59
- * EmberData allows users to opt-in and remove code that exists to support deprecated
60
- * behaviors.
61
- *
62
- * If your app has resolved all deprecations present in a given version,
63
- * you may specify that version as your "compatibility" version to remove
64
- * the code that supported the deprecated behavior from your app.
65
- *
66
- * For instance, if a deprecation was introduced in 3.13, and the app specifies
67
- * 3.13 as its minimum version compatibility, any deprecations introduced before
68
- * or during 3.13 would be stripped away.
69
- *
70
- * An app can use a different version than what it specifies as it's compatibility
71
- * version. For instance, an App could be using `3.16` while specifying compatibility
72
- * with `3.12`. This would remove any deprecations that were present in or before `3.12`
73
- * but keep support for anything deprecated in or above `3.13`.
74
- *
75
- * You may also specify that specific deprecations are resolved. These approaches
76
- * may be used together.
77
- *
78
- * ```ts
79
- * setConfig(app, __dirname, {
80
- * // declare that all deprecations through "5.0" have been fully resolved
81
- * compatWith: '5.0',
82
- *
83
- * // mark individual deprecations as resolved by setting them to `false`
84
- * deprecations: {
85
- * // resolve individual deprecations here
86
- * },
87
- * });
88
- * ```
89
- *
90
- * > [!TIP]
91
- * > EmberData does not test against permutations of deprecations
92
- * > being stripped, our tests run against "all deprecated code included"
93
- * > and "all deprecated code removed". Unspecified behavior may sometimes occur
94
- * > when removing code for only some deprecations associated to a version number.
95
- *
96
- * @class CurrentDeprecations
97
- * @public
98
- */
99
52
  const DEPRECATE_CATCH_ALL = '99.0';
100
- /**
101
- * **id: ember-data:deprecate-non-strict-types**
102
- *
103
- * Currently, EmberData expects that the `type` property associated with
104
- * a resource follows several conventions.
105
- *
106
- * - The `type` property must be a non-empty string
107
- * - The `type` property must be singular
108
- * - The `type` property must be dasherized
109
- *
110
- * We are deprecating support for types that do not match this pattern
111
- * in order to unlock future improvements in which we can support `type`
112
- * being any string of your choosing.
113
- *
114
- * The goal is that in the future, you will be able to use any string
115
- * so long as it matches what your configured cache, identifier generation,
116
- * and schemas expect.
117
- *
118
- * E.G. It will matter not that your string is in a specific format like
119
- * singular, dasherized, etc. so long as everywhere you refer to the type
120
- * you use the same string.
121
- *
122
- * If using @ember-data-mirror/model, there will always be a restriction that the
123
- * `type` must match the path on disk where the model is defined.
124
- *
125
- * e.g. `app/models/foo/bar-bem.js` must have a type of `foo/bar-bem`
126
- *
127
- * @property DEPRECATE_NON_STRICT_TYPES
128
- * @type {Boolean}
129
- * @since 5.3
130
- * @until 6.0
131
- * @public
132
- */
133
53
  const DEPRECATE_NON_STRICT_TYPES = '5.3';
134
-
135
- /**
136
- * **id: ember-data:deprecate-non-strict-id**
137
- *
138
- * Currently, EmberData expects that the `id` property associated with
139
- * a resource is a string.
140
- *
141
- * However, for legacy support in many locations we would accept a number
142
- * which would then immediately be coerced into a string.
143
- *
144
- * We are deprecating this legacy support for numeric IDs.
145
- *
146
- * The goal is that in the future, you will be able to use any ID format
147
- * so long as everywhere you refer to the ID you use the same format.
148
- *
149
- * However, for identifiers we will always use string IDs and so any
150
- * custom identifier configuration should provide a string ID.
151
- *
152
- * @property DEPRECATE_NON_STRICT_ID
153
- * @type {Boolean}
154
- * @since 5.3
155
- * @until 6.0
156
- * @public
157
- */
158
54
  const DEPRECATE_NON_STRICT_ID = '5.3';
159
-
160
- /**
161
- * **id: <none yet assigned>**
162
- *
163
- * This is a planned deprecation which will trigger when observer or computed
164
- * chains are used to watch for changes on any EmberData LiveArray, CollectionRecordArray,
165
- * ManyArray or PromiseManyArray.
166
- *
167
- * Support for these chains is currently guarded by the deprecation flag
168
- * listed here, enabling removal of the behavior if desired.
169
- *
170
- * The instrumentation was added in 5.0 but the version number
171
- * is set to 7.0 as we do not want to strip support without
172
- * adding a deprecation message.
173
- *
174
- * Once we've added the deprecation message, we will
175
- * update this version number to the proper version.
176
- *
177
- * @property DEPRECATE_COMPUTED_CHAINS
178
- * @type {Boolean}
179
- * @since 5.0
180
- * @until 8.0
181
- * @public
182
- */
183
55
  const DEPRECATE_COMPUTED_CHAINS = '7.0';
184
-
185
- /**
186
- * **id: ember-data:deprecate-legacy-imports**
187
- *
188
- * Deprecates when importing from `ember-data/*` instead of `@ember-data/*`
189
- * in order to prepare for the eventual removal of the legacy `ember-data/*`
190
- *
191
- * All imports from `ember-data/*` should be updated to `@ember-data/*`
192
- * except for `ember-data/store`. When you are using `ember-data` (as opposed to
193
- * installing the indivudal packages) you should import from `ember-data/store`
194
- * instead of `@ember-data-mirror/store` in order to receive the appropriate configuration
195
- * of defaults.
196
- *
197
- * @property DEPRECATE_LEGACY_IMPORTS
198
- * @type {Boolean}
199
- * @since 5.3
200
- * @until 6.0
201
- * @public
202
- */
203
56
  const DEPRECATE_LEGACY_IMPORTS = '5.3';
204
-
205
- /**
206
- * **id: ember-data:deprecate-non-unique-collection-payloads**
207
- *
208
- * Deprecates when the data for a hasMany relationship contains
209
- * duplicate identifiers.
210
- *
211
- * Previously, relationships would silently de-dupe the data
212
- * when received, but this behavior is being removed in favor
213
- * of erroring if the same related record is included multiple
214
- * times.
215
- *
216
- * For instance, in JSON:API the below relationship data would
217
- * be considered invalid:
218
- *
219
- * ```json
220
- * {
221
- * "data": {
222
- * "type": "article",
223
- * "id": "1",
224
- * "relationships": {
225
- * "comments": {
226
- * "data": [
227
- * { "type": "comment", "id": "1" },
228
- * { "type": "comment", "id": "2" },
229
- * { "type": "comment", "id": "1" } // duplicate
230
- * ]
231
- * }
232
- * }
233
- * }
234
- * ```
235
- *
236
- * To resolve this deprecation, either update your server to
237
- * not include duplicate data, or implement normalization logic
238
- * in either a request handler or serializer which removes
239
- * duplicate data from relationship payloads.
240
- *
241
- * @property DEPRECATE_NON_UNIQUE_PAYLOADS
242
- * @type {Boolean}
243
- * @since 5.3
244
- * @until 6.0
245
- * @public
246
- */
247
57
  const DEPRECATE_NON_UNIQUE_PAYLOADS = '5.3';
248
-
249
- /**
250
- * **id: ember-data:deprecate-relationship-remote-update-clearing-local-state**
251
- *
252
- * Deprecates when a relationship is updated remotely and the local state
253
- * is cleared of all changes except for "new" records.
254
- *
255
- * Instead, any records not present in the new payload will be considered
256
- * "removed" while any records present in the new payload will be considered "added".
257
- *
258
- * This allows us to "commit" local additions and removals, preserving any additions
259
- * or removals that are not yet reflected in the remote state.
260
- *
261
- * For instance, given the following initial state:
262
- *
263
- * remote: A, B, C
264
- * local: add D, E
265
- * remove B, C
266
- * => A, D, E
267
- *
268
- *
269
- * If after an update, the remote state is now A, B, D, F then the new state will be
270
- *
271
- * remote: A, B, D, F
272
- * local: add E
273
- * remove B
274
- * => A, D, E, F
275
- *
276
- * Under the old behavior the updated local state would instead have been
277
- * => A, B, D, F
278
- *
279
- * Similarly, if a belongsTo remote State was A while its local state was B,
280
- * then under the old behavior if the remote state changed to C, the local state
281
- * would be updated to C. Under the new behavior, the local state would remain B.
282
- *
283
- * If the remote state was A while its local state was `null`, then under the old
284
- * behavior if the remote state changed to C, the local state would be updated to C.
285
- * Under the new behavior, the local state would remain `null`.
286
- *
287
- * Thus the new correct mental model is that the state of the relationship at any point
288
- * in time is whatever the most recent remote state is, plus any local additions or removals
289
- * you have made that have not yet been reflected by the remote state.
290
- *
291
- * > Note: The old behavior extended to modifying the inverse of a relationship. So if
292
- * > you had local state not reflected in the new remote state, inverses would be notified
293
- * > and their state reverted as well when "resetting" the relationship.
294
- * > Under the new behavior, since the local state is preserved the inverses will also
295
- * > not be reverted.
296
- *
297
- * ### Resolving this deprecation
298
- *
299
- * Resolving this deprecation can be done individually for each relationship
300
- * or globally for all relationships.
301
- *
302
- * To resolve it globally, set the `DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE`
303
- * to `false` in ember-cli-build.js
304
- *
305
- * ```js
306
- * const { setConfig } = await import('@warp-drive-mirror/build-config');
307
- *
308
- * let app = new EmberApp(defaults, {});
309
- *
310
- * setConfig(app, __dirname, {
311
- * deprecations: {
312
- * // set to false to strip the deprecated code (thereby opting into the new behavior)
313
- * DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE: false
314
- * }
315
- * });
316
- * ```
317
- *
318
- * To resolve this deprecation on an individual relationship, adjust the `options` passed to
319
- * the relationship. For relationships with inverses, both sides MUST be migrated to the new
320
- * behavior at the same time.
321
- *
322
- * ```js
323
- * class Person extends Model {
324
- * @hasMany('person', {
325
- * async: false,
326
- * inverse: null,
327
- * resetOnRemoteUpdate: false
328
- * }) children;
329
- *
330
- * @belongsTo('person', {
331
- * async: false,
332
- * inverse: null,
333
- * resetOnRemoteUpdate: false
334
- * }) parent;
335
- * }
336
- * ```
337
- *
338
- * > Note: false is the only valid value here, all other values (including missing)
339
- * > will be treated as true, where `true` is the legacy behavior that is now deprecated.
340
- *
341
- * Once you have migrated all relationships, you can remove the the resetOnRemoteUpdate
342
- * option and set the deprecation flag to false in ember-cli-build.
343
- *
344
- * ### What if I don't want the new behavior?
345
- *
346
- * EmberData's philosophy is to not make assumptions about your application. Where possible
347
- * we seek out "100%" solutions – solutions that work for all use cases - and where that is
348
- * not possible we default to "90%" solutions – solutions that work for the vast majority of use
349
- * cases. In the case of "90%" solutions we look for primitives that allow you to resolve the
350
- * 10% case in your application. If no such primitives exist, we provide an escape hatch that
351
- * ensures you can build the behavior you need without adopting the cost of the default solution.
352
- *
353
- * In this case, the old behavior was a "40%" solution. The inability for an application developer
354
- * to determine what changes were made locally, and thus what changes should be preserved, made
355
- * it impossible to build certain features easily, or in some cases at all. The proliferation of
356
- * feature requests, bug reports (from folks surprised by the prior behavior) and addon attempts
357
- * in this space are all evidence of this.
358
- *
359
- * We believe the new behavior is a "90%" solution. It works for the vast majority of use cases,
360
- * often without noticeable changes to existing application behavior, and provides primitives that
361
- * allow you to build the behavior you need for the remaining 10%.
362
- *
363
- * The great news is that this behavior defaults to trusting your API similar to the old behavior.
364
- * If your API is correct, you will not need to make any changes to your application to adopt
365
- * the new behavior.
366
- *
367
- * This means the 10% cases are those where you can't trust your API to provide the correct
368
- * information. In these cases, because you now have cheap access to a diff of the relationship
369
- * state, there are a few options that weren't available before:
370
- *
371
- * - you can adjust returned API payloads to contain the expected changes that it doesn't include
372
- * - you can modify local state by adding or removing records on the HasMany record array to remove
373
- * any local changes that were not returned by the API.
374
- * - you can use `<Cache>.mutate(mutation)` to directly modify the local cache state of the relationship
375
- * to match the expected state.
376
- *
377
- * What this version (5.3) does not yet provide is a way to directly modify the cache's remote state
378
- * for the relationship via public APIs other than via the broader action of upserting a response via
379
- * `<Cache>.put(document)`. However, such an API was sketched in the Cache 2.1 RFC
380
- * `<Cache>.patch(operation)` and is likely to be added in a future 5.x release of EmberData.
381
- *
382
- * This version (5.3) also does not yet provide a way to directly modify the graph (a general purpose
383
- * subset of cache behaviors specific to relationships) via public APIs. However, during the
384
- * 5.x release series we will be working on finalizing the Graph API and making it public.
385
- *
386
- * If none of these options work for you, you can always opt-out more broadly by implementing
387
- * a custom Cache with the relationship behaviors you need.
388
- *
389
- * @property DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE
390
- * @type {Boolean}
391
- * @since 5.3
392
- * @until 6.0
393
- * @public
394
- */
395
58
  const DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE = '5.3';
396
-
397
- /**
398
- * **id: ember-data:deprecate-many-array-duplicates**
399
- *
400
- * When the flag is `true` (default), adding duplicate records to a `ManyArray`
401
- * is deprecated in non-production environments. In production environments,
402
- * duplicate records added to a `ManyArray` will be deduped and no error will
403
- * be thrown.
404
- *
405
- * When the flag is `false`, an error will be thrown when duplicates are added.
406
- *
407
- * @property DEPRECATE_MANY_ARRAY_DUPLICATES
408
- * @type {Boolean}
409
- * @since 5.3
410
- * @until 6.0
411
- * @public
412
- */
413
59
  const DEPRECATE_MANY_ARRAY_DUPLICATES = '5.3';
414
-
415
- /**
416
- * **id: ember-data:deprecate-store-extends-ember-object**
417
- *
418
- * When the flag is `true` (default), the Store class will extend from `@ember/object`.
419
- * When the flag is `false` or `ember-source` is not present, the Store will not extend
420
- * from EmberObject.
421
- *
422
- * @property DEPRECATE_STORE_EXTENDS_EMBER_OBJECT
423
- * @type {Boolean}
424
- * @since 5.4
425
- * @until 6.0
426
- * @public
427
- */
428
60
  const DEPRECATE_STORE_EXTENDS_EMBER_OBJECT = '5.4';
429
-
430
- /**
431
- * **id: ember-data:schema-service-updates**
432
- *
433
- * When the flag is `true` (default), the legacy schema
434
- * service features will be enabled on the store and
435
- * the service, and deprecations will be thrown when
436
- * they are used.
437
- *
438
- * Deprecated features include:
439
- *
440
- * - `Store.registerSchema` method is deprecated in favor of the `Store.createSchemaService` hook
441
- * - `Store.registerSchemaDefinitionService` method is deprecated in favor of the `Store.createSchemaService` hook
442
- * - `Store.getSchemaDefinitionService` method is deprecated in favor of `Store.schema` property
443
- * - `SchemaService.doesTypeExist` method is deprecated in favor of the `SchemaService.hasResource` method
444
- * - `SchemaService.attributesDefinitionFor` method is deprecated in favor of the `SchemaService.fields` method
445
- * - `SchemaService.relationshipsDefinitionFor` method is deprecated in favor of the `SchemaService.fields` method
446
- *
447
- * @property ENABLE_LEGACY_SCHEMA_SERVICE
448
- * @type {Boolean}
449
- * @since 5.4
450
- * @until 6.0
451
- * @public
452
- */
453
61
  const ENABLE_LEGACY_SCHEMA_SERVICE = '5.4';
454
-
455
- /**
456
- * **id: warp-drive.ember-inflector**
457
- *
458
- * Deprecates the use of ember-inflector for pluralization and singularization in favor
459
- * of the `@ember-data-mirror/request-utils` package.
460
- *
461
- * Rule configuration methods (singular, plural, uncountable, irregular) and
462
- * usage methods (singularize, pluralize) are are available as imports from
463
- * `@ember-data-mirror/request-utils/string`
464
- *
465
- * Notable differences with ember-inflector:
466
- * - there cannot be multiple inflector instances with separate rules
467
- * - pluralization does not support a count argument
468
- * - string caches now default to 10k entries instead of 1k, and this
469
- * size is now configurable. Additionally, the cache is now a LRU cache
470
- * instead of a first-N cache.
471
- *
472
- * This deprecation can be resolved by removing usage of ember-inflector or by using
473
- * both ember-inflector and @ember-data-mirror/request-utils in parallel and updating your
474
- * EmberData/WarpDrive build config to mark the deprecation as resolved
475
- * in ember-cli-build
476
- *
477
- * ```js
478
- * setConfig(app, __dirname, { deprecations: { DEPRECATE_EMBER_INFLECTOR: false }});
479
- * ```
480
- *
481
- * @property DEPRECATE_EMBER_INFLECTOR
482
- * @type {Boolean}
483
- * @since 5.3
484
- * @until 6.0
485
- * @public
486
- */
487
62
  const DEPRECATE_EMBER_INFLECTOR = '5.3';
488
-
489
- /**
490
- * This is a special flag that can be used to opt-in early to receiving deprecations introduced in 6.x
491
- * which have had their infra backported to 5.x versions of EmberData.
492
- *
493
- * When this flag is not present or set to `true`, the deprecations from the 6.x branch
494
- * will not print their messages and the deprecation cannot be resolved.
495
- *
496
- * When this flag is present and set to `false`, the deprecations from the 6.x branch will
497
- * print and can be resolved.
498
- *
499
- * @property DISABLE_7X_DEPRECATIONS
500
- * @type {Boolean}
501
- * @since 5.3
502
- * @until 7.0
503
- * @public
504
- */
505
63
  const DISABLE_7X_DEPRECATIONS = '7.0';
506
-
507
- /**
508
- * **id: warp-drive:deprecate-tracking-package**
509
- *
510
- * Deprecates the use of the @ember-data-mirror/tracking package which
511
- * historically provided bindings into Ember's reactivity system.
512
- *
513
- * This package is no longer needed as the configuration is now
514
- * provided by the @warp-drive-mirror/ember package.
515
- *
516
- * This deprecation can be resolved by removing the
517
- * @ember-data-mirror/tracking package from your project and ensuring
518
- * that your app.js file has the following import:
519
- *
520
- * ```js
521
- * import '@warp-drive-mirror/ember/install';
522
- * ```
523
- *
524
- * Once this import is present, you can remove the deprecation
525
- * by setting the deprecation to `false` in your build config:
526
- *
527
- * ```js
528
- * // inside of ember-cli-build.js
529
- *
530
- * const { setConfig } = await import('@warp-drive-mirror/build-config');
531
- *
532
- * setConfig(app, __dirname, {
533
- * deprecations: {
534
- * DEPRECATE_TRACKING_PACKAGE: false
535
- * }
536
- * });
537
- * ```
538
- *
539
- * @property DEPRECATE_TRACKING_PACKAGE
540
- * @type {Boolean}
541
- * @since 5.5
542
- * @until 6.0
543
- * @public
544
- */
545
64
  const DEPRECATE_TRACKING_PACKAGE = '5.5';
546
65
 
547
66
  const CURRENT_DEPRECATIONS = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
@@ -605,71 +124,120 @@ function getDeprecations(compatVersion, deprecations) {
605
124
 
606
125
  /**
607
126
  *
608
- * @module @warp-drive-mirror/build-config
609
- */
610
-
611
- /**
612
- *
613
- * ## Canary Features
127
+ * # Canary Features <Badge type="warning" text="requires canary" />
614
128
  *
615
- * EmberData allows users to test features that are implemented but not yet
616
- * available even in canary.
129
+ * ***Warp*Drive** allows users to test upcoming features that are implemented
130
+ * but not yet activated in canary builds.
617
131
  *
618
- * Typically these features represent work that might introduce a new concept,
619
- * new API, change an API, or risk an unintended change in behavior to consuming
620
- * applications.
132
+ * Typically these features represent work that carries higher risk of breaking
133
+ * changes, or are not yet fully ready for production use.
621
134
  *
622
135
  * Such features have their implementations guarded by a "feature flag", and the
623
136
  * flag is only activated once the core-data team is prepared to ship the work
624
- * in a canary release.
137
+ * in a canary release, beginning the process of it landing in a stable release.
625
138
  *
626
139
  * ### Installing Canary
627
140
  *
628
- * To test a feature you MUST be using a canary build. Canary builds are published
629
- * to `npm` and can be installed using a precise tag (such as `ember-data@3.16.0-alpha.1`)
630
- * or by installing the latest dist-tag published to the `canary` channel using your javascript
631
- * package manager of choice. For instance with [pnpm](https://pnpm.io/)
632
-
633
- ```cli
634
- pnpm add ember-data@canary
635
- ```
141
+ * ::: warning To test a feature guarded behind a flag, you MUST be using a canary build.
142
+ * :::
636
143
  *
637
- * ### Activating a Canary Feature
144
+ * Canary builds are published to `npm` and can be installed using a precise tag
145
+ * (such as `@warp-drive/core@5.6.0-alpha.1`) or by installing the latest dist-tag
146
+ * published to the `canary` channel.
638
147
  *
639
- * Once you have installed canary, feature-flags can be activated at build-time
148
+ * Because ***Warp*Drive** packages operate on a strict lockstep policy with each other,
149
+ * you must install the matching canary version of all ***Warp*Drive** packages.
640
150
  *
641
- * by setting an environment variable:
151
+ * Below is an example of installing the latest canary version of all the primary
152
+ * packages that are part of the ***Warp*Drive** project. Add/remove packages from
153
+ * this list to match your project.
642
154
  *
643
- * ```cli
644
- * # Activate a single flag
645
- * WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG ember build
155
+ * ::: code-group
646
156
  *
647
- * # Activate multiple flags by separating with commas
648
- * WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build
157
+ * ```sh [pnpm]
158
+ * pnpm add -E @ember-data-mirror/store@canary \
159
+ * @ember-data-mirror/json-api@canary \
160
+ * @ember-data-mirror/debug@canary \
161
+ * @ember-data-mirror/graph@canary \
162
+ * @ember-data-mirror/request@canary \
163
+ * @ember-data-mirror/request-utils@canary \
164
+ * @warp-drive-mirror/schema-record@canary \
165
+ * @warp-drive-mirror/build-config@canary \
166
+ * @warp-drive-mirror/core-types@canary;
167
+ * ```
649
168
  *
650
- * # Activate all flags
651
- * WARP_DRIVE_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build
169
+ * ```sh [npm]
170
+ * npm add -E @ember-data-mirror/store@canary \
171
+ * @ember-data-mirror/json-api@canary \
172
+ * @ember-data-mirror/debug@canary \
173
+ * @ember-data-mirror/graph@canary \
174
+ * @ember-data-mirror/request@canary \
175
+ * @ember-data-mirror/request-utils@canary \
176
+ * @warp-drive-mirror/schema-record@canary \
177
+ * @warp-drive-mirror/build-config@canary \
178
+ * @warp-drive-mirror/core-types@canary;
652
179
  * ```
653
180
  *
654
- * or by setting the appropriate flag in your `ember-cli-build` file:
181
+ * ```sh [yarn]
182
+ * yarn add -E @ember-data-mirror/store@canary \
183
+ * @ember-data-mirror/json-api@canary \
184
+ * @ember-data-mirror/debug@canary \
185
+ * @ember-data-mirror/graph@canary \
186
+ * @ember-data-mirror/request@canary \
187
+ * @ember-data-mirror/request-utils@canary \
188
+ * @warp-drive-mirror/schema-record@canary \
189
+ * @warp-drive-mirror/build-config@canary \
190
+ * @warp-drive-mirror/core-types@canary;
191
+ * ```
192
+ *
193
+ * ```sh [bun]
194
+ * bun add --exact @ember-data-mirror/store@canary \
195
+ * @ember-data-mirror/json-api@canary \
196
+ * @ember-data-mirror/debug@canary \
197
+ * @ember-data-mirror/graph@canary \
198
+ * @ember-data-mirror/request@canary \
199
+ * @ember-data-mirror/request-utils@canary \
200
+ * @warp-drive-mirror/schema-record@canary \
201
+ * @warp-drive-mirror/build-config@canary \
202
+ * @warp-drive-mirror/core-types@canary;
203
+ * ```
204
+ *
205
+ * :::
206
+ *
207
+ * ### Activating a Feature
208
+ *
209
+ * Once you have installed canary, feature-flags can be activated at build-time
655
210
  *
656
211
  * ```ts
657
212
  * setConfig(app, __dirname, {
658
213
  * features: {
659
- * SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature
660
- * OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior
214
+ * FEATURE_A: false, // utilize existing behavior
215
+ * FEATURE_B: true // utilize the new behavior
661
216
  * }
662
217
  * })
663
218
  * ```
664
219
  *
665
- * **The "off" branch of feature-flagged code is always stripped from production builds.**
220
+ * by setting an environment variable:
666
221
  *
667
- * The list of available feature-flags is located [here](https://github.com/emberjs/data/tree/main/packages/build-config/src/virtual/canary-features.ts "List of EmberData FeatureFlags")
222
+ * ```sh
223
+ * # Activate a single flag
224
+ * export WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG;
225
+ *
226
+ * # Activate multiple flags by separating with commas
227
+ * export WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG;
228
+ *
229
+ * # Activate all flags
230
+ * export WARP_DRIVE_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL;
231
+ * ```
232
+ *
233
+ * ::: warning To test a feature guarded behind a flag, you MUST be running a development build.
234
+ * :::
668
235
  *
669
236
  *
670
237
  * ### Preparing a Project to use a Canary Feature
671
238
  *
672
- * For most projects, simple version detection should be enough.
239
+ * For most projects and features, simple version detection should be enough.
240
+ *
673
241
  * Using the provided version compatibility helpers from [embroider-macros](https://github.com/embroider-build/embroider/tree/main/packages/macros#readme)
674
242
  * the following can be done:
675
243
  *
@@ -679,8 +247,12 @@ function getDeprecations(compatVersion, deprecations) {
679
247
  * }
680
248
  * ```
681
249
  *
250
+ * For more complex projects and migrations, configure [@warp-drive-mirror/build-config/babel-macros](./babel-macros)
251
+ *
682
252
  * The current list of features used at build time for canary releases is defined below.
683
- * If empty there are no features currently gated by feature flags.
253
+ *
254
+ * ::: tip 💡 If empty there are no features currently gated by feature flags.
255
+ * :::
684
256
  *
685
257
  * The valid values are:
686
258
  *
@@ -688,9 +260,15 @@ function getDeprecations(compatVersion, deprecations) {
688
260
  * - `false` | The feature is **disabled** at all times, and cannot be enabled.
689
261
  * - `null` | The feature is **disabled by default**, but can be enabled via configuration.
690
262
  *
691
- * @class CanaryFeatures
263
+ * @module
692
264
  * @public
693
- */
265
+ */
266
+
267
+ /**
268
+ * We use this for some tests etc.
269
+ *
270
+ * @internal
271
+ */
694
272
  const SAMPLE_FEATURE_FLAG = null;
695
273
 
696
274
  /**
@@ -701,8 +279,6 @@ const SAMPLE_FEATURE_FLAG = null;
701
279
  * `cache.put`, the cache will validate the payload against registered
702
280
  * schemas as well as the JSON:API spec.
703
281
  *
704
- * @property JSON_API_CACHE_VALIDATION_ERRORS
705
- * @type {Boolean|null}
706
282
  * @since 5.4
707
283
  * @public
708
284
  */
@@ -770,10 +346,7 @@ function getFeatures(isProd) {
770
346
  }
771
347
 
772
348
  /**
773
- @module @warp-drive-mirror/build-config
774
- */
775
- /**
776
- * ## Debug Logging
349
+ * # Log Instrumentation <Badge type="tip" text="debug only" />
777
350
  *
778
351
  * Many portions of the internals are helpfully instrumented with logging.
779
352
  * This instrumentation is always removed from production builds.
@@ -785,19 +358,11 @@ function getFeatures(isProd) {
785
358
  * either in your build config or via the runtime helper.
786
359
  *
787
360
  *
788
- * ### Activation Via Runtime Helper
361
+ * ## Runtime Activation
789
362
  *
790
- * A runtime helper is attached to `globalThis` to enable activation of the logs
791
- * from anywhere in your application including from the devtools panel.
792
- *
793
- * The runtime helper overrides any build config settings for the given flag
794
- * for the current browser tab. It stores the configuration you give it in
795
- * `sessionStorage` so that it persists across page reloads of the current tab,
796
- * but not across browser tabs or windows. Thus if you need to deactivate the
797
- * logging, you can call the helper again with the same flag set to `false` or
798
- * just open a new tab/window.
799
- *
800
- * Example Usage:
363
+ * ::: tip 💡 Just Works in browser Dev Tools!
364
+ * No import is needed, and the logging config is preserved when the page is refreshed
365
+ * :::
801
366
  *
802
367
  * ```ts
803
368
  * setWarpDriveLogging({
@@ -806,26 +371,34 @@ function getFeatures(isProd) {
806
371
  * })
807
372
  * ```
808
373
  *
809
- * ### Activation Via Build Config
374
+ * A runtime helper is attached to `globalThis` to enable activation of the logs
375
+ * from anywhere in your application including from the devtools panel.
376
+ *
377
+ * The runtime helper overrides any build config settings for the given flag
378
+ * for the current browser tab. It stores the configuration you give it in
379
+ * `sessionStorage` so that it persists across page reloads of the current tab,
380
+ * but not across browser tabs or windows.
381
+ *
382
+ * If you need to deactivate the logging, you can call the helper again with the
383
+ * same flag set to `false` or just open a new tab/window.
384
+ *
385
+ * ## Buildtime Activation
810
386
  *
811
387
  * ```ts
812
388
  * setConfig(__dirname, app, {
813
389
  * debug: {
814
- * LOG_CACHE: false, // data store received to update cache with
815
- * LOG_NOTIFICATIONS: false,
390
+ * LOG_CACHE: true,
816
391
  * LOG_REQUESTS: false,
817
- * LOG_REQUEST_STATUS: false,
818
- * LOG_IDENTIFIERS: false,
819
- * LOG_GRAPH: false,
820
- * LOG_INSTANCE_CACHE: false,
821
- * LOG_METRIC_COUNTS: false,
822
- * DEBUG_RELATIONSHIP_NOTIFICATIONS: false,
392
+ * LOG_NOTIFICATIONS: true,
823
393
  * }
824
394
  * });
825
395
  * ```
826
396
  *
827
- * @class DebugLogging
828
- * @public
397
+ * The build config settings are used to set the default values for the
398
+ * logging flags. Any logging flag that is not set in the build config
399
+ * will default to `false`.
400
+ *
401
+ * @module
829
402
  */
830
403
  /**
831
404
  * log cache updates for both local
@@ -836,16 +409,50 @@ function getFeatures(isProd) {
836
409
  *
837
410
  * The others were `LOG_OPERATIONS` and `LOG_MUTATIONS`.
838
411
  *
839
- * @property LOG_CACHE
840
- * @type {Boolean}
841
412
  * @public
413
+ * @since 5.5
842
414
  */
843
415
  const LOG_CACHE = false;
416
+
417
+ /**
418
+ * <Badge type="danger" text="removed" />
419
+ *
420
+ * This flag no longer has any effect.
421
+ *
422
+ * Use {@link LOG_CACHE} instead.
423
+ *
424
+ * @deprecated removed in version 5.5
425
+ * @public
426
+ */
427
+ const LOG_PAYLOADS = false;
428
+
429
+ /**
430
+ * <Badge type="danger" text="removed" />
431
+ *
432
+ * This flag no longer has any effect.
433
+ *
434
+ * Use {@link LOG_CACHE} instead.
435
+ *
436
+ * @deprecated removed in version 5.5
437
+ * @public
438
+ */
439
+ const LOG_OPERATIONS = false;
440
+
441
+ /**
442
+ * <Badge type="danger" text="removed" />
443
+ *
444
+ * This flag no longer has any effect.
445
+ *
446
+ * Use {@link LOG_CACHE} instead.
447
+ *
448
+ * @deprecated removed in version 5.5
449
+ * @public
450
+ */
451
+ const LOG_MUTATIONS = false;
452
+
844
453
  /**
845
454
  * Log decisions made by the Basic CachePolicy
846
455
  *
847
- * @property LOG_CACHE_POLICY
848
- * @type {Boolean}
849
456
  * @public
850
457
  */
851
458
  const LOG_CACHE_POLICY = false;
@@ -853,16 +460,12 @@ const LOG_CACHE_POLICY = false;
853
460
  /**
854
461
  * log notifications received by the NotificationManager
855
462
  *
856
- * @property LOG_NOTIFICATIONS
857
- * @type {Boolean}
858
463
  * @public
859
464
  */
860
465
  const LOG_NOTIFICATIONS = false;
861
466
  /**
862
467
  * log requests issued by the RequestManager
863
468
  *
864
- * @property LOG_REQUESTS
865
- * @type {Boolean}
866
469
  * @public
867
470
  */
868
471
  const LOG_REQUESTS = false;
@@ -870,8 +473,6 @@ const LOG_REQUESTS = false;
870
473
  * log updates to requests the store has issued to
871
474
  * the network (adapter) to fulfill.
872
475
  *
873
- * @property LOG_REQUEST_STATUS
874
- * @type {Boolean}
875
476
  * @public
876
477
  */
877
478
  const LOG_REQUEST_STATUS = false;
@@ -879,8 +480,6 @@ const LOG_REQUEST_STATUS = false;
879
480
  * log peek, generation and updates to
880
481
  * Record Identifiers.
881
482
  *
882
- * @property LOG_IDENTIFIERS
883
- * @type {Boolean}
884
483
 
885
484
  * @public
886
485
  */
@@ -888,8 +487,6 @@ const LOG_IDENTIFIERS = false;
888
487
  /**
889
488
  * log updates received by the graph (relationship pointer storage)
890
489
  *
891
- * @property LOG_GRAPH
892
- * @type {Boolean}
893
490
  * @public
894
491
  */
895
492
  const LOG_GRAPH = false;
@@ -897,8 +494,6 @@ const LOG_GRAPH = false;
897
494
  * log creation/removal of RecordData and Record
898
495
  * instances.
899
496
  *
900
- * @property LOG_INSTANCE_CACHE
901
- * @type {Boolean}
902
497
  * @public
903
498
  */
904
499
  const LOG_INSTANCE_CACHE = false;
@@ -906,8 +501,6 @@ const LOG_INSTANCE_CACHE = false;
906
501
  * Log key count metrics, useful for performance
907
502
  * debugging.
908
503
  *
909
- * @property LOG_METRIC_COUNTS
910
- * @type {Boolean}
911
504
  * @public
912
505
  */
913
506
  const LOG_METRIC_COUNTS = false;
@@ -915,8 +508,6 @@ const LOG_METRIC_COUNTS = false;
915
508
  * Helps when debugging causes of a change notification
916
509
  * when processing an update to a hasMany relationship.
917
510
  *
918
- * @property DEBUG_RELATIONSHIP_NOTIFICATIONS
919
- * @type {Boolean}
920
511
  * @public
921
512
  */
922
513
  const DEBUG_RELATIONSHIP_NOTIFICATIONS = false;
@@ -929,7 +520,7 @@ const DEBUG_RELATIONSHIP_NOTIFICATIONS = false;
929
520
  *
930
521
  * LOG_METRIC_COUNTS must also be enabled.
931
522
  *
932
- * @typedoc
523
+ * @internal
933
524
  */
934
525
  const __INTERNAL_LOG_NATIVE_MAP_SET_COUNTS = false;
935
526
 
@@ -942,7 +533,10 @@ const LOGGING = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
942
533
  LOG_IDENTIFIERS,
943
534
  LOG_INSTANCE_CACHE,
944
535
  LOG_METRIC_COUNTS,
536
+ LOG_MUTATIONS,
945
537
  LOG_NOTIFICATIONS,
538
+ LOG_OPERATIONS,
539
+ LOG_PAYLOADS,
946
540
  LOG_REQUESTS,
947
541
  LOG_REQUEST_STATUS,
948
542
  __INTERNAL_LOG_NATIVE_MAP_SET_COUNTS
@@ -967,17 +561,17 @@ function createLoggingConfig(env, debug) {
967
561
  *
968
562
  * This configuration is done using `setConfig` in `ember-cli-build`.
969
563
  *
970
- * ```ts
564
+ * ```ts [ember-cli-build.js]
971
565
  * 'use strict';
972
566
  *
973
567
  * const EmberApp = require('ember-cli/lib/broccoli/ember-app');
974
568
  *
975
569
  * module.exports = async function (defaults) {
976
- * const { setConfig } = await import('@warp-drive-mirror/build-config');
570
+ * const { setConfig } = await import('@warp-drive-mirror/build-config'); // [!code focus]
977
571
  *
978
572
  * const app = new EmberApp(defaults, {});
979
573
  *
980
- * setConfig(app, __dirname, {
574
+ * setConfig(app, __dirname, { // [!code focus:3]
981
575
  * // settings here
982
576
  * });
983
577
  *
@@ -989,38 +583,16 @@ function createLoggingConfig(env, debug) {
989
583
  *
990
584
  * Available settings include:
991
585
  *
992
- * - [Debug Logging](../classes/DebugLogging)
993
- * - [Deprecated Code Removal](../classes/CurrentDeprecations)
994
- * - [Canary Feature Activation](../classes/CanaryFeatures)
995
- *
996
- * As well as:
997
- *
998
- * ### polyfillUUID
586
+ * - {@link LOGGING | debugging}
587
+ * - {@link DEPRECATIONS | deprecations}
588
+ * - {@link FEATURES | features}
589
+ * - {@link WarpDriveConfig.polyfillUUID | polyfillUUID}
590
+ * - {@link WarpDriveConfig.includeDataAdapterInProduction | includeDataAdapterInProduction}
591
+ * - {@link WarpDriveConfig.compatWith | compatWith}
999
592
  *
1000
- * If you are using the library in an environment that does not support `window.crypto.randomUUID`
1001
- * you can enable a polyfill for it.
1002
593
  *
1003
- * ```ts
1004
- * setConfig(app, __dirname, {
1005
- * polyfillUUID: true
1006
- * });
1007
- * ```
1008
- *
1009
- * ### includeDataAdapterInProduction
1010
- *
1011
- * By default, the integration required to support the ember inspector browser extension
1012
- * is included in production builds only when using the `ember-data` package. Otherwise
1013
- * the default is to exclude it. This setting allows to explicitly enable/disable it in
1014
- * production builds.
1015
- *
1016
- * ```ts
1017
- * setConfig(app, __dirname, {
1018
- * includeDataAdapterInProduction: true
1019
- * });
1020
- * ```
1021
594
  *
1022
- * @module @warp-drive-mirror/build-config
1023
- * @main @warp-drive-mirror/build-config
595
+ * @module
1024
596
  */
1025
597
  const _MacrosConfig = EmbroiderMacros.MacrosConfig;
1026
598
  function recastMacrosConfig(macros) {