@warp-drive/build-config 5.6.0-alpha.1 → 5.6.0-alpha.11

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 (83) hide show
  1. package/declarations/-private/utils/deprecations.d.ts +10 -0
  2. package/declarations/-private/utils/features.d.ts +7 -0
  3. package/declarations/-private/utils/get-env.d.ts +9 -0
  4. package/declarations/-private/utils/logging.d.ts +12 -0
  5. package/declarations/babel-macros.d.ts +14 -0
  6. package/declarations/babel-macros.d.ts.map +1 -0
  7. package/declarations/canary-features.d.ts +137 -0
  8. package/declarations/canary-features.d.ts.map +1 -0
  9. package/declarations/cjs-set-config.d.ts +2 -0
  10. package/declarations/debugging.d.ts +173 -0
  11. package/declarations/debugging.d.ts.map +1 -0
  12. package/declarations/deprecation-versions.d.ts +14 -0
  13. package/declarations/deprecation-versions.d.ts.map +1 -0
  14. package/declarations/deprecations.d.ts +517 -0
  15. package/declarations/deprecations.d.ts.map +1 -0
  16. package/declarations/env.d.ts +130 -0
  17. package/declarations/env.d.ts.map +1 -0
  18. package/declarations/index.d.ts +98 -0
  19. package/declarations/index.d.ts.map +1 -0
  20. package/declarations/macros.d.ts +19 -0
  21. package/declarations/macros.d.ts.map +1 -0
  22. package/declarations/validate-exports.type-test.d.ts +2 -0
  23. package/dist/babel-macros.js +45 -12
  24. package/dist/babel-macros.js.map +1 -1
  25. package/dist/babel-plugin-transform-asserts.cjs +2 -2
  26. package/dist/babel-plugin-transform-asserts.cjs.map +1 -1
  27. package/dist/babel-plugin-transform-deprecations.cjs +2 -2
  28. package/dist/babel-plugin-transform-deprecations.cjs.map +1 -1
  29. package/dist/babel-plugin-transform-features.cjs +2 -2
  30. package/dist/babel-plugin-transform-features.cjs.map +1 -1
  31. package/dist/babel-plugin-transform-logging.cjs +2 -2
  32. package/dist/babel-plugin-transform-logging.cjs.map +1 -1
  33. package/dist/canary-features-CuKgaVtX.js +147 -0
  34. package/dist/canary-features-CuKgaVtX.js.map +1 -0
  35. package/dist/canary-features.js +1 -1
  36. package/dist/cjs-set-config.cjs +152 -603
  37. package/dist/cjs-set-config.cjs.map +1 -1
  38. package/dist/{debugging-BtpYr1v0.js → debugging-VdsvkNjX.js} +80 -62
  39. package/dist/debugging-VdsvkNjX.js.map +1 -0
  40. package/dist/debugging.js +1 -1
  41. package/dist/deprecations-BNNGFAiG.js +549 -0
  42. package/dist/deprecations-BNNGFAiG.js.map +1 -0
  43. package/dist/deprecations.js +1 -1
  44. package/dist/env.js +124 -0
  45. package/dist/env.js.map +1 -1
  46. package/dist/index.js +12 -515
  47. package/dist/index.js.map +1 -1
  48. package/dist/macros.js +18 -0
  49. package/dist/macros.js.map +1 -1
  50. package/package.json +6 -18
  51. package/dist/canary-features-D1wplYmb.js +0 -113
  52. package/dist/canary-features-D1wplYmb.js.map +0 -1
  53. package/dist/debugging-BtpYr1v0.js.map +0 -1
  54. package/dist/deprecations-D_dBAPC9.js +0 -34
  55. package/dist/deprecations-D_dBAPC9.js.map +0 -1
  56. package/unstable-preview-types/-private/utils/deprecations.d.ts +0 -12
  57. package/unstable-preview-types/-private/utils/features.d.ts +0 -9
  58. package/unstable-preview-types/-private/utils/get-env.d.ts +0 -11
  59. package/unstable-preview-types/-private/utils/logging.d.ts +0 -14
  60. package/unstable-preview-types/babel-macros.d.ts +0 -6
  61. package/unstable-preview-types/babel-macros.d.ts.map +0 -1
  62. package/unstable-preview-types/canary-features.d.ts +0 -105
  63. package/unstable-preview-types/canary-features.d.ts.map +0 -1
  64. package/unstable-preview-types/cjs-set-config.d.ts +0 -4
  65. package/unstable-preview-types/debugging.d.ts +0 -164
  66. package/unstable-preview-types/debugging.d.ts.map +0 -1
  67. package/unstable-preview-types/deprecation-versions.d.ts +0 -485
  68. package/unstable-preview-types/deprecation-versions.d.ts.map +0 -1
  69. package/unstable-preview-types/deprecations.d.ts +0 -16
  70. package/unstable-preview-types/deprecations.d.ts.map +0 -1
  71. package/unstable-preview-types/env.d.ts +0 -9
  72. package/unstable-preview-types/env.d.ts.map +0 -1
  73. package/unstable-preview-types/index.d.ts +0 -49
  74. package/unstable-preview-types/index.d.ts.map +0 -1
  75. package/unstable-preview-types/macros.d.ts +0 -5
  76. package/unstable-preview-types/macros.d.ts.map +0 -1
  77. package/unstable-preview-types/validate-exports.type-test.d.ts +0 -4
  78. /package/{unstable-preview-types → declarations}/-private/utils/deprecations.d.ts.map +0 -0
  79. /package/{unstable-preview-types → declarations}/-private/utils/features.d.ts.map +0 -0
  80. /package/{unstable-preview-types → declarations}/-private/utils/get-env.d.ts.map +0 -0
  81. /package/{unstable-preview-types → declarations}/-private/utils/logging.d.ts.map +0 -0
  82. /package/{unstable-preview-types → declarations}/cjs-set-config.d.ts.map +0 -0
  83. /package/{unstable-preview-types → declarations}/validate-exports.type-test.d.ts.map +0 -0
@@ -32,9 +32,6 @@ function getEnv() {
32
32
  };
33
33
  }
34
34
 
35
- /**
36
- * @module @warp-drive/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/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/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/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/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/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/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/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/ember package.
515
- *
516
- * This deprecation can be resolved by removing the
517
- * @ember-data/tracking package from your project and ensuring
518
- * that your app.js file has the following import:
519
- *
520
- * ```js
521
- * import '@warp-drive/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/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,82 +124,112 @@ function getDeprecations(compatVersion, deprecations) {
605
124
 
606
125
  /**
607
126
  *
608
- * @module @warp-drive/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 core
152
+ * packages that are part of the ***Warp*Drive** project when using EmberJS.
642
153
  *
643
- * ```cli
644
- * # Activate a single flag
645
- * WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG ember build
154
+ * Add/remove packages from this list to match your project.
646
155
  *
647
- * # Activate multiple flags by separating with commas
648
- * WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build
156
+ * ::: code-group
649
157
  *
650
- * # Activate all flags
651
- * WARP_DRIVE_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build
158
+ * ```sh [pnpm]
159
+ * pnpm add -E @warp-drive/core@canary \
160
+ * @warp-drive/json-api@canary \
161
+ * @warp-drive/ember@canary;
162
+ * ```
163
+ *
164
+ * ```sh [npm]
165
+ * npm add -E @warp-drive/core@canary \
166
+ * @warp-drive/json-api@canary \
167
+ * @warp-drive/ember@canary;
652
168
  * ```
653
169
  *
654
- * or by setting the appropriate flag in your `ember-cli-build` file:
170
+ * ```sh [yarn]
171
+ * yarn add -E @warp-drive/core@canary \
172
+ * @warp-drive/json-api@canary \
173
+ * @warp-drive/ember@canary;
174
+ * ```
175
+ *
176
+ * ```sh [bun]
177
+ * bun add --exact @warp-drive/core@canary \
178
+ * @warp-drive/json-api@canary \
179
+ * @warp-drive/ember@canary;
180
+ * ```
181
+ *
182
+ * :::
183
+ *
184
+ * ### Activating a Feature
185
+ *
186
+ * Once you have installed canary, feature-flags can be activated at build-time
655
187
  *
656
188
  * ```ts
657
189
  * setConfig(app, __dirname, {
658
190
  * 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
191
+ * FEATURE_A: false, // utilize existing behavior
192
+ * FEATURE_B: true // utilize the new behavior
661
193
  * }
662
194
  * })
663
195
  * ```
664
196
  *
665
- * **The "off" branch of feature-flagged code is always stripped from production builds.**
197
+ * by setting an environment variable:
666
198
  *
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")
199
+ * ```sh
200
+ * # Activate a single flag
201
+ * export WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG;
202
+ *
203
+ * # Activate multiple flags by separating with commas
204
+ * export WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG;
205
+ *
206
+ * # Activate all flags
207
+ * export WARP_DRIVE_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL;
208
+ * ```
209
+ *
210
+ * ::: warning To test a feature guarded behind a flag, you MUST be running a development build.
211
+ * :::
668
212
  *
669
213
  *
670
214
  * ### Preparing a Project to use a Canary Feature
671
215
  *
672
- * For most projects, simple version detection should be enough.
216
+ * For most projects and features, simple version detection should be enough.
217
+ *
673
218
  * Using the provided version compatibility helpers from [embroider-macros](https://github.com/embroider-build/embroider/tree/main/packages/macros#readme)
674
219
  * the following can be done:
675
220
  *
676
221
  * ```js
677
- * if (macroCondition(dependencySatisfies('@ember-data/store', '5.0'))) {
222
+ * if (macroCondition(dependencySatisfies('@warp-drive/core', '5.6'))) {
678
223
  * // do thing
679
224
  * }
680
225
  * ```
681
226
  *
227
+ * For more complex projects and migrations, configure [@warp-drive/build-config/babel-macros](./babel-macros)
228
+ *
682
229
  * 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.
230
+ *
231
+ * ::: tip 💡 If empty there are no features currently gated by feature flags.
232
+ * :::
684
233
  *
685
234
  * The valid values are:
686
235
  *
@@ -688,9 +237,15 @@ function getDeprecations(compatVersion, deprecations) {
688
237
  * - `false` | The feature is **disabled** at all times, and cannot be enabled.
689
238
  * - `null` | The feature is **disabled by default**, but can be enabled via configuration.
690
239
  *
691
- * @class CanaryFeatures
240
+ * @module
692
241
  * @public
693
- */
242
+ */
243
+
244
+ /**
245
+ * We use this for some tests etc.
246
+ *
247
+ * @internal
248
+ */
694
249
  const SAMPLE_FEATURE_FLAG = null;
695
250
 
696
251
  /**
@@ -701,8 +256,6 @@ const SAMPLE_FEATURE_FLAG = null;
701
256
  * `cache.put`, the cache will validate the payload against registered
702
257
  * schemas as well as the JSON:API spec.
703
258
  *
704
- * @property JSON_API_CACHE_VALIDATION_ERRORS
705
- * @type {Boolean|null}
706
259
  * @since 5.4
707
260
  * @public
708
261
  */
@@ -770,10 +323,7 @@ function getFeatures(isProd) {
770
323
  }
771
324
 
772
325
  /**
773
- @module @warp-drive/build-config
774
- */
775
- /**
776
- * ## Debug Logging
326
+ * # Log Instrumentation <Badge type="tip" text="debug only" />
777
327
  *
778
328
  * Many portions of the internals are helpfully instrumented with logging.
779
329
  * This instrumentation is always removed from production builds.
@@ -785,19 +335,11 @@ function getFeatures(isProd) {
785
335
  * either in your build config or via the runtime helper.
786
336
  *
787
337
  *
788
- * ### Activation Via Runtime Helper
789
- *
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.
338
+ * ## Runtime Activation
799
339
  *
800
- * Example Usage:
340
+ * ::: tip 💡 Just Works in browser Dev Tools!
341
+ * No import is needed, and the logging config is preserved when the page is refreshed
342
+ * :::
801
343
  *
802
344
  * ```ts
803
345
  * setWarpDriveLogging({
@@ -806,26 +348,34 @@ function getFeatures(isProd) {
806
348
  * })
807
349
  * ```
808
350
  *
809
- * ### Activation Via Build Config
351
+ * A runtime helper is attached to `globalThis` to enable activation of the logs
352
+ * from anywhere in your application including from the devtools panel.
353
+ *
354
+ * The runtime helper overrides any build config settings for the given flag
355
+ * for the current browser tab. It stores the configuration you give it in
356
+ * `sessionStorage` so that it persists across page reloads of the current tab,
357
+ * but not across browser tabs or windows.
358
+ *
359
+ * If you need to deactivate the logging, you can call the helper again with the
360
+ * same flag set to `false` or just open a new tab/window.
361
+ *
362
+ * ## Buildtime Activation
810
363
  *
811
364
  * ```ts
812
365
  * setConfig(__dirname, app, {
813
366
  * debug: {
814
- * LOG_CACHE: false, // data store received to update cache with
815
- * LOG_NOTIFICATIONS: false,
367
+ * LOG_CACHE: true,
816
368
  * 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,
369
+ * LOG_NOTIFICATIONS: true,
823
370
  * }
824
371
  * });
825
372
  * ```
826
373
  *
827
- * @class DebugLogging
828
- * @public
374
+ * The build config settings are used to set the default values for the
375
+ * logging flags. Any logging flag that is not set in the build config
376
+ * will default to `false`.
377
+ *
378
+ * @module
829
379
  */
830
380
  /**
831
381
  * log cache updates for both local
@@ -836,16 +386,50 @@ function getFeatures(isProd) {
836
386
  *
837
387
  * The others were `LOG_OPERATIONS` and `LOG_MUTATIONS`.
838
388
  *
839
- * @property LOG_CACHE
840
- * @type {Boolean}
841
389
  * @public
390
+ * @since 5.5
842
391
  */
843
392
  const LOG_CACHE = false;
393
+
394
+ /**
395
+ * <Badge type="danger" text="removed" />
396
+ *
397
+ * This flag no longer has any effect.
398
+ *
399
+ * Use {@link LOG_CACHE} instead.
400
+ *
401
+ * @deprecated removed in version 5.5
402
+ * @public
403
+ */
404
+ const LOG_PAYLOADS = false;
405
+
406
+ /**
407
+ * <Badge type="danger" text="removed" />
408
+ *
409
+ * This flag no longer has any effect.
410
+ *
411
+ * Use {@link LOG_CACHE} instead.
412
+ *
413
+ * @deprecated removed in version 5.5
414
+ * @public
415
+ */
416
+ const LOG_OPERATIONS = false;
417
+
418
+ /**
419
+ * <Badge type="danger" text="removed" />
420
+ *
421
+ * This flag no longer has any effect.
422
+ *
423
+ * Use {@link LOG_CACHE} instead.
424
+ *
425
+ * @deprecated removed in version 5.5
426
+ * @public
427
+ */
428
+ const LOG_MUTATIONS = false;
429
+
844
430
  /**
845
431
  * Log decisions made by the Basic CachePolicy
846
432
  *
847
- * @property LOG_CACHE_POLICY
848
- * @type {Boolean}
849
433
  * @public
850
434
  */
851
435
  const LOG_CACHE_POLICY = false;
@@ -853,16 +437,12 @@ const LOG_CACHE_POLICY = false;
853
437
  /**
854
438
  * log notifications received by the NotificationManager
855
439
  *
856
- * @property LOG_NOTIFICATIONS
857
- * @type {Boolean}
858
440
  * @public
859
441
  */
860
442
  const LOG_NOTIFICATIONS = false;
861
443
  /**
862
444
  * log requests issued by the RequestManager
863
445
  *
864
- * @property LOG_REQUESTS
865
- * @type {Boolean}
866
446
  * @public
867
447
  */
868
448
  const LOG_REQUESTS = false;
@@ -870,8 +450,6 @@ const LOG_REQUESTS = false;
870
450
  * log updates to requests the store has issued to
871
451
  * the network (adapter) to fulfill.
872
452
  *
873
- * @property LOG_REQUEST_STATUS
874
- * @type {Boolean}
875
453
  * @public
876
454
  */
877
455
  const LOG_REQUEST_STATUS = false;
@@ -879,8 +457,6 @@ const LOG_REQUEST_STATUS = false;
879
457
  * log peek, generation and updates to
880
458
  * Record Identifiers.
881
459
  *
882
- * @property LOG_IDENTIFIERS
883
- * @type {Boolean}
884
460
 
885
461
  * @public
886
462
  */
@@ -888,8 +464,6 @@ const LOG_IDENTIFIERS = false;
888
464
  /**
889
465
  * log updates received by the graph (relationship pointer storage)
890
466
  *
891
- * @property LOG_GRAPH
892
- * @type {Boolean}
893
467
  * @public
894
468
  */
895
469
  const LOG_GRAPH = false;
@@ -897,8 +471,6 @@ const LOG_GRAPH = false;
897
471
  * log creation/removal of RecordData and Record
898
472
  * instances.
899
473
  *
900
- * @property LOG_INSTANCE_CACHE
901
- * @type {Boolean}
902
474
  * @public
903
475
  */
904
476
  const LOG_INSTANCE_CACHE = false;
@@ -906,8 +478,6 @@ const LOG_INSTANCE_CACHE = false;
906
478
  * Log key count metrics, useful for performance
907
479
  * debugging.
908
480
  *
909
- * @property LOG_METRIC_COUNTS
910
- * @type {Boolean}
911
481
  * @public
912
482
  */
913
483
  const LOG_METRIC_COUNTS = false;
@@ -915,8 +485,6 @@ const LOG_METRIC_COUNTS = false;
915
485
  * Helps when debugging causes of a change notification
916
486
  * when processing an update to a hasMany relationship.
917
487
  *
918
- * @property DEBUG_RELATIONSHIP_NOTIFICATIONS
919
- * @type {Boolean}
920
488
  * @public
921
489
  */
922
490
  const DEBUG_RELATIONSHIP_NOTIFICATIONS = false;
@@ -929,7 +497,7 @@ const DEBUG_RELATIONSHIP_NOTIFICATIONS = false;
929
497
  *
930
498
  * LOG_METRIC_COUNTS must also be enabled.
931
499
  *
932
- * @typedoc
500
+ * @internal
933
501
  */
934
502
  const __INTERNAL_LOG_NATIVE_MAP_SET_COUNTS = false;
935
503
 
@@ -942,7 +510,10 @@ const LOGGING = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
942
510
  LOG_IDENTIFIERS,
943
511
  LOG_INSTANCE_CACHE,
944
512
  LOG_METRIC_COUNTS,
513
+ LOG_MUTATIONS,
945
514
  LOG_NOTIFICATIONS,
515
+ LOG_OPERATIONS,
516
+ LOG_PAYLOADS,
946
517
  LOG_REQUESTS,
947
518
  LOG_REQUEST_STATUS,
948
519
  __INTERNAL_LOG_NATIVE_MAP_SET_COUNTS
@@ -967,17 +538,17 @@ function createLoggingConfig(env, debug) {
967
538
  *
968
539
  * This configuration is done using `setConfig` in `ember-cli-build`.
969
540
  *
970
- * ```ts
541
+ * ```ts [ember-cli-build.js]
971
542
  * 'use strict';
972
543
  *
973
544
  * const EmberApp = require('ember-cli/lib/broccoli/ember-app');
974
545
  *
975
546
  * module.exports = async function (defaults) {
976
- * const { setConfig } = await import('@warp-drive/build-config');
547
+ * const { setConfig } = await import('@warp-drive/build-config'); // [!code focus]
977
548
  *
978
549
  * const app = new EmberApp(defaults, {});
979
550
  *
980
- * setConfig(app, __dirname, {
551
+ * setConfig(app, __dirname, { // [!code focus:3]
981
552
  * // settings here
982
553
  * });
983
554
  *
@@ -989,38 +560,16 @@ function createLoggingConfig(env, debug) {
989
560
  *
990
561
  * Available settings include:
991
562
  *
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
563
+ * - {@link LOGGING | debugging}
564
+ * - {@link DEPRECATIONS | deprecations}
565
+ * - {@link FEATURES | features}
566
+ * - {@link WarpDriveConfig.polyfillUUID | polyfillUUID}
567
+ * - {@link WarpDriveConfig.includeDataAdapterInProduction | includeDataAdapterInProduction}
568
+ * - {@link WarpDriveConfig.compatWith | compatWith}
999
569
  *
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
570
  *
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
571
  *
1022
- * @module @warp-drive/build-config
1023
- * @main @warp-drive/build-config
572
+ * @module
1024
573
  */
1025
574
  const _MacrosConfig = EmbroiderMacros.MacrosConfig;
1026
575
  function recastMacrosConfig(macros) {