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

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
@@ -1,9 +1,6 @@
1
1
  declare module '@warp-drive-mirror/build-config/debugging' {
2
2
  /**
3
- @module @warp-drive-mirror/build-config
4
- */
5
- /**
6
- * ## Debug Logging
3
+ * # Log Instrumentation <Badge type="tip" text="debug only" />
7
4
  *
8
5
  * Many portions of the internals are helpfully instrumented with logging.
9
6
  * This instrumentation is always removed from production builds.
@@ -15,19 +12,11 @@ declare module '@warp-drive-mirror/build-config/debugging' {
15
12
  * either in your build config or via the runtime helper.
16
13
  *
17
14
  *
18
- * ### Activation Via Runtime Helper
19
- *
20
- * A runtime helper is attached to `globalThis` to enable activation of the logs
21
- * from anywhere in your application including from the devtools panel.
22
- *
23
- * The runtime helper overrides any build config settings for the given flag
24
- * for the current browser tab. It stores the configuration you give it in
25
- * `sessionStorage` so that it persists across page reloads of the current tab,
26
- * but not across browser tabs or windows. Thus if you need to deactivate the
27
- * logging, you can call the helper again with the same flag set to `false` or
28
- * just open a new tab/window.
15
+ * ## Runtime Activation
29
16
  *
30
- * Example Usage:
17
+ * ::: tip 💡 Just Works in browser Dev Tools!
18
+ * No import is needed, and the logging config is preserved when the page is refreshed
19
+ * :::
31
20
  *
32
21
  * ```ts
33
22
  * setWarpDriveLogging({
@@ -36,26 +25,34 @@ declare module '@warp-drive-mirror/build-config/debugging' {
36
25
  * })
37
26
  * ```
38
27
  *
39
- * ### Activation Via Build Config
28
+ * A runtime helper is attached to `globalThis` to enable activation of the logs
29
+ * from anywhere in your application including from the devtools panel.
30
+ *
31
+ * The runtime helper overrides any build config settings for the given flag
32
+ * for the current browser tab. It stores the configuration you give it in
33
+ * `sessionStorage` so that it persists across page reloads of the current tab,
34
+ * but not across browser tabs or windows.
35
+ *
36
+ * If you need to deactivate the logging, you can call the helper again with the
37
+ * same flag set to `false` or just open a new tab/window.
38
+ *
39
+ * ## Buildtime Activation
40
40
  *
41
41
  * ```ts
42
42
  * setConfig(__dirname, app, {
43
43
  * debug: {
44
- * LOG_CACHE: false, // data store received to update cache with
45
- * LOG_NOTIFICATIONS: false,
44
+ * LOG_CACHE: true,
46
45
  * LOG_REQUESTS: false,
47
- * LOG_REQUEST_STATUS: false,
48
- * LOG_IDENTIFIERS: false,
49
- * LOG_GRAPH: false,
50
- * LOG_INSTANCE_CACHE: false,
51
- * LOG_METRIC_COUNTS: false,
52
- * DEBUG_RELATIONSHIP_NOTIFICATIONS: false,
46
+ * LOG_NOTIFICATIONS: true,
53
47
  * }
54
48
  * });
55
49
  * ```
56
50
  *
57
- * @class DebugLogging
58
- * @public
51
+ * The build config settings are used to set the default values for the
52
+ * logging flags. Any logging flag that is not set in the build config
53
+ * will default to `false`.
54
+ *
55
+ * @module
59
56
  */
60
57
  /**
61
58
  * log cache updates for both local
@@ -66,32 +63,58 @@ declare module '@warp-drive-mirror/build-config/debugging' {
66
63
  *
67
64
  * The others were `LOG_OPERATIONS` and `LOG_MUTATIONS`.
68
65
  *
69
- * @property LOG_CACHE
70
- * @type {Boolean}
71
66
  * @public
67
+ * @since 5.5
72
68
  */
73
69
  export const LOG_CACHE: boolean;
70
+ /**
71
+ * <Badge type="danger" text="removed" />
72
+ *
73
+ * This flag no longer has any effect.
74
+ *
75
+ * Use {@link LOG_CACHE} instead.
76
+ *
77
+ * @deprecated removed in version 5.5
78
+ * @public
79
+ */
80
+ export const LOG_PAYLOADS: boolean;
81
+ /**
82
+ * <Badge type="danger" text="removed" />
83
+ *
84
+ * This flag no longer has any effect.
85
+ *
86
+ * Use {@link LOG_CACHE} instead.
87
+ *
88
+ * @deprecated removed in version 5.5
89
+ * @public
90
+ */
91
+ export const LOG_OPERATIONS: boolean;
92
+ /**
93
+ * <Badge type="danger" text="removed" />
94
+ *
95
+ * This flag no longer has any effect.
96
+ *
97
+ * Use {@link LOG_CACHE} instead.
98
+ *
99
+ * @deprecated removed in version 5.5
100
+ * @public
101
+ */
102
+ export const LOG_MUTATIONS: boolean;
74
103
  /**
75
104
  * Log decisions made by the Basic CachePolicy
76
105
  *
77
- * @property LOG_CACHE_POLICY
78
- * @type {Boolean}
79
106
  * @public
80
107
  */
81
108
  export const LOG_CACHE_POLICY: boolean;
82
109
  /**
83
110
  * log notifications received by the NotificationManager
84
111
  *
85
- * @property LOG_NOTIFICATIONS
86
- * @type {Boolean}
87
112
  * @public
88
113
  */
89
114
  export const LOG_NOTIFICATIONS: boolean;
90
115
  /**
91
116
  * log requests issued by the RequestManager
92
117
  *
93
- * @property LOG_REQUESTS
94
- * @type {Boolean}
95
118
  * @public
96
119
  */
97
120
  export const LOG_REQUESTS: boolean;
@@ -99,8 +122,6 @@ declare module '@warp-drive-mirror/build-config/debugging' {
99
122
  * log updates to requests the store has issued to
100
123
  * the network (adapter) to fulfill.
101
124
  *
102
- * @property LOG_REQUEST_STATUS
103
- * @type {Boolean}
104
125
  * @public
105
126
  */
106
127
  export const LOG_REQUEST_STATUS: boolean;
@@ -108,8 +129,6 @@ declare module '@warp-drive-mirror/build-config/debugging' {
108
129
  * log peek, generation and updates to
109
130
  * Record Identifiers.
110
131
  *
111
- * @property LOG_IDENTIFIERS
112
- * @type {Boolean}
113
132
 
114
133
  * @public
115
134
  */
@@ -117,8 +136,6 @@ declare module '@warp-drive-mirror/build-config/debugging' {
117
136
  /**
118
137
  * log updates received by the graph (relationship pointer storage)
119
138
  *
120
- * @property LOG_GRAPH
121
- * @type {Boolean}
122
139
  * @public
123
140
  */
124
141
  export const LOG_GRAPH: boolean;
@@ -126,8 +143,6 @@ declare module '@warp-drive-mirror/build-config/debugging' {
126
143
  * log creation/removal of RecordData and Record
127
144
  * instances.
128
145
  *
129
- * @property LOG_INSTANCE_CACHE
130
- * @type {Boolean}
131
146
  * @public
132
147
  */
133
148
  export const LOG_INSTANCE_CACHE: boolean;
@@ -135,8 +150,6 @@ declare module '@warp-drive-mirror/build-config/debugging' {
135
150
  * Log key count metrics, useful for performance
136
151
  * debugging.
137
152
  *
138
- * @property LOG_METRIC_COUNTS
139
- * @type {Boolean}
140
153
  * @public
141
154
  */
142
155
  export const LOG_METRIC_COUNTS: boolean;
@@ -144,8 +157,6 @@ declare module '@warp-drive-mirror/build-config/debugging' {
144
157
  * Helps when debugging causes of a change notification
145
158
  * when processing an update to a hasMany relationship.
146
159
  *
147
- * @property DEBUG_RELATIONSHIP_NOTIFICATIONS
148
- * @type {Boolean}
149
160
  * @public
150
161
  */
151
162
  export const DEBUG_RELATIONSHIP_NOTIFICATIONS: boolean;
@@ -157,7 +168,7 @@ declare module '@warp-drive-mirror/build-config/debugging' {
157
168
  *
158
169
  * LOG_METRIC_COUNTS must also be enabled.
159
170
  *
160
- * @typedoc
171
+ * @internal
161
172
  */
162
173
  export const __INTERNAL_LOG_NATIVE_MAP_SET_COUNTS: boolean;
163
174
  }
@@ -1 +1 @@
1
- {"version":3,"file":"debugging.d.ts","sourceRoot":"","sources":["../src/debugging.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,EAAE,OAAe,CAAC;AACxC;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAAe,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAe,CAAC;AAChD;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,OAAe,CAAC;AAC3C;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAe,CAAC;AACjD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,OAAe,CAAC;AAC9C;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,EAAE,OAAe,CAAC;AACxC;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAe,CAAC;AACjD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAe,CAAC;AAChD;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC,EAAE,OAAe,CAAC;AAE/D;;;;;;;;;GASG;AACH,eAAO,MAAM,oCAAoC,EAAE,OAAe,CAAC"}
1
+ {"version":3,"file":"debugging.d.ts","sourceRoot":"","sources":["../src/debugging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,EAAE,OAAe,CAAC;AAExC;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,OAAe,CAAC;AAE3C;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,EAAE,OAAe,CAAC;AAE7C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,OAAe,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAAe,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAe,CAAC;AAChD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,OAAe,CAAC;AAC3C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAe,CAAC;AACjD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,OAAe,CAAC;AAC9C;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,OAAe,CAAC;AACxC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAe,CAAC;AACjD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAe,CAAC;AAChD;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,EAAE,OAAe,CAAC;AAE/D;;;;;;;;;GASG;AACH,eAAO,MAAM,oCAAoC,EAAE,OAAe,CAAC"}
@@ -1,485 +1,16 @@
1
1
  declare module '@warp-drive-mirror/build-config/deprecation-versions' {
2
- /**
3
- * @module @warp-drive-mirror/build-config
4
- */
5
- /**
6
- * ## Deprecation Management
7
- *
8
- * EmberData allows users to opt-in and remove code that exists to support deprecated
9
- * behaviors.
10
- *
11
- * If your app has resolved all deprecations present in a given version,
12
- * you may specify that version as your "compatibility" version to remove
13
- * the code that supported the deprecated behavior from your app.
14
- *
15
- * For instance, if a deprecation was introduced in 3.13, and the app specifies
16
- * 3.13 as its minimum version compatibility, any deprecations introduced before
17
- * or during 3.13 would be stripped away.
18
- *
19
- * An app can use a different version than what it specifies as it's compatibility
20
- * version. For instance, an App could be using `3.16` while specifying compatibility
21
- * with `3.12`. This would remove any deprecations that were present in or before `3.12`
22
- * but keep support for anything deprecated in or above `3.13`.
23
- *
24
- * You may also specify that specific deprecations are resolved. These approaches
25
- * may be used together.
26
- *
27
- * ```ts
28
- * setConfig(app, __dirname, {
29
- * // that all deprecations through "5.0" have been fully resolved
30
- * compatWith: '5.0',
31
- *
32
- * // mark individual deprecations as resolved by setting them to `false`
33
- * deprecations: {
34
- * // resolve individual deprecations here
35
- * },
36
- * });
37
- * ```
38
- *
39
- * > [!TIP]
40
- * > EmberData does not test against permutations of deprecations
41
- * > being stripped, our tests run against "all deprecated code included"
42
- * > and "all deprecated code removed". Unspecified behavior may sometimes occur
43
- * > when removing code for only some deprecations associated to a version number.
44
- *
45
- * @class CurrentDeprecations
46
- * @public
47
- */
48
2
  export const DEPRECATE_CATCH_ALL = "99.0";
49
- /**
50
- * **id: ember-data:deprecate-non-strict-types**
51
- *
52
- * Currently, EmberData expects that the `type` property associated with
53
- * a resource follows several conventions.
54
- *
55
- * - The `type` property must be a non-empty string
56
- * - The `type` property must be singular
57
- * - The `type` property must be dasherized
58
- *
59
- * We are deprecating support for types that do not match this pattern
60
- * in order to unlock future improvements in which we can support `type`
61
- * being any string of your choosing.
62
- *
63
- * The goal is that in the future, you will be able to use any string
64
- * so long as it matches what your configured cache, identifier generation,
65
- * and schemas expect.
66
- *
67
- * E.G. It will matter not that your string is in a specific format like
68
- * singular, dasherized, etc. so long as everywhere you refer to the type
69
- * you use the same string.
70
- *
71
- * If using @ember-data-mirror/model, there will always be a restriction that the
72
- * `type` must match the path on disk where the model is defined.
73
- *
74
- * e.g. `app/models/foo/bar-bem.js` must have a type of `foo/bar-bem`
75
- *
76
- * @property DEPRECATE_NON_STRICT_TYPES
77
- * @type {Boolean}
78
- * @since 5.3
79
- * @until 6.0
80
- * @public
81
- */
82
3
  export const DEPRECATE_NON_STRICT_TYPES = "5.3";
83
- /**
84
- * **id: ember-data:deprecate-non-strict-id**
85
- *
86
- * Currently, EmberData expects that the `id` property associated with
87
- * a resource is a string.
88
- *
89
- * However, for legacy support in many locations we would accept a number
90
- * which would then immediately be coerced into a string.
91
- *
92
- * We are deprecating this legacy support for numeric IDs.
93
- *
94
- * The goal is that in the future, you will be able to use any ID format
95
- * so long as everywhere you refer to the ID you use the same format.
96
- *
97
- * However, for identifiers we will always use string IDs and so any
98
- * custom identifier configuration should provide a string ID.
99
- *
100
- * @property DEPRECATE_NON_STRICT_ID
101
- * @type {Boolean}
102
- * @since 5.3
103
- * @until 6.0
104
- * @public
105
- */
106
4
  export const DEPRECATE_NON_STRICT_ID = "5.3";
107
- /**
108
- * **id: <none yet assigned>**
109
- *
110
- * This is a planned deprecation which will trigger when observer or computed
111
- * chains are used to watch for changes on any EmberData LiveArray, CollectionRecordArray,
112
- * ManyArray or PromiseManyArray.
113
- *
114
- * Support for these chains is currently guarded by the deprecation flag
115
- * listed here, enabling removal of the behavior if desired.
116
- *
117
- * The instrumentation was added in 5.0 but the version number
118
- * is set to 7.0 as we do not want to strip support without
119
- * adding a deprecation message.
120
- *
121
- * Once we've added the deprecation message, we will
122
- * update this version number to the proper version.
123
- *
124
- * @property DEPRECATE_COMPUTED_CHAINS
125
- * @type {Boolean}
126
- * @since 5.0
127
- * @until 8.0
128
- * @public
129
- */
130
5
  export const DEPRECATE_COMPUTED_CHAINS = "7.0";
131
- /**
132
- * **id: ember-data:deprecate-legacy-imports**
133
- *
134
- * Deprecates when importing from `ember-data/*` instead of `@ember-data/*`
135
- * in order to prepare for the eventual removal of the legacy `ember-data/*`
136
- *
137
- * All imports from `ember-data/*` should be updated to `@ember-data/*`
138
- * except for `ember-data/store`. When you are using `ember-data` (as opposed to
139
- * installing the indivudal packages) you should import from `ember-data/store`
140
- * instead of `@ember-data-mirror/store` in order to receive the appropriate configuration
141
- * of defaults.
142
- *
143
- * @property DEPRECATE_LEGACY_IMPORTS
144
- * @type {Boolean}
145
- * @since 5.3
146
- * @until 6.0
147
- * @public
148
- */
149
6
  export const DEPRECATE_LEGACY_IMPORTS = "5.3";
150
- /**
151
- * **id: ember-data:deprecate-non-unique-collection-payloads**
152
- *
153
- * Deprecates when the data for a hasMany relationship contains
154
- * duplicate identifiers.
155
- *
156
- * Previously, relationships would silently de-dupe the data
157
- * when received, but this behavior is being removed in favor
158
- * of erroring if the same related record is included multiple
159
- * times.
160
- *
161
- * For instance, in JSON:API the below relationship data would
162
- * be considered invalid:
163
- *
164
- * ```json
165
- * {
166
- * "data": {
167
- * "type": "article",
168
- * "id": "1",
169
- * "relationships": {
170
- * "comments": {
171
- * "data": [
172
- * { "type": "comment", "id": "1" },
173
- * { "type": "comment", "id": "2" },
174
- * { "type": "comment", "id": "1" } // duplicate
175
- * ]
176
- * }
177
- * }
178
- * }
179
- * ```
180
- *
181
- * To resolve this deprecation, either update your server to
182
- * not include duplicate data, or implement normalization logic
183
- * in either a request handler or serializer which removes
184
- * duplicate data from relationship payloads.
185
- *
186
- * @property DEPRECATE_NON_UNIQUE_PAYLOADS
187
- * @type {Boolean}
188
- * @since 5.3
189
- * @until 6.0
190
- * @public
191
- */
192
7
  export const DEPRECATE_NON_UNIQUE_PAYLOADS = "5.3";
193
- /**
194
- * **id: ember-data:deprecate-relationship-remote-update-clearing-local-state**
195
- *
196
- * Deprecates when a relationship is updated remotely and the local state
197
- * is cleared of all changes except for "new" records.
198
- *
199
- * Instead, any records not present in the new payload will be considered
200
- * "removed" while any records present in the new payload will be considered "added".
201
- *
202
- * This allows us to "commit" local additions and removals, preserving any additions
203
- * or removals that are not yet reflected in the remote state.
204
- *
205
- * For instance, given the following initial state:
206
- *
207
- * remote: A, B, C
208
- * local: add D, E
209
- * remove B, C
210
- * => A, D, E
211
- *
212
- *
213
- * If after an update, the remote state is now A, B, D, F then the new state will be
214
- *
215
- * remote: A, B, D, F
216
- * local: add E
217
- * remove B
218
- * => A, D, E, F
219
- *
220
- * Under the old behavior the updated local state would instead have been
221
- * => A, B, D, F
222
- *
223
- * Similarly, if a belongsTo remote State was A while its local state was B,
224
- * then under the old behavior if the remote state changed to C, the local state
225
- * would be updated to C. Under the new behavior, the local state would remain B.
226
- *
227
- * If the remote state was A while its local state was `null`, then under the old
228
- * behavior if the remote state changed to C, the local state would be updated to C.
229
- * Under the new behavior, the local state would remain `null`.
230
- *
231
- * Thus the new correct mental model is that the state of the relationship at any point
232
- * in time is whatever the most recent remote state is, plus any local additions or removals
233
- * you have made that have not yet been reflected by the remote state.
234
- *
235
- * > Note: The old behavior extended to modifying the inverse of a relationship. So if
236
- * > you had local state not reflected in the new remote state, inverses would be notified
237
- * > and their state reverted as well when "resetting" the relationship.
238
- * > Under the new behavior, since the local state is preserved the inverses will also
239
- * > not be reverted.
240
- *
241
- * ### Resolving this deprecation
242
- *
243
- * Resolving this deprecation can be done individually for each relationship
244
- * or globally for all relationships.
245
- *
246
- * To resolve it globally, set the `DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE`
247
- * to `false` in ember-cli-build.js
248
- *
249
- * ```js
250
- * const { setConfig } = await import('@warp-drive-mirror/build-config');
251
- *
252
- * let app = new EmberApp(defaults, {});
253
- *
254
- * setConfig(app, __dirname, {
255
- * deprecations: {
256
- * // set to false to strip the deprecated code (thereby opting into the new behavior)
257
- * DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE: false
258
- * }
259
- * });
260
- * ```
261
- *
262
- * To resolve this deprecation on an individual relationship, adjust the `options` passed to
263
- * the relationship. For relationships with inverses, both sides MUST be migrated to the new
264
- * behavior at the same time.
265
- *
266
- * ```js
267
- * class Person extends Model {
268
- * @hasMany('person', {
269
- * async: false,
270
- * inverse: null,
271
- * resetOnRemoteUpdate: false
272
- * }) children;
273
- *
274
- * @belongsTo('person', {
275
- * async: false,
276
- * inverse: null,
277
- * resetOnRemoteUpdate: false
278
- * }) parent;
279
- * }
280
- * ```
281
- *
282
- * > Note: false is the only valid value here, all other values (including missing)
283
- * > will be treated as true, where `true` is the legacy behavior that is now deprecated.
284
- *
285
- * Once you have migrated all relationships, you can remove the the resetOnRemoteUpdate
286
- * option and set the deprecation flag to false in ember-cli-build.
287
- *
288
- * ### What if I don't want the new behavior?
289
- *
290
- * EmberData's philosophy is to not make assumptions about your application. Where possible
291
- * we seek out "100%" solutions – solutions that work for all use cases - and where that is
292
- * not possible we default to "90%" solutions – solutions that work for the vast majority of use
293
- * cases. In the case of "90%" solutions we look for primitives that allow you to resolve the
294
- * 10% case in your application. If no such primitives exist, we provide an escape hatch that
295
- * ensures you can build the behavior you need without adopting the cost of the default solution.
296
- *
297
- * In this case, the old behavior was a "40%" solution. The inability for an application developer
298
- * to determine what changes were made locally, and thus what changes should be preserved, made
299
- * it impossible to build certain features easily, or in some cases at all. The proliferation of
300
- * feature requests, bug reports (from folks surprised by the prior behavior) and addon attempts
301
- * in this space are all evidence of this.
302
- *
303
- * We believe the new behavior is a "90%" solution. It works for the vast majority of use cases,
304
- * often without noticeable changes to existing application behavior, and provides primitives that
305
- * allow you to build the behavior you need for the remaining 10%.
306
- *
307
- * The great news is that this behavior defaults to trusting your API similar to the old behavior.
308
- * If your API is correct, you will not need to make any changes to your application to adopt
309
- * the new behavior.
310
- *
311
- * This means the 10% cases are those where you can't trust your API to provide the correct
312
- * information. In these cases, because you now have cheap access to a diff of the relationship
313
- * state, there are a few options that weren't available before:
314
- *
315
- * - you can adjust returned API payloads to contain the expected changes that it doesn't include
316
- * - you can modify local state by adding or removing records on the HasMany record array to remove
317
- * any local changes that were not returned by the API.
318
- * - you can use `<Cache>.mutate(mutation)` to directly modify the local cache state of the relationship
319
- * to match the expected state.
320
- *
321
- * What this version (5.3) does not yet provide is a way to directly modify the cache's remote state
322
- * for the relationship via public APIs other than via the broader action of upserting a response via
323
- * `<Cache>.put(document)`. However, such an API was sketched in the Cache 2.1 RFC
324
- * `<Cache>.patch(operation)` and is likely to be added in a future 5.x release of EmberData.
325
- *
326
- * This version (5.3) also does not yet provide a way to directly modify the graph (a general purpose
327
- * subset of cache behaviors specific to relationships) via public APIs. However, during the
328
- * 5.x release series we will be working on finalizing the Graph API and making it public.
329
- *
330
- * If none of these options work for you, you can always opt-out more broadly by implementing
331
- * a custom Cache with the relationship behaviors you need.
332
- *
333
- * @property DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE
334
- * @type {Boolean}
335
- * @since 5.3
336
- * @until 6.0
337
- * @public
338
- */
339
8
  export const DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE = "5.3";
340
- /**
341
- * **id: ember-data:deprecate-many-array-duplicates**
342
- *
343
- * When the flag is `true` (default), adding duplicate records to a `ManyArray`
344
- * is deprecated in non-production environments. In production environments,
345
- * duplicate records added to a `ManyArray` will be deduped and no error will
346
- * be thrown.
347
- *
348
- * When the flag is `false`, an error will be thrown when duplicates are added.
349
- *
350
- * @property DEPRECATE_MANY_ARRAY_DUPLICATES
351
- * @type {Boolean}
352
- * @since 5.3
353
- * @until 6.0
354
- * @public
355
- */
356
9
  export const DEPRECATE_MANY_ARRAY_DUPLICATES = "5.3";
357
- /**
358
- * **id: ember-data:deprecate-store-extends-ember-object**
359
- *
360
- * When the flag is `true` (default), the Store class will extend from `@ember/object`.
361
- * When the flag is `false` or `ember-source` is not present, the Store will not extend
362
- * from EmberObject.
363
- *
364
- * @property DEPRECATE_STORE_EXTENDS_EMBER_OBJECT
365
- * @type {Boolean}
366
- * @since 5.4
367
- * @until 6.0
368
- * @public
369
- */
370
10
  export const DEPRECATE_STORE_EXTENDS_EMBER_OBJECT = "5.4";
371
- /**
372
- * **id: ember-data:schema-service-updates**
373
- *
374
- * When the flag is `true` (default), the legacy schema
375
- * service features will be enabled on the store and
376
- * the service, and deprecations will be thrown when
377
- * they are used.
378
- *
379
- * Deprecated features include:
380
- *
381
- * - `Store.registerSchema` method is deprecated in favor of the `Store.createSchemaService` hook
382
- * - `Store.registerSchemaDefinitionService` method is deprecated in favor of the `Store.createSchemaService` hook
383
- * - `Store.getSchemaDefinitionService` method is deprecated in favor of `Store.schema` property
384
- * - `SchemaService.doesTypeExist` method is deprecated in favor of the `SchemaService.hasResource` method
385
- * - `SchemaService.attributesDefinitionFor` method is deprecated in favor of the `SchemaService.fields` method
386
- * - `SchemaService.relationshipsDefinitionFor` method is deprecated in favor of the `SchemaService.fields` method
387
- *
388
- * @property ENABLE_LEGACY_SCHEMA_SERVICE
389
- * @type {Boolean}
390
- * @since 5.4
391
- * @until 6.0
392
- * @public
393
- */
394
11
  export const ENABLE_LEGACY_SCHEMA_SERVICE = "5.4";
395
- /**
396
- * **id: warp-drive.ember-inflector**
397
- *
398
- * Deprecates the use of ember-inflector for pluralization and singularization in favor
399
- * of the `@ember-data-mirror/request-utils` package.
400
- *
401
- * Rule configuration methods (singular, plural, uncountable, irregular) and
402
- * usage methods (singularize, pluralize) are are available as imports from
403
- * `@ember-data-mirror/request-utils/string`
404
- *
405
- * Notable differences with ember-inflector:
406
- * - there cannot be multiple inflector instances with separate rules
407
- * - pluralization does not support a count argument
408
- * - string caches now default to 10k entries instead of 1k, and this
409
- * size is now configurable. Additionally, the cache is now a LRU cache
410
- * instead of a first-N cache.
411
- *
412
- * This deprecation can be resolved by removing usage of ember-inflector or by using
413
- * both ember-inflector and @ember-data-mirror/request-utils in parallel and updating your
414
- * EmberData/WarpDrive build config to mark the deprecation as resolved
415
- * in ember-cli-build
416
- *
417
- * ```js
418
- * setConfig(app, __dirname, { deprecations: { DEPRECATE_EMBER_INFLECTOR: false }});
419
- * ```
420
- *
421
- * @property DEPRECATE_EMBER_INFLECTOR
422
- * @type {Boolean}
423
- * @since 5.3
424
- * @until 6.0
425
- * @public
426
- */
427
12
  export const DEPRECATE_EMBER_INFLECTOR = "5.3";
428
- /**
429
- * This is a special flag that can be used to opt-in early to receiving deprecations introduced in 6.x
430
- * which have had their infra backported to 5.x versions of EmberData.
431
- *
432
- * When this flag is not present or set to `true`, the deprecations from the 6.x branch
433
- * will not print their messages and the deprecation cannot be resolved.
434
- *
435
- * When this flag is present and set to `false`, the deprecations from the 6.x branch will
436
- * print and can be resolved.
437
- *
438
- * @property DISABLE_7X_DEPRECATIONS
439
- * @type {Boolean}
440
- * @since 5.3
441
- * @until 7.0
442
- * @public
443
- */
444
13
  export const DISABLE_7X_DEPRECATIONS = "7.0";
445
- /**
446
- * **id: warp-drive:deprecate-tracking-package**
447
- *
448
- * Deprecates the use of the @ember-data-mirror/tracking package which
449
- * historically provided bindings into Ember's reactivity system.
450
- *
451
- * This package is no longer needed as the configuration is now
452
- * provided by the @warp-drive-mirror/ember package.
453
- *
454
- * This deprecation can be resolved by removing the
455
- * @ember-data-mirror/tracking package from your project and ensuring
456
- * that your app.js file has the following import:
457
- *
458
- * ```js
459
- * import '@warp-drive-mirror/ember/install';
460
- * ```
461
- *
462
- * Once this import is present, you can remove the deprecation
463
- * by setting the deprecation to `false` in your build config:
464
- *
465
- * ```js
466
- * // inside of ember-cli-build.js
467
- *
468
- * const { setConfig } = await import('@warp-drive-mirror/build-config');
469
- *
470
- * setConfig(app, __dirname, {
471
- * deprecations: {
472
- * DEPRECATE_TRACKING_PACKAGE: false
473
- * }
474
- * });
475
- * ```
476
- *
477
- * @property DEPRECATE_TRACKING_PACKAGE
478
- * @type {Boolean}
479
- * @since 5.5
480
- * @until 6.0
481
- * @public
482
- */
483
14
  export const DEPRECATE_TRACKING_PACKAGE = "5.5";
484
15
  }
485
16
  //# sourceMappingURL=deprecation-versions.d.ts.map