@ember-data/tracking 5.4.0-beta.0 → 5.4.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,40 @@
1
- @ember-data/tracking
2
- ============================================================================
1
+ <p align="center">
2
+ <img
3
+ class="project-logo"
4
+ src="./ember-data-logo-dark.svg#gh-dark-mode-only"
5
+ alt="EmberData Store"
6
+ width="240px"
7
+ title="EmberData Store"
8
+ />
9
+ <img
10
+ class="project-logo"
11
+ src="./ember-data-logo-light.svg#gh-light-mode-only"
12
+ alt="EmberData Store"
13
+ width="240px"
14
+ title="EmberData Store"
15
+ />
16
+ </p>
3
17
 
4
- Tracking Primitives for controlling change notification of Tracked properties when working with EmberData
18
+ <p align="center">Tracking Primitives for controlling change notification of Tracked properties when working with EmberData</p>
19
+
20
+ ## Installation
21
+
22
+ Install using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)
23
+
24
+ ```
25
+ pnpm add @ember-data/tracking
26
+ ```
27
+
28
+ **Tagged Releases**
29
+
30
+ - ![NPM Canary Version](https://img.shields.io/npm/v/%40ember-data/tracking/canary?label=%40canary&color=FFBF00)
31
+ - ![NPM Beta Version](https://img.shields.io/npm/v/%40ember-data/tracking/beta?label=%40beta&color=ff00ff)
32
+ - ![NPM Stable Version](https://img.shields.io/npm/v/%40ember-data/tracking/latest?label=%40latest&color=90EE90)
33
+ - ![NPM LTS Version](https://img.shields.io/npm/v/%40ember-data/tracking/lts?label=%40lts&color=0096FF)
34
+ - ![NPM LTS 4.12 Version](https://img.shields.io/npm/v/%40ember-data/tracking/lts-4-12?label=%40lts-4-12&color=bbbbbb)
35
+
36
+
37
+ ## About
5
38
 
6
39
  > Note: This is a V2 Addon, but we have intentionally configured it to act and report as a V1 Addon due
7
40
  to bugs with ember-auto-import.
package/addon-main.cjs ADDED
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const { addonShim } = require('@warp-drive/build-config/addon-shim.cjs');
4
+
5
+ module.exports = addonShim(__dirname);
@@ -0,0 +1,376 @@
1
+ import { tagForProperty } from '@ember/-internals/metal';
2
+ import { consumeTag, dirtyTag } from '@glimmer/validator';
3
+ import { getOrSetGlobal, peekTransient, setTransient } from '@warp-drive/core-types/-private';
4
+ import { macroCondition, getGlobalConfig } from '@embroider/macros';
5
+ function createTransaction() {
6
+ const transaction = {
7
+ cbs: new Set(),
8
+ props: new Set(),
9
+ sub: new Set(),
10
+ parent: null
11
+ };
12
+ const TRANSACTION = peekTransient('TRANSACTION');
13
+ if (TRANSACTION) {
14
+ transaction.parent = TRANSACTION;
15
+ }
16
+ setTransient('TRANSACTION', transaction);
17
+ }
18
+ function maybeConsume(tag) {
19
+ if (tag) {
20
+ consumeTag(tag);
21
+ }
22
+ }
23
+ function maybeDirty(tag) {
24
+ if (tag) {
25
+ // @ts-expect-error - we are using Ember's Tag not Glimmer's
26
+ dirtyTag(tag);
27
+ }
28
+ }
29
+
30
+ /**
31
+ * If there is a current transaction, ensures that the relevant tag (and any
32
+ * array computed chains symbols, if applicable) will be consumed during the
33
+ * transaction.
34
+ *
35
+ * If there is no current transaction, will consume the tag(s) immediately.
36
+ *
37
+ * @internal
38
+ * @param obj
39
+ */
40
+ function subscribe(obj) {
41
+ const TRANSACTION = peekTransient('TRANSACTION');
42
+ if (TRANSACTION) {
43
+ TRANSACTION.sub.add(obj);
44
+ } else if ('tag' in obj) {
45
+ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
46
+ maybeConsume(obj['[]']);
47
+ maybeConsume(obj['@length']);
48
+ }
49
+ consumeTag(obj.tag);
50
+ } else {
51
+ obj.ref;
52
+ }
53
+ }
54
+ function updateRef(obj) {
55
+ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
56
+ try {
57
+ if ('tag' in obj) {
58
+ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
59
+ maybeDirty(obj['[]']);
60
+ maybeDirty(obj['@length']);
61
+ }
62
+ // @ts-expect-error - we are using Ember's Tag not Glimmer's
63
+ dirtyTag(obj.tag);
64
+ } else {
65
+ obj.ref = null;
66
+ }
67
+ } catch (e) {
68
+ if (e instanceof Error) {
69
+ if (e.message.includes('You attempted to update `undefined`')) {
70
+ // @ts-expect-error
71
+ const key = `<${obj._debug_base}>.${obj.key}`;
72
+ e.message = e.message.replace('You attempted to update `undefined`', `You attempted to update ${key}`);
73
+ e.stack = e.stack?.replace('You attempted to update `undefined`', `You attempted to update ${key}`);
74
+ const lines = e.stack?.split(`\n`);
75
+ const finalLines = [];
76
+ let lastFile = null;
77
+ lines?.forEach(line => {
78
+ if (line.trim().startsWith('at ')) {
79
+ // get the last string in the line which contains the code source location
80
+ const location = line.split(' ').at(-1);
81
+ // remove the line and char offset info
82
+
83
+ if (location.includes(':')) {
84
+ const parts = location.split(':');
85
+ parts.pop();
86
+ parts.pop();
87
+ const file = parts.join(':');
88
+ if (file !== lastFile) {
89
+ lastFile = file;
90
+ finalLines.push('');
91
+ }
92
+ }
93
+ finalLines.push(line);
94
+ }
95
+ });
96
+ const splitstr = '`undefined` was first used:';
97
+ const parts = e.message.split(splitstr);
98
+ parts.splice(1, 0, `Original Stack\n=============\n${finalLines.join(`\n`)}\n\n\`${key}\` was first used:`);
99
+ e.message = parts.join('');
100
+ }
101
+ }
102
+ throw e;
103
+ }
104
+ } else {
105
+ if ('tag' in obj) {
106
+ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
107
+ maybeDirty(obj['[]']);
108
+ maybeDirty(obj['@length']);
109
+ }
110
+ // @ts-expect-error - we are using Ember's Tag not Glimmer's
111
+ dirtyTag(obj.tag);
112
+ } else {
113
+ obj.ref = null;
114
+ }
115
+ }
116
+ }
117
+ function flushTransaction() {
118
+ const transaction = peekTransient('TRANSACTION');
119
+ setTransient('TRANSACTION', transaction.parent);
120
+ transaction.cbs.forEach(cb => {
121
+ cb();
122
+ });
123
+ transaction.props.forEach(obj => {
124
+ // mark this mutation as part of a transaction
125
+ obj.t = true;
126
+ updateRef(obj);
127
+ });
128
+ transaction.sub.forEach(obj => {
129
+ if ('tag' in obj) {
130
+ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
131
+ maybeConsume(obj['[]']);
132
+ maybeConsume(obj['@length']);
133
+ }
134
+ consumeTag(obj.tag);
135
+ } else {
136
+ obj.ref;
137
+ }
138
+ });
139
+ }
140
+ async function untrack() {
141
+ const transaction = peekTransient('TRANSACTION');
142
+ setTransient('TRANSACTION', transaction.parent);
143
+
144
+ // defer writes
145
+ await Promise.resolve();
146
+ transaction.cbs.forEach(cb => {
147
+ cb();
148
+ });
149
+ transaction.props.forEach(obj => {
150
+ // mark this mutation as part of a transaction
151
+ obj.t = true;
152
+ updateRef(obj);
153
+ });
154
+ }
155
+ function addToTransaction(obj) {
156
+ const transaction = peekTransient('TRANSACTION');
157
+ if (transaction) {
158
+ transaction.props.add(obj);
159
+ } else {
160
+ updateRef(obj);
161
+ }
162
+ }
163
+ function addTransactionCB(method) {
164
+ const transaction = peekTransient('TRANSACTION');
165
+ if (transaction) {
166
+ transaction.cbs.add(method);
167
+ } else {
168
+ method();
169
+ }
170
+ }
171
+
172
+ /**
173
+ * Run `method` without subscribing to any tracked properties
174
+ * controlled by EmberData.
175
+ *
176
+ * This should rarely be used except by libraries that really
177
+ * know what they are doing. It is most useful for wrapping
178
+ * certain kinds of fetch/query logic from within a `Resource`
179
+ * `hook` or other similar pattern.
180
+ *
181
+ * @function untracked
182
+ * @public
183
+ * @static
184
+ * @for @ember-data/tracking
185
+ * @param method
186
+ * @return result of invoking method
187
+ */
188
+ function untracked(method) {
189
+ createTransaction();
190
+ const ret = method();
191
+ void untrack();
192
+ return ret;
193
+ }
194
+
195
+ /**
196
+ * Run the method, subscribing to any tracked properties
197
+ * managed by EmberData that were accessed or written during
198
+ * the method's execution as per-normal but while allowing
199
+ * interleaving of reads and writes.
200
+ *
201
+ * This is useful when for instance you want to perform
202
+ * a mutation based on existing state that must be read first.
203
+ *
204
+ * @function transact
205
+ * @public
206
+ * @static
207
+ * @for @ember-data/tracking
208
+ * @param method
209
+ * @return result of invoking method
210
+ */
211
+ function transact(method) {
212
+ createTransaction();
213
+ const ret = method();
214
+ flushTransaction();
215
+ return ret;
216
+ }
217
+
218
+ /**
219
+ * A helpful utility for creating a new function that
220
+ * always runs in a transaction. E.G. this "memoizes"
221
+ * calling `transact(fn)`, currying args as necessary.
222
+ *
223
+ * @method memoTransact
224
+ * @public
225
+ * @static
226
+ * @for @ember-data/tracking
227
+ * @param method
228
+ * @return a function that will invoke method in a transaction with any provided args and return its result
229
+ */
230
+ function memoTransact(method) {
231
+ return function (...args) {
232
+ createTransaction();
233
+ const ret = method(...args);
234
+ flushTransaction();
235
+ return ret;
236
+ };
237
+ }
238
+ const Signals = getOrSetGlobal('Signals', Symbol('Signals'));
239
+
240
+ /**
241
+ * use to add a signal property to the prototype of something.
242
+ *
243
+ * First arg is the thing to define on
244
+ * Second arg is the property name
245
+ * Third agg is the initial value of the property if any.
246
+ *
247
+ * for instance
248
+ *
249
+ * ```ts
250
+ * class Model {}
251
+ * defineSignal(Model.prototype, 'isLoading', false);
252
+ * ```
253
+ *
254
+ * This is sort of like using a stage-3 decorator but works today
255
+ * while we are still on legacy decorators.
256
+ *
257
+ * e.g. it is equivalent to
258
+ *
259
+ * ```ts
260
+ * class Model {
261
+ * @signal accessor isLoading = false;
262
+ * }
263
+ * ```
264
+ *
265
+ * @internal
266
+ */
267
+ function defineSignal(obj, key, v) {
268
+ Object.defineProperty(obj, key, {
269
+ enumerable: true,
270
+ configurable: false,
271
+ get() {
272
+ const signals = this[Signals] = this[Signals] || new Map();
273
+ const existing = signals.has(key);
274
+ const _signal = entangleSignal(signals, this, key);
275
+ if (!existing && v !== undefined) {
276
+ _signal.lastValue = v;
277
+ }
278
+ return _signal.lastValue;
279
+ },
280
+ set(value) {
281
+ const signals = this[Signals] = this[Signals] || new Map();
282
+ let _signal = signals.get(key);
283
+ if (!_signal) {
284
+ _signal = createSignal(this, key);
285
+ signals.set(key, _signal);
286
+ }
287
+ if (_signal.lastValue !== value) {
288
+ _signal.lastValue = value;
289
+ addToTransaction(_signal);
290
+ }
291
+ }
292
+ });
293
+ }
294
+ function createArrayTags(obj, signal) {
295
+ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
296
+ signal['[]'] = tagForProperty(obj, '[]');
297
+ signal['@length'] = tagForProperty(obj, 'length');
298
+ }
299
+ }
300
+
301
+ /**
302
+ * Create a signal for the key/object pairing.
303
+ *
304
+ * @internal
305
+ * @param obj Object we're creating the signal on
306
+ * @param key Key to create the signal for
307
+ * @return the signal
308
+ */
309
+ function createSignal(obj, key) {
310
+ const _signal = {
311
+ key,
312
+ tag: tagForProperty(obj, key),
313
+ t: false,
314
+ shouldReset: false,
315
+ '[]': null,
316
+ '@length': null,
317
+ lastValue: undefined
318
+ };
319
+ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
320
+ // eslint-disable-next-line no-inner-declarations
321
+ function tryGet(prop) {
322
+ try {
323
+ return obj[prop];
324
+ } catch {
325
+ return;
326
+ }
327
+ }
328
+ const modelName = tryGet('$type') ?? tryGet('modelName') ?? tryGet('constructor')?.modelName ?? '';
329
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
330
+ const className = obj.constructor?.name ?? obj.toString?.() ?? 'unknown';
331
+ _signal._debug_base = `${className}${modelName && !className.startsWith('SchemaRecord') ? `:${modelName}` : ''}`;
332
+ }
333
+ return _signal;
334
+ }
335
+
336
+ /**
337
+ * Create a signal for the key/object pairing and subscribes to the signal.
338
+ *
339
+ * Use when you need to ensure a signal exists and is subscribed to.
340
+ *
341
+ * @internal
342
+ * @param signals Map of signals
343
+ * @param obj Object we're creating the signal on
344
+ * @param key Key to create the signal for
345
+ * @return the signal
346
+ */
347
+ function entangleSignal(signals, obj, key) {
348
+ let _signal = signals.get(key);
349
+ if (!_signal) {
350
+ _signal = createSignal(obj, key);
351
+ signals.set(key, _signal);
352
+ }
353
+ subscribe(_signal);
354
+ return _signal;
355
+ }
356
+ function getSignal(obj, key, initialState) {
357
+ let signals = obj[Signals];
358
+ if (!signals) {
359
+ signals = new Map();
360
+ obj[Signals] = signals;
361
+ }
362
+ let _signal = signals.get(key);
363
+ if (!_signal) {
364
+ _signal = createSignal(obj, key);
365
+ _signal.shouldReset = initialState;
366
+ signals.set(key, _signal);
367
+ }
368
+ return _signal;
369
+ }
370
+ function peekSignal(obj, key) {
371
+ const signals = obj[Signals];
372
+ if (signals) {
373
+ return signals.get(key);
374
+ }
375
+ }
376
+ export { Signals, addToTransaction, addTransactionCB, createArrayTags, createSignal, defineSignal, entangleSignal, getSignal, memoTransact, peekSignal, subscribe, transact, untracked };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"-private.js","sources":["../src/-private.ts"],"sourcesContent":["import { tagForProperty } from '@ember/-internals/metal';\nimport { consumeTag, dirtyTag } from '@glimmer/validator';\n\nimport { DEPRECATE_COMPUTED_CHAINS } from '@warp-drive/build-config/deprecations';\nimport { DEBUG } from '@warp-drive/build-config/env';\nimport { getOrSetGlobal, peekTransient, setTransient } from '@warp-drive/core-types/-private';\n\n/**\n * This package provides primitives that allow powerful low-level\n * adjustments to change tracking notification behaviors.\n *\n * Typically you want to use these primitives when you want to divorce\n * property accesses on EmberData provided objects from the current\n * tracking context. Typically this sort of thing occurs when serializing\n * tracked data to send in a request: the data itself is often ancillary\n * to the thing which triggered the request in the first place and you\n * would not want to re-trigger the request for any update to the data.\n *\n * @module @ember-data/tracking\n * @main @ember-data/tracking\n */\ntype OpaqueFn = (...args: unknown[]) => unknown;\ntype Tag = { ref: null; t: boolean };\ntype Transaction = {\n cbs: Set<OpaqueFn>;\n props: Set<Tag | Signal>;\n sub: Set<Tag | Signal>;\n parent: Transaction | null;\n};\n\nfunction createTransaction() {\n const transaction: Transaction = {\n cbs: new Set(),\n props: new Set(),\n sub: new Set(),\n parent: null,\n };\n const TRANSACTION = peekTransient<Transaction>('TRANSACTION');\n\n if (TRANSACTION) {\n transaction.parent = TRANSACTION;\n }\n setTransient('TRANSACTION', transaction);\n}\n\nfunction maybeConsume(tag: ReturnType<typeof tagForProperty> | null): void {\n if (tag) {\n consumeTag(tag);\n }\n}\n\nfunction maybeDirty(tag: ReturnType<typeof tagForProperty> | null): void {\n if (tag) {\n // @ts-expect-error - we are using Ember's Tag not Glimmer's\n dirtyTag(tag);\n }\n}\n\n/**\n * If there is a current transaction, ensures that the relevant tag (and any\n * array computed chains symbols, if applicable) will be consumed during the\n * transaction.\n *\n * If there is no current transaction, will consume the tag(s) immediately.\n *\n * @internal\n * @param obj\n */\nexport function subscribe(obj: Tag | Signal): void {\n const TRANSACTION = peekTransient<Transaction | null>('TRANSACTION');\n\n if (TRANSACTION) {\n TRANSACTION.sub.add(obj);\n } else if ('tag' in obj) {\n if (DEPRECATE_COMPUTED_CHAINS) {\n maybeConsume(obj['[]']);\n maybeConsume(obj['@length']);\n }\n consumeTag(obj.tag);\n } else {\n obj.ref;\n }\n}\n\nfunction updateRef(obj: Tag | Signal): void {\n if (DEBUG) {\n try {\n if ('tag' in obj) {\n if (DEPRECATE_COMPUTED_CHAINS) {\n maybeDirty(obj['[]']);\n maybeDirty(obj['@length']);\n }\n // @ts-expect-error - we are using Ember's Tag not Glimmer's\n dirtyTag(obj.tag);\n } else {\n obj.ref = null;\n }\n } catch (e: unknown) {\n if (e instanceof Error) {\n if (e.message.includes('You attempted to update `undefined`')) {\n // @ts-expect-error\n const key = `<${obj._debug_base}>.${obj.key}`;\n e.message = e.message.replace('You attempted to update `undefined`', `You attempted to update ${key}`);\n e.stack = e.stack?.replace('You attempted to update `undefined`', `You attempted to update ${key}`);\n\n const lines = e.stack?.split(`\\n`);\n const finalLines: string[] = [];\n let lastFile: string | null = null;\n\n lines?.forEach((line) => {\n if (line.trim().startsWith('at ')) {\n // get the last string in the line which contains the code source location\n const location = line.split(' ').at(-1)!;\n // remove the line and char offset info\n\n if (location.includes(':')) {\n const parts = location.split(':');\n parts.pop();\n parts.pop();\n const file = parts.join(':');\n if (file !== lastFile) {\n lastFile = file;\n finalLines.push('');\n }\n }\n finalLines.push(line);\n }\n });\n\n const splitstr = '`undefined` was first used:';\n const parts = e.message.split(splitstr);\n parts.splice(1, 0, `Original Stack\\n=============\\n${finalLines.join(`\\n`)}\\n\\n\\`${key}\\` was first used:`);\n\n e.message = parts.join('');\n }\n }\n throw e;\n }\n } else {\n if ('tag' in obj) {\n if (DEPRECATE_COMPUTED_CHAINS) {\n maybeDirty(obj['[]']);\n maybeDirty(obj['@length']);\n }\n // @ts-expect-error - we are using Ember's Tag not Glimmer's\n dirtyTag(obj.tag);\n } else {\n obj.ref = null;\n }\n }\n}\n\nfunction flushTransaction() {\n const transaction = peekTransient<Transaction>('TRANSACTION')!;\n setTransient('TRANSACTION', transaction.parent);\n transaction.cbs.forEach((cb) => {\n cb();\n });\n transaction.props.forEach((obj) => {\n // mark this mutation as part of a transaction\n obj.t = true;\n updateRef(obj);\n });\n transaction.sub.forEach((obj) => {\n if ('tag' in obj) {\n if (DEPRECATE_COMPUTED_CHAINS) {\n maybeConsume(obj['[]']);\n maybeConsume(obj['@length']);\n }\n consumeTag(obj.tag);\n } else {\n obj.ref;\n }\n });\n}\nasync function untrack() {\n const transaction = peekTransient<Transaction>('TRANSACTION')!;\n setTransient('TRANSACTION', transaction.parent);\n\n // defer writes\n await Promise.resolve();\n transaction.cbs.forEach((cb) => {\n cb();\n });\n transaction.props.forEach((obj) => {\n // mark this mutation as part of a transaction\n obj.t = true;\n updateRef(obj);\n });\n}\n\nexport function addToTransaction(obj: Tag | Signal): void {\n const transaction = peekTransient<Transaction>('TRANSACTION');\n\n if (transaction) {\n transaction.props.add(obj);\n } else {\n updateRef(obj);\n }\n}\nexport function addTransactionCB(method: OpaqueFn): void {\n const transaction = peekTransient<Transaction>('TRANSACTION');\n\n if (transaction) {\n transaction.cbs.add(method);\n } else {\n method();\n }\n}\n\n/**\n * Run `method` without subscribing to any tracked properties\n * controlled by EmberData.\n *\n * This should rarely be used except by libraries that really\n * know what they are doing. It is most useful for wrapping\n * certain kinds of fetch/query logic from within a `Resource`\n * `hook` or other similar pattern.\n *\n * @function untracked\n * @public\n * @static\n * @for @ember-data/tracking\n * @param method\n * @return result of invoking method\n */\nexport function untracked<T extends OpaqueFn>(method: T): ReturnType<T> {\n createTransaction();\n const ret = method();\n void untrack();\n return ret as ReturnType<T>;\n}\n\n/**\n * Run the method, subscribing to any tracked properties\n * managed by EmberData that were accessed or written during\n * the method's execution as per-normal but while allowing\n * interleaving of reads and writes.\n *\n * This is useful when for instance you want to perform\n * a mutation based on existing state that must be read first.\n *\n * @function transact\n * @public\n * @static\n * @for @ember-data/tracking\n * @param method\n * @return result of invoking method\n */\nexport function transact<T extends OpaqueFn>(method: T): ReturnType<T> {\n createTransaction();\n const ret = method();\n flushTransaction();\n return ret as ReturnType<T>;\n}\n\n/**\n * A helpful utility for creating a new function that\n * always runs in a transaction. E.G. this \"memoizes\"\n * calling `transact(fn)`, currying args as necessary.\n *\n * @method memoTransact\n * @public\n * @static\n * @for @ember-data/tracking\n * @param method\n * @return a function that will invoke method in a transaction with any provided args and return its result\n */\nexport function memoTransact<T extends OpaqueFn>(method: T): (...args: unknown[]) => ReturnType<T> {\n return function (...args: unknown[]) {\n createTransaction();\n const ret = method(...args);\n flushTransaction();\n return ret as ReturnType<T>;\n };\n}\n\nexport const Signals = getOrSetGlobal('Signals', Symbol('Signals'));\n\n/**\n * use to add a signal property to the prototype of something.\n *\n * First arg is the thing to define on\n * Second arg is the property name\n * Third agg is the initial value of the property if any.\n *\n * for instance\n *\n * ```ts\n * class Model {}\n * defineSignal(Model.prototype, 'isLoading', false);\n * ```\n *\n * This is sort of like using a stage-3 decorator but works today\n * while we are still on legacy decorators.\n *\n * e.g. it is equivalent to\n *\n * ```ts\n * class Model {\n * @signal accessor isLoading = false;\n * }\n * ```\n *\n * @internal\n */\nexport function defineSignal<T extends object>(obj: T, key: string, v?: unknown) {\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: false,\n get(this: T & { [Signals]: Map<string, Signal> }) {\n const signals = (this[Signals] = this[Signals] || new Map());\n const existing = signals.has(key);\n const _signal = entangleSignal(signals, this, key);\n if (!existing && v !== undefined) {\n _signal.lastValue = v;\n }\n return _signal.lastValue;\n },\n set(this: T & { [Signals]: Map<string, Signal> }, value: unknown) {\n const signals = (this[Signals] = this[Signals] || new Map());\n let _signal = signals.get(key);\n if (!_signal) {\n _signal = createSignal(this, key);\n signals.set(key, _signal);\n }\n if (_signal.lastValue !== value) {\n _signal.lastValue = value;\n addToTransaction(_signal);\n }\n },\n });\n}\n\nexport interface Signal {\n /**\n * Key on the associated object\n * @internal\n */\n key: string;\n _debug_base?: string;\n\n /**\n * Whether this signal is part of an active transaction.\n * @internal\n */\n t: boolean;\n\n /**\n * Whether to \"bust\" the lastValue cache\n * @internal\n */\n shouldReset: boolean;\n\n /**\n * The framework specific \"signal\" e.g. glimmer \"tracked\"\n * or starbeam \"cell\" to consume/invalidate when appropriate.\n *\n * @internal\n */\n tag: ReturnType<typeof tagForProperty>;\n\n /**\n * In classic ember, arrays must entangle a `[]` symbol\n * in addition to any other tag in order for array chains to work.\n *\n * Note, this symbol MUST be the one that ember itself generates\n *\n * @internal\n */\n '[]': ReturnType<typeof tagForProperty> | null;\n /**\n * In classic ember, arrays must entangle a `@length` symbol\n * in addition to any other tag in order for array chains to work.\n *\n * Note, this symbol MUST be the one that ember itself generates\n *\n * @internal\n */\n '@length': ReturnType<typeof tagForProperty> | null;\n\n /**\n * The lastValue computed for this signal when\n * a signal is also used for storage.\n * @internal\n */\n lastValue: unknown;\n}\n\nexport function createArrayTags<T extends object>(obj: T, signal: Signal) {\n if (DEPRECATE_COMPUTED_CHAINS) {\n signal['[]'] = tagForProperty(obj, '[]');\n signal['@length'] = tagForProperty(obj, 'length');\n }\n}\n\n/**\n * Create a signal for the key/object pairing.\n *\n * @internal\n * @param obj Object we're creating the signal on\n * @param key Key to create the signal for\n * @return the signal\n */\nexport function createSignal<T extends object>(obj: T, key: string): Signal {\n const _signal: Signal = {\n key,\n tag: tagForProperty(obj, key),\n\n t: false,\n shouldReset: false,\n '[]': null,\n '@length': null,\n lastValue: undefined,\n };\n\n if (DEBUG) {\n // eslint-disable-next-line no-inner-declarations\n function tryGet<T1 = string>(prop: string): T1 | undefined {\n try {\n return obj[prop as keyof typeof obj] as unknown as T1;\n } catch {\n return;\n }\n }\n const modelName =\n tryGet('$type') ?? tryGet('modelName') ?? tryGet<{ modelName?: string }>('constructor')?.modelName ?? '';\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n const className = obj.constructor?.name ?? obj.toString?.() ?? 'unknown';\n _signal._debug_base = `${className}${modelName && !className.startsWith('SchemaRecord') ? `:${modelName}` : ''}`;\n }\n\n return _signal;\n}\n\n/**\n * Create a signal for the key/object pairing and subscribes to the signal.\n *\n * Use when you need to ensure a signal exists and is subscribed to.\n *\n * @internal\n * @param signals Map of signals\n * @param obj Object we're creating the signal on\n * @param key Key to create the signal for\n * @return the signal\n */\nexport function entangleSignal<T extends object>(signals: Map<string, Signal>, obj: T, key: string): Signal {\n let _signal = signals.get(key);\n if (!_signal) {\n _signal = createSignal(obj, key);\n signals.set(key, _signal);\n }\n subscribe(_signal);\n return _signal;\n}\n\ninterface Signaler {\n [Signals]: Map<string, Signal>;\n}\n\nexport function getSignal<T extends object>(obj: T, key: string, initialState: boolean): Signal {\n let signals = (obj as Signaler)[Signals];\n\n if (!signals) {\n signals = new Map();\n (obj as Signaler)[Signals] = signals;\n }\n\n let _signal = signals.get(key);\n if (!_signal) {\n _signal = createSignal(obj, key);\n _signal.shouldReset = initialState;\n signals.set(key, _signal);\n }\n return _signal;\n}\n\nexport function peekSignal<T extends object>(obj: T, key: string): Signal | undefined {\n const signals = (obj as Signaler)[Signals];\n if (signals) {\n return signals.get(key);\n }\n}\n"],"names":["createTransaction","transaction","cbs","Set","props","sub","parent","TRANSACTION","peekTransient","setTransient","maybeConsume","tag","consumeTag","maybeDirty","dirtyTag","subscribe","obj","add","macroCondition","getGlobalConfig","WarpDrive","deprecations","DEPRECATE_COMPUTED_CHAINS","ref","updateRef","env","DEBUG","e","Error","message","includes","key","_debug_base","replace","stack","lines","split","finalLines","lastFile","forEach","line","trim","startsWith","location","at","parts","pop","file","join","push","splitstr","splice","flushTransaction","cb","t","untrack","Promise","resolve","addToTransaction","addTransactionCB","method","untracked","ret","transact","memoTransact","args","Signals","getOrSetGlobal","Symbol","defineSignal","v","Object","defineProperty","enumerable","configurable","get","signals","Map","existing","has","_signal","entangleSignal","undefined","lastValue","set","value","createSignal","createArrayTags","signal","tagForProperty","shouldReset","tryGet","prop","modelName","className","constructor","name","toString","getSignal","initialState","peekSignal"],"mappings":";;;;;AA8BA,SAASA,iBAAiBA,GAAG;AAC3B,EAAA,MAAMC,WAAwB,GAAG;AAC/BC,IAAAA,GAAG,EAAE,IAAIC,GAAG,EAAE;AACdC,IAAAA,KAAK,EAAE,IAAID,GAAG,EAAE;AAChBE,IAAAA,GAAG,EAAE,IAAIF,GAAG,EAAE;AACdG,IAAAA,MAAM,EAAE,IAAA;GACT,CAAA;AACD,EAAA,MAAMC,WAAW,GAAGC,aAAa,CAAc,aAAa,CAAC,CAAA;AAE7D,EAAA,IAAID,WAAW,EAAE;IACfN,WAAW,CAACK,MAAM,GAAGC,WAAW,CAAA;AAClC,GAAA;AACAE,EAAAA,YAAY,CAAC,aAAa,EAAER,WAAW,CAAC,CAAA;AAC1C,CAAA;AAEA,SAASS,YAAYA,CAACC,GAA6C,EAAQ;AACzE,EAAA,IAAIA,GAAG,EAAE;IACPC,UAAU,CAACD,GAAG,CAAC,CAAA;AACjB,GAAA;AACF,CAAA;AAEA,SAASE,UAAUA,CAACF,GAA6C,EAAQ;AACvE,EA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ue } from '@glimmer/tracking/primitives/cache';
2
+ export { createCache, getValue } from '@glimmer/tracking/primitives/cache';
3
+ import { macroCondition, getGlobalConfig } from '@embroider/macros';
4
+ export { memoTransact, transact, untracked } from "./-private.js";
5
+ export { dependentKeyCompat as compat } from '@ember/object/compat';
6
+ function cached(target, key, descriptor) {
7
+ // Error on `@cached()`, `@cached(...args)`, and `@cached propName = value;`
8
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
9
+ if (!test) {
10
+ throw new Error('You attempted to use @cached(), which is not necessary nor supported. Remove the parentheses and you will be good to go!');
11
+ }
12
+ })(target !== undefined) : {};
13
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
14
+ if (!test) {
15
+ throw new Error(`You attempted to use @cached on with ${arguments.length > 1 ? 'arguments' : 'an argument'} ( @cached(${Array.from(arguments).map(d => `'${d}'`).join(', ')}), which is not supported. Dependencies are automatically tracked, so you can just use ${'`@cached`'}`);
16
+ }
17
+ })(typeof target === 'object' && typeof key === 'string' && typeof descriptor === 'object' && arguments.length === 3) : {};
18
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
19
+ if (!test) {
20
+ throw new Error(`The @cached decorator must be applied to getters. '${key}' is not a getter.`);
21
+ }
22
+ })(typeof descriptor.get === 'function') : {};
23
+ const caches = new WeakMap();
24
+ // eslint-disable-next-line @typescript-eslint/unbound-method
25
+ const getter = descriptor.get;
26
+ descriptor.get = function () {
27
+ if (!caches.has(this)) caches.set(this, createCache(getter.bind(this)));
28
+ return getValue(caches.get(this));
29
+ };
30
+ }
31
+ export { cached };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nimport { assert } from '@warp-drive/build-config/macros';\n\nexport { transact, memoTransact, untracked } from './-private';\n\n// temporary so we can remove the glimmer and ember imports elsewhere\n// eslint-disable-next-line no-restricted-imports\nexport { dependentKeyCompat as compat } from '@ember/object/compat';\n\nexport function cached<T extends object, K extends keyof T & string>(\n target: T,\n key: K,\n descriptor: PropertyDescriptor\n) {\n // Error on `@cached()`, `@cached(...args)`, and `@cached propName = value;`\n assert(\n 'You attempted to use @cached(), which is not necessary nor supported. Remove the parentheses and you will be good to go!',\n target !== undefined\n );\n assert(\n `You attempted to use @cached on with ${arguments.length > 1 ? 'arguments' : 'an argument'} ( @cached(${Array.from(\n arguments\n )\n .map((d) => `'${d}'`)\n .join(\n ', '\n )}), which is not supported. Dependencies are automatically tracked, so you can just use ${'`@cached`'}`,\n typeof target === 'object' && typeof key === 'string' && typeof descriptor === 'object' && arguments.length === 3\n );\n assert(\n `The @cached decorator must be applied to getters. '${key}' is not a getter.`,\n typeof descriptor.get === 'function'\n );\n\n const caches = new WeakMap<object, object>();\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const getter = descriptor.get;\n descriptor.get = function () {\n if (!caches.has(this)) caches.set(this, createCache(getter.bind(this)));\n return getValue<unknown>(caches.get(this) as Parameters<typeof getValue>[0]);\n };\n}\n\nexport { createCache, getValue };\n"],"names":["cached","target","key","descriptor","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","undefined","arguments","length","Array","from","map","d","join","get","caches","WeakMap","getter","has","set","createCache","bind","getValue"],"mappings":";;;;;;AAUO,SAASA,MAAMA,CACpBC,MAAS,EACTC,GAAM,EACNC,UAA8B,EAC9B;AACA;EACAC,cAAA,CAAAC,eAAA,EAAAC,CAAAA,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAA,GAAA,CAAAC,IAAA,IAAA;AAAA,IAAA,IAAA,CAAAA,IAAA,EAAA;MAAA,MAAAC,IAAAA,KAAA,CACE,0HAA0H,CAAA,CAAA;AAAA,KAAA;GAC1HT,EAAAA,MAAM,KAAKU,SAAS,CAAA,GAAA,EAAA,CAAA;EAEtBP,cAAA,CAAAC,eAAA,EAAAC,CAAAA,SAAA,CAAAC,GAAA,CAAAC,KAAA,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C,CAAA;IACvE,OAAOC,QAAQ,CAAUP,MAAM,CAACD,GAAG,CAAC,IAAI,CAAmC,CAAC,CAAA;GAC7E,CAAA;AACH;;;;"}
@@ -0,0 +1,12 @@
1
+ <svg width="1028" height="324" viewBox="0 0 1028 324" xmlns="http://www.w3.org/2000/svg">
2
+ <g transform="translate(76.041 42)" fill="none" fill-rule="evenodd">
3
+ <g fill="#E04E39">
4
+ <path d="M507.552 137.229s-12.56 9.744-23.616 8.656c-11.056-1.088-7.584-25.792-7.584-25.792s2.384-22.656-4.128-24.56c-6.496-1.888-14.512 5.904-14.512 5.904s-9.968 11.056-14.736 25.152l-1.312.432s1.52-24.72-.208-30.352c-1.296-2.816-13.216-2.592-15.168 2.384-1.952 4.992-11.488 39.664-12.144 54.192 0 0-18.64 15.824-34.88 18.416-16.256 2.608-20.16-7.584-20.16-7.584s44.208-12.352 42.688-47.68c-1.504-35.328-35.648-22.256-39.504-19.36-3.744 2.816-23.696 14.848-29.52 48.176-.192 1.12-.544 6.08-.544 6.08s-17.12 11.472-26.656 14.512c0 0 26.656-44.864-5.84-65.232-9.14-5.502-17.106-.44-21.845 4.208-2.91 2.854 39.397-43.424 29.637-84.832C302.88.237 293.024-1.875 283.984 1.325c-13.728 5.408-18.928 13.424-18.928 13.424s-17.776 25.792-21.904 64.16c-4.112 38.352-10.176 84.736-10.176 84.736s-8.464 8.24-16.256 8.672c-7.808.416-4.336-23.2-4.336-23.2s6.064-35.968 5.648-42.048c-.448-6.064-.88-9.312-8.032-11.472-7.152-2.176-14.96 6.928-14.96 6.928s-20.576 31.2-22.304 35.968l-1.104 1.968-1.072-1.312s14.512-42.48.656-43.12c-13.872-.656-22.976 15.168-22.976 15.168s-15.824 26.448-16.48 29.472l-1.072-1.296s6.496-30.768 5.2-38.368c-1.312-7.584-8.448-6.064-8.448-6.064s-9.104-1.088-11.488 4.768c-2.384 5.856-11.056 44.64-12.144 56.992 0 0-22.752 16.256-37.712 16.464-14.944.224-13.424-9.472-13.424-9.472s54.832-18.768 39.872-55.824c-6.72-9.536-14.512-12.528-25.568-12.32-11.056.224-24.768 6.96-33.648 26.896-4.256 9.504-5.792 18.544-6.672 25.36 0 0-9.584 1.968-14.784-2.368-5.216-4.336-7.888 0-7.888 0s-8.928 11.392-.048 14.848c8.896 3.472 22.752 5.088 22.752 5.088 1.28 6.064 4.976 16.384 15.808 24.592 16.256 12.352 47.44-1.136 47.44-1.136l12.784-7.168s.432 11.728 9.76 13.44c9.312 1.712 13.216-.032 29.472-39.472 9.536-20.16 10.192-19.072 10.192-19.072 1.072-.224-6.288 38.352-3.472 48.752 2.816 10.416 15.168 9.328 15.168 9.328s6.72 1.296 12.144-17.776c5.408-19.072 15.824-40.096 15.824-40.096 1.28 0-3.264 39.44 3.664 52.016 6.944 12.576 24.928 4.224 24.928 4.224s12.576-6.336 14.528-8.288c0 0 14.912 12.704 35.952 10.4 47.04-9.264 63.776-21.776 63.776-21.776s8.08 20.48 33.12 22.384c28.592 2.16 44.208-15.824 44.208-15.824s-.224 11.696 9.744 15.824c9.984 4.112 16.688-19.04 16.688-19.04l16.688-45.984c1.52 0 2.384 29.904 18.864 34.672 16.464 4.768 37.92-11.168 37.92-11.168s5.2-2.864 4.336-11.536c-.88-8.672-8.672-5.44-8.672-5.44zm-434.08-21.696c5.84 5.632 3.68 17.76-7.376 25.344-11.04 7.6-16.032 6.08-16.032 6.08.656-25.792 17.568-37.072 23.408-31.424zM289.104 26.46c3.68 19.504-32.288 77.584-32.288 77.584.432-13.008 13.216-56.992 13.216-56.992s15.376-40.096 19.072-20.592zm-35.552 148.016s-2.816-9.536 5.2-36.192c8.032-26.656 26.88-16.256 26.88-16.256s13.008 9.968 2.816 36.624c-10.176 26.656-34.896 15.824-34.896 15.824zm109.664-52.224c8.88-16.256 15.824-7.376 15.824-7.376s7.584 8.24-1.088 20.592c-8.672 12.352-21.232 11.488-21.232 11.488s-2.384-8.464 6.496-24.704z"/>
5
+ <path d="M451.918 188.027v-3.112h1.974c.273 0 .547.028.835.057.288.043.562.115.793.216.245.101.432.245.576.433.159.187.23.446.23.763 0 .72-.216 1.182-.648 1.369-.432.187-.994.274-1.671.274h-2.09zm-2.349-4.942v11.843h2.349v-5.057h1.47l2.881 5.057h2.464l-3.17-5.172c.432-.044.836-.13 1.225-.26.374-.13.706-.317.98-.562.288-.245.504-.562.662-.95.173-.39.245-.85.245-1.398 0-1.282-.403-2.19-1.196-2.709-.807-.533-1.96-.792-3.443-.792h-4.467zm-3.76 5.936c0-1.21.201-2.32.62-3.328a8.09 8.09 0 0 1 1.7-2.608 7.71 7.71 0 0 1 2.52-1.73 7.864 7.864 0 0 1 3.127-.619c1.095 0 2.133.202 3.098.62.98.418 1.816.994 2.536 1.729.72.735 1.282 1.599 1.714 2.608.418 1.008.634 2.118.634 3.328s-.216 2.32-.634 3.342c-.432 1.009-.994 1.902-1.714 2.637a7.594 7.594 0 0 1-2.536 1.744 7.725 7.725 0 0 1-3.098.619 7.864 7.864 0 0 1-3.126-.62 7.535 7.535 0 0 1-2.522-1.743c-.72-.735-1.282-1.628-1.7-2.637-.418-1.022-.62-2.132-.62-3.342zm-2.896 0c0 1.628.302 3.083.893 4.38.605 1.311 1.398 2.42 2.392 3.343a10.57 10.57 0 0 0 3.472 2.117c1.311.49 2.68.735 4.106.735 1.441 0 2.81-.245 4.121-.735a10.57 10.57 0 0 0 3.472-2.117c.995-.923 1.787-2.032 2.392-3.343.59-1.297.879-2.752.879-4.38 0-1.6-.288-3.055-.879-4.351-.605-1.312-1.397-2.42-2.392-3.329a10.57 10.57 0 0 0-3.472-2.118 11.356 11.356 0 0 0-4.12-.749c-1.427 0-2.796.245-4.107.75a10.57 10.57 0 0 0-3.472 2.117c-.994.908-1.787 2.017-2.392 3.329-.59 1.296-.893 2.752-.893 4.35z"/>
6
+ </g>
7
+ <path d="M589.663 44.545c.42-4.718.63-8.462.63-11.226 0-3.638-.33-6.168-.975-7.583-.646-1.416-1.592-2.124-2.823-2.124-2.207 0-4.19 1.365-5.976 4.093-1.772 2.73-3.198 6.25-4.295 10.556-1.08 4.31-2.252 8.992-3.528 14.05-1.263 5.061-2.192 10.016-2.793 14.863-.57 4.85-1.051 9.221-1.397 13.115-.36 3.889-.615 6.654-.75 8.296-.3 3.348-.54 6.575-.721 9.68-.18 3.108-.315 5.943-.39 8.503a225.54 225.54 0 0 0-.107 6.71v5.432A515.125 515.125 0 0 0 576.9 92.079a452.907 452.907 0 0 0 3.903-11.879c1.277-4.125 2.554-8.216 3.815-12.274a145.287 145.287 0 0 0 3.213-12.052c.87-3.98 1.487-7.756 1.832-11.33zm-47.689 68.962a42.47 42.47 0 0 0-11.877 8.613c-3.468 3.566-6.366 8.267-8.694 14.114-2.312 5.843-4.084 10.873-5.3 15.086-1.216 4.21-1.817 8.014-1.817 11.414 0 1.055.15 2.106.449 3.162.302 1.055.857 2.004 1.668 2.85.81.84 1.952 1.528 3.439 2.054 1.471.53 3.393.793 5.766.793 1.2 0 2.402-.268 3.588-.81a16.08 16.08 0 0 0 3.379-2.102 24.957 24.957 0 0 0 3.093-2.96 31.904 31.904 0 0 0 2.673-3.453c1.892-2.75 3.618-5.854 5.165-9.318-.197-.95-.376-2.463-.51-4.538-.136-2.07-.24-5.231-.301-9.476-.075-4.247-.152-7.732-.21-10.448a519.42 519.42 0 0 1-.15-7.44c-.045-2.243-.09-4.075-.152-5.503-.074-1.427-.149-2.107-.209-2.038zm70.062 59.695c-4.775 3.934-9.505 7.443-14.144 10.52a127.062 127.062 0 0 1-6.173 3.812 76.437 76.437 0 0 1-6.367 3.328 48.4 48.4 0 0 1-6.094 2.362c-1.952.606-3.77.91-5.406.91-.976 0-2.404-.215-4.296-.643-1.892-.434-3.962-1.306-6.2-2.632-2.252-1.323-4.49-3.239-6.742-5.742-2.237-2.508-4.174-5.835-5.842-9.982a100.616 100.616 0 0 1-7.957 7.35 61.432 61.432 0 0 1-8.724 6.06c-3.003 1.72-6.051 3.098-9.114 4.132-3.08 1.04-6.171 1.557-9.28 1.557-4.384 0-8.168-.91-11.381-2.732a24.331 24.331 0 0 1-7.975-7.274c-2.13-3.025-3.709-6.458-4.758-10.299a45.513 45.513 0 0 1-1.562-11.912c0-4.374.556-8.802 1.667-13.285a62.3 62.3 0 0 1 4.85-13.028 306.475 306.475 0 0 1 7.072-13.185c2.598-4.58 6.036-8.752 10.316-12.516 4.279-3.762 8.678-6.6 13.183-8.516 4.518-1.913 9.34-3.11 14.46-3.59.209-8.754 1.141-16.469 2.793-23.14 1.651-6.668 3.437-13.846 5.345-21.532 1.907-7.683 4.37-14.76 7.388-21.227 3.018-6.47 6.321-12.062 9.91-16.778 3.589-4.717 7.416-8.406 11.487-11.067 4.069-2.66 8.273-3.992 12.613-3.992 3.153 0 5.854.827 8.078 2.48 2.222 1.653 4.04 3.847 5.42 6.583 1.365 2.734 2.358 5.907 2.974 9.517.6 3.612.915 7.342.915 11.19 0 2.402-.03 4.872-.075 7.41-.196 9.674-1.683 18.678-4.474 27.013-2.793 8.334-5.556 16.573-8.274 24.716-2.732 8.144-6.036 16.201-9.88 24.171-5.886 12.197-9.64 20.478-11.246 24.837-.346.954-.691 2.114-1.051 3.478a84.878 84.878 0 0 0-.991 4.443 70.896 70.896 0 0 0-.796 4.908 38.845 38.845 0 0 0-.316 4.852c0 1.977.106 3.853.346 5.625.225 1.77.6 3.356 1.126 4.75.525 1.399 1.23 2.507 2.132 3.323.871.817 1.967 1.226 3.289 1.226 1.276 0 2.687-.256 4.189-.765 1.516-.509 3.123-1.204 4.805-2.09a61.408 61.408 0 0 0 5.105-3.004 127.418 127.418 0 0 0 4.999-3.416c3.708-2.718 7.584-5.811 11.621-9.275l3.035 21.07z" fill="#FFFFFF"/>
8
+ <path d="M625.775 161.267c0 1.738.104 3.423.346 5.057.24 1.633.66 3.093 1.274 4.378.602 1.287 1.413 2.33 2.42 3.131 1.02.796 2.297 1.197 3.843 1.197 2.508 0 4.76-1.084 6.787-3.256 2.027-2.17 3.784-4.782 5.27-7.835a55.388 55.388 0 0 0 3.59-9.465c.915-3.256 1.5-5.972 1.771-8.143l7.538-32.86c-2.763 0-5.45.688-8.078 2.054-2.628 1.371-5.107 3.223-7.433 5.563-2.327 2.338-4.461 5.01-6.412 8.014-1.967 3.008-3.889 6.717-5.766 11.124-1.891 4.41-3.213 8.284-3.994 11.623-.78 3.34-1.156 6.482-1.156 9.418zm86.714 7.92c-1.547 2.179-3.62 4.735-6.216 7.666-2.598 2.93-5.511 5.725-8.74 8.381a54.956 54.956 0 0 1-10.42 6.748c-3.709 1.84-7.418 2.758-11.111 2.758-4.475 0-8.214-1.416-11.202-4.253-2.988-2.835-5.57-6.951-7.75-12.357-1.634 1.868-3.632 3.77-6.005 5.702a54.523 54.523 0 0 1-7.792 5.255 50.806 50.806 0 0 1-8.814 3.85c-3.063 1.002-6.126 1.5-9.174 1.5-3.244 0-6.382-.664-9.445-1.99-3.08-1.325-5.781-3.226-8.138-5.708-2.373-2.484-4.25-5.508-5.661-9.077-1.427-3.57-2.132-7.598-2.132-12.086 0-5.033.72-10.204 2.132-15.51 1.426-5.304 3.634-11.042 6.62-17.224 2.973-6.178 6.188-11.515 9.596-16.015 3.439-4.496 7.178-8.427 11.247-11.783 4.07-3.358 8.349-6.027 12.868-8.009 4.505-1.98 9.083-2.971 13.77-2.971 1.56 0 2.776.308 3.663.917a9.43 9.43 0 0 1 2.192 2.095c.57.784 1.126 1.552 1.667 2.3a4.674 4.674 0 0 0 2.04 1.634 9.3 9.3 0 0 0 2.495.664c.839.1 1.711.153 2.582.153.751 0 1.517-.017 2.298-.053.78-.033 1.531-.048 2.282-.048 1.021 0 1.965.1 2.853.303.87.206 1.652.646 2.327 1.33.676.684 1.201 1.633 1.577 2.858.36 1.225.555 2.895.555 5.006 0 3.223-.345 6.796-1.02 10.723a296.911 296.911 0 0 1-2.313 12.07c-.872 4.12-1.862 8.813-2.973 14.09-1.111 5.271-1.668 9.715-1.668 13.33 0 3.089.287 5.503.857 7.24.586 1.744 1.8 2.613 3.694 2.613 1.411 0 2.898-.351 4.443-1.05a27.945 27.945 0 0 0 4.701-2.755 53.642 53.642 0 0 0 4.76-3.86 70.739 70.739 0 0 0 4.49-4.461c3.302-3.605 6.637-7.682 10.015-12.223l4.85 22.247z" fill="#FFFFFF"/>
9
+ <path d="M765.867 172.704c-2.43 2.224-5.449 4.598-9.053 7.13a96.388 96.388 0 0 1-11.667 6.97 88.86 88.86 0 0 1-12.793 5.307c-4.34 1.416-8.47 2.123-12.372 2.123-3.514 0-6.457-.49-8.86-1.464-2.387-.977-4.324-2.34-5.81-4.094-1.472-1.751-2.538-3.895-3.169-6.418-.645-2.53-.976-5.308-.976-8.341 0-4.245.48-9.198 1.427-14.86 1.937-11.708 3.183-18.282 3.739-19.73.916-2.878 12.763-65.43 15.51-75.305 2.568-8.05 4.145-13.285 4.745-15.715.33-1.702 1.247-3.235 2.778-4.602a18.457 18.457 0 0 1 4.715-3.012 25.63 25.63 0 0 1 5.466-1.739c1.877-.375 3.588-.561 5.12-.561 2.778 0 4.655.52 5.66 1.569.992 1.044 1.487 2.441 1.487 4.192 0 1.484-.345 3.578-1.05 6.284-.691 2.709-1.472 5.793-2.358 9.254-.888 3.466-2.192 7.918-3.936 13.36-1.74 5.44-12.926 66.26-13.557 70.097a136.637 136.637 0 0 1-2.403 11.446c-.976 3.789-1.456 7.233-1.456 10.33 0 3.032.33 5.438 1.006 7.225.674 1.784 2.057 2.677 4.144 2.677 2.433 0 5.12-.84 8.094-2.527 2.958-1.682 5.96-3.724 8.994-6.117a202.022 202.022 0 0 0 8.889-7.428 276.486 276.486 0 0 1 7.686-6.57v20.519z" fill="#FFFFFF"/>
10
+ <path d="M809.167 146.295c-.272 2.171-.86 4.881-1.772 8.136a56.238 56.238 0 0 1-3.591 9.457c-1.482 3.053-3.238 5.66-5.26 7.827-2.027 2.17-4.284 3.258-6.781 3.258-1.548 0-2.834-.404-3.843-1.199-1.013-.799-1.821-1.837-2.426-3.126-.61-1.285-1.03-2.744-1.269-4.37a35.652 35.652 0 0 1-.354-5.055c0-2.941.387-6.08 1.162-9.416.775-3.337 2.105-7.205 3.99-11.616 1.884-4.404 3.803-8.107 5.76-11.114 1.953-3.003 4.09-5.672 6.41-8.008 2.327-2.335 4.803-4.189 7.426-5.56 2.628-1.368 5.318-2.052 8.081-2.052l-7.533 32.838zm64.903 14.042c.123-3.51-1.295-7.014-4.783-8.534-4.276-1.866-7.707.432-10.245 3.616a59.476 59.476 0 0 1-5.231 5.75c-4.102 3.955-10.434 10.064-16.514 10.064-1.886 0-3.114-.87-3.686-2.608-.574-1.738-.862-4.152-.862-7.237 0-3.609.561-8.053 1.668-13.322l2.974-14.079c.865-4.12 1.64-8.14 2.311-12.061.672-3.921 1.014-7.493 1.014-10.714 0-2.109-.185-3.777-.56-5-.371-1.228-.89-2.176-1.566-2.86-.679-.68-1.454-1.124-2.335-1.33a12.727 12.727 0 0 0-2.847-.305c-.745 0-1.508.02-2.285.054-.78.033-1.541.05-2.287.05-.877 0-1.747-.05-2.59-.153a9.082 9.082 0 0 1-2.488-.663c-.816-.338-1.492-.882-2.032-1.632a372 372 0 0 0-1.68-2.298c-.572-.783-1.302-1.479-2.184-2.093-.876-.613-2.1-.918-3.657-.918-4.676 0-9.265.988-13.766 2.97-4.506 1.981-8.79 4.646-12.857 8-4.066 3.356-7.806 7.282-11.228 11.776-3.42 4.498-6.625 9.832-9.602 16.007-2.978 6.175-5.182 11.913-6.603 17.21-1.426 5.302-2.135 10.467-2.135 15.5 0 4.486.709 8.51 2.122 12.074 1.413 3.567 3.296 6.59 5.656 9.07 2.356 2.48 5.066 4.383 8.131 5.706 3.065 1.326 6.212 1.99 9.446 1.99 3.051 0 6.108-.5 9.161-1.5a50.753 50.753 0 0 0 8.811-3.847c2.812-1.57 5.412-3.316 7.789-5.253 2.372-1.931 4.378-3.83 6.006-5.696 2.17 5.4 4.749 9.52 7.74 12.349 2.982 2.834 6.713 4.247 11.188 4.247 3.703 0 7.406-.919 11.113-2.756a54.844 54.844 0 0 0 10.401-6.739c3.233-2.657 6.146-5.45 8.74-8.378 3.387-3.827 7.18-7.736 8.993-12.613a12.37 12.37 0 0 0 .759-3.844zM751.618 85.583c.527-.25 1.428-.338 2.689-.267 1.261.075 2.718.096 4.37.069 1.651-.03 3.436-.063 5.358-.107 1.909-.04 3.77-.072 5.573-.097 1.801-.021 3.483-.036 5.045-.05 1.561-.009 2.851-.004 3.874.01 1.2.014 2.102.723 2.717 2.125.601 1.403.961 3.196 1.082 5.377.118 2.524-.376 4.613-1.502 6.259-1.111 1.65-2.387 2.507-3.829 2.58l-34.535 1.732-29.956-1.75c-1.832-.21-3.243-.421-4.25-.636a121.865 121.865 0 0 0-3.2-.629 78.107 78.107 0 0 0-4.292-.634c-1.742-.214-4.25-.467-7.523-.753-1.456-.154-2.597-.53-3.408-1.131-.811-.6-1.427-1.323-1.832-2.171a8.271 8.271 0 0 1-.766-2.678 36.448 36.448 0 0 1-.21-2.422c-.06-1.066.495-1.91 1.637-2.528 1.14-.622 2.627-1.116 4.443-1.49 1.832-.372 3.83-.63 6.037-.777 2.191-.143 4.295-.229 6.32-.265 2.014-.033 3.83-.073 5.422-.121 1.592-.044 2.688-.149 3.289-.316l37.447.67z" fill="#FFFFFF"/>
11
+ </g>
12
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg width="1028" height="324" viewBox="0 0 1028 324" xmlns="http://www.w3.org/2000/svg">
2
+ <g transform="translate(76.041 42)" fill="none" fill-rule="evenodd">
3
+ <g fill="#E04E39">
4
+ <path d="M507.552 137.229s-12.56 9.744-23.616 8.656c-11.056-1.088-7.584-25.792-7.584-25.792s2.384-22.656-4.128-24.56c-6.496-1.888-14.512 5.904-14.512 5.904s-9.968 11.056-14.736 25.152l-1.312.432s1.52-24.72-.208-30.352c-1.296-2.816-13.216-2.592-15.168 2.384-1.952 4.992-11.488 39.664-12.144 54.192 0 0-18.64 15.824-34.88 18.416-16.256 2.608-20.16-7.584-20.16-7.584s44.208-12.352 42.688-47.68c-1.504-35.328-35.648-22.256-39.504-19.36-3.744 2.816-23.696 14.848-29.52 48.176-.192 1.12-.544 6.08-.544 6.08s-17.12 11.472-26.656 14.512c0 0 26.656-44.864-5.84-65.232-9.14-5.502-17.106-.44-21.845 4.208-2.91 2.854 39.397-43.424 29.637-84.832C302.88.237 293.024-1.875 283.984 1.325c-13.728 5.408-18.928 13.424-18.928 13.424s-17.776 25.792-21.904 64.16c-4.112 38.352-10.176 84.736-10.176 84.736s-8.464 8.24-16.256 8.672c-7.808.416-4.336-23.2-4.336-23.2s6.064-35.968 5.648-42.048c-.448-6.064-.88-9.312-8.032-11.472-7.152-2.176-14.96 6.928-14.96 6.928s-20.576 31.2-22.304 35.968l-1.104 1.968-1.072-1.312s14.512-42.48.656-43.12c-13.872-.656-22.976 15.168-22.976 15.168s-15.824 26.448-16.48 29.472l-1.072-1.296s6.496-30.768 5.2-38.368c-1.312-7.584-8.448-6.064-8.448-6.064s-9.104-1.088-11.488 4.768c-2.384 5.856-11.056 44.64-12.144 56.992 0 0-22.752 16.256-37.712 16.464-14.944.224-13.424-9.472-13.424-9.472s54.832-18.768 39.872-55.824c-6.72-9.536-14.512-12.528-25.568-12.32-11.056.224-24.768 6.96-33.648 26.896-4.256 9.504-5.792 18.544-6.672 25.36 0 0-9.584 1.968-14.784-2.368-5.216-4.336-7.888 0-7.888 0s-8.928 11.392-.048 14.848c8.896 3.472 22.752 5.088 22.752 5.088 1.28 6.064 4.976 16.384 15.808 24.592 16.256 12.352 47.44-1.136 47.44-1.136l12.784-7.168s.432 11.728 9.76 13.44c9.312 1.712 13.216-.032 29.472-39.472 9.536-20.16 10.192-19.072 10.192-19.072 1.072-.224-6.288 38.352-3.472 48.752 2.816 10.416 15.168 9.328 15.168 9.328s6.72 1.296 12.144-17.776c5.408-19.072 15.824-40.096 15.824-40.096 1.28 0-3.264 39.44 3.664 52.016 6.944 12.576 24.928 4.224 24.928 4.224s12.576-6.336 14.528-8.288c0 0 14.912 12.704 35.952 10.4 47.04-9.264 63.776-21.776 63.776-21.776s8.08 20.48 33.12 22.384c28.592 2.16 44.208-15.824 44.208-15.824s-.224 11.696 9.744 15.824c9.984 4.112 16.688-19.04 16.688-19.04l16.688-45.984c1.52 0 2.384 29.904 18.864 34.672 16.464 4.768 37.92-11.168 37.92-11.168s5.2-2.864 4.336-11.536c-.88-8.672-8.672-5.44-8.672-5.44zm-434.08-21.696c5.84 5.632 3.68 17.76-7.376 25.344-11.04 7.6-16.032 6.08-16.032 6.08.656-25.792 17.568-37.072 23.408-31.424zM289.104 26.46c3.68 19.504-32.288 77.584-32.288 77.584.432-13.008 13.216-56.992 13.216-56.992s15.376-40.096 19.072-20.592zm-35.552 148.016s-2.816-9.536 5.2-36.192c8.032-26.656 26.88-16.256 26.88-16.256s13.008 9.968 2.816 36.624c-10.176 26.656-34.896 15.824-34.896 15.824zm109.664-52.224c8.88-16.256 15.824-7.376 15.824-7.376s7.584 8.24-1.088 20.592c-8.672 12.352-21.232 11.488-21.232 11.488s-2.384-8.464 6.496-24.704z"/>
5
+ <path d="M451.918 188.027v-3.112h1.974c.273 0 .547.028.835.057.288.043.562.115.793.216.245.101.432.245.576.433.159.187.23.446.23.763 0 .72-.216 1.182-.648 1.369-.432.187-.994.274-1.671.274h-2.09zm-2.349-4.942v11.843h2.349v-5.057h1.47l2.881 5.057h2.464l-3.17-5.172c.432-.044.836-.13 1.225-.26.374-.13.706-.317.98-.562.288-.245.504-.562.662-.95.173-.39.245-.85.245-1.398 0-1.282-.403-2.19-1.196-2.709-.807-.533-1.96-.792-3.443-.792h-4.467zm-3.76 5.936c0-1.21.201-2.32.62-3.328a8.09 8.09 0 0 1 1.7-2.608 7.71 7.71 0 0 1 2.52-1.73 7.864 7.864 0 0 1 3.127-.619c1.095 0 2.133.202 3.098.62.98.418 1.816.994 2.536 1.729.72.735 1.282 1.599 1.714 2.608.418 1.008.634 2.118.634 3.328s-.216 2.32-.634 3.342c-.432 1.009-.994 1.902-1.714 2.637a7.594 7.594 0 0 1-2.536 1.744 7.725 7.725 0 0 1-3.098.619 7.864 7.864 0 0 1-3.126-.62 7.535 7.535 0 0 1-2.522-1.743c-.72-.735-1.282-1.628-1.7-2.637-.418-1.022-.62-2.132-.62-3.342zm-2.896 0c0 1.628.302 3.083.893 4.38.605 1.311 1.398 2.42 2.392 3.343a10.57 10.57 0 0 0 3.472 2.117c1.311.49 2.68.735 4.106.735 1.441 0 2.81-.245 4.121-.735a10.57 10.57 0 0 0 3.472-2.117c.995-.923 1.787-2.032 2.392-3.343.59-1.297.879-2.752.879-4.38 0-1.6-.288-3.055-.879-4.351-.605-1.312-1.397-2.42-2.392-3.329a10.57 10.57 0 0 0-3.472-2.118 11.356 11.356 0 0 0-4.12-.749c-1.427 0-2.796.245-4.107.75a10.57 10.57 0 0 0-3.472 2.117c-.994.908-1.787 2.017-2.392 3.329-.59 1.296-.893 2.752-.893 4.35z"/>
6
+ </g>
7
+ <path d="M589.663 44.545c.42-4.718.63-8.462.63-11.226 0-3.638-.33-6.168-.975-7.583-.646-1.416-1.592-2.124-2.823-2.124-2.207 0-4.19 1.365-5.976 4.093-1.772 2.73-3.198 6.25-4.295 10.556-1.08 4.31-2.252 8.992-3.528 14.05-1.263 5.061-2.192 10.016-2.793 14.863-.57 4.85-1.051 9.221-1.397 13.115-.36 3.889-.615 6.654-.75 8.296-.3 3.348-.54 6.575-.721 9.68-.18 3.108-.315 5.943-.39 8.503a225.54 225.54 0 0 0-.107 6.71v5.432A515.125 515.125 0 0 0 576.9 92.079a452.907 452.907 0 0 0 3.903-11.879c1.277-4.125 2.554-8.216 3.815-12.274a145.287 145.287 0 0 0 3.213-12.052c.87-3.98 1.487-7.756 1.832-11.33zm-47.689 68.962a42.47 42.47 0 0 0-11.877 8.613c-3.468 3.566-6.366 8.267-8.694 14.114-2.312 5.843-4.084 10.873-5.3 15.086-1.216 4.21-1.817 8.014-1.817 11.414 0 1.055.15 2.106.449 3.162.302 1.055.857 2.004 1.668 2.85.81.84 1.952 1.528 3.439 2.054 1.471.53 3.393.793 5.766.793 1.2 0 2.402-.268 3.588-.81a16.08 16.08 0 0 0 3.379-2.102 24.957 24.957 0 0 0 3.093-2.96 31.904 31.904 0 0 0 2.673-3.453c1.892-2.75 3.618-5.854 5.165-9.318-.197-.95-.376-2.463-.51-4.538-.136-2.07-.24-5.231-.301-9.476-.075-4.247-.152-7.732-.21-10.448a519.42 519.42 0 0 1-.15-7.44c-.045-2.243-.09-4.075-.152-5.503-.074-1.427-.149-2.107-.209-2.038zm70.062 59.695c-4.775 3.934-9.505 7.443-14.144 10.52a127.062 127.062 0 0 1-6.173 3.812 76.437 76.437 0 0 1-6.367 3.328 48.4 48.4 0 0 1-6.094 2.362c-1.952.606-3.77.91-5.406.91-.976 0-2.404-.215-4.296-.643-1.892-.434-3.962-1.306-6.2-2.632-2.252-1.323-4.49-3.239-6.742-5.742-2.237-2.508-4.174-5.835-5.842-9.982a100.616 100.616 0 0 1-7.957 7.35 61.432 61.432 0 0 1-8.724 6.06c-3.003 1.72-6.051 3.098-9.114 4.132-3.08 1.04-6.171 1.557-9.28 1.557-4.384 0-8.168-.91-11.381-2.732a24.331 24.331 0 0 1-7.975-7.274c-2.13-3.025-3.709-6.458-4.758-10.299a45.513 45.513 0 0 1-1.562-11.912c0-4.374.556-8.802 1.667-13.285a62.3 62.3 0 0 1 4.85-13.028 306.475 306.475 0 0 1 7.072-13.185c2.598-4.58 6.036-8.752 10.316-12.516 4.279-3.762 8.678-6.6 13.183-8.516 4.518-1.913 9.34-3.11 14.46-3.59.209-8.754 1.141-16.469 2.793-23.14 1.651-6.668 3.437-13.846 5.345-21.532 1.907-7.683 4.37-14.76 7.388-21.227 3.018-6.47 6.321-12.062 9.91-16.778 3.589-4.717 7.416-8.406 11.487-11.067 4.069-2.66 8.273-3.992 12.613-3.992 3.153 0 5.854.827 8.078 2.48 2.222 1.653 4.04 3.847 5.42 6.583 1.365 2.734 2.358 5.907 2.974 9.517.6 3.612.915 7.342.915 11.19 0 2.402-.03 4.872-.075 7.41-.196 9.674-1.683 18.678-4.474 27.013-2.793 8.334-5.556 16.573-8.274 24.716-2.732 8.144-6.036 16.201-9.88 24.171-5.886 12.197-9.64 20.478-11.246 24.837-.346.954-.691 2.114-1.051 3.478a84.878 84.878 0 0 0-.991 4.443 70.896 70.896 0 0 0-.796 4.908 38.845 38.845 0 0 0-.316 4.852c0 1.977.106 3.853.346 5.625.225 1.77.6 3.356 1.126 4.75.525 1.399 1.23 2.507 2.132 3.323.871.817 1.967 1.226 3.289 1.226 1.276 0 2.687-.256 4.189-.765 1.516-.509 3.123-1.204 4.805-2.09a61.408 61.408 0 0 0 5.105-3.004 127.418 127.418 0 0 0 4.999-3.416c3.708-2.718 7.584-5.811 11.621-9.275l3.035 21.07z" fill="#612116"/>
8
+ <path d="M625.775 161.267c0 1.738.104 3.423.346 5.057.24 1.633.66 3.093 1.274 4.378.602 1.287 1.413 2.33 2.42 3.131 1.02.796 2.297 1.197 3.843 1.197 2.508 0 4.76-1.084 6.787-3.256 2.027-2.17 3.784-4.782 5.27-7.835a55.388 55.388 0 0 0 3.59-9.465c.915-3.256 1.5-5.972 1.771-8.143l7.538-32.86c-2.763 0-5.45.688-8.078 2.054-2.628 1.371-5.107 3.223-7.433 5.563-2.327 2.338-4.461 5.01-6.412 8.014-1.967 3.008-3.889 6.717-5.766 11.124-1.891 4.41-3.213 8.284-3.994 11.623-.78 3.34-1.156 6.482-1.156 9.418zm86.714 7.92c-1.547 2.179-3.62 4.735-6.216 7.666-2.598 2.93-5.511 5.725-8.74 8.381a54.956 54.956 0 0 1-10.42 6.748c-3.709 1.84-7.418 2.758-11.111 2.758-4.475 0-8.214-1.416-11.202-4.253-2.988-2.835-5.57-6.951-7.75-12.357-1.634 1.868-3.632 3.77-6.005 5.702a54.523 54.523 0 0 1-7.792 5.255 50.806 50.806 0 0 1-8.814 3.85c-3.063 1.002-6.126 1.5-9.174 1.5-3.244 0-6.382-.664-9.445-1.99-3.08-1.325-5.781-3.226-8.138-5.708-2.373-2.484-4.25-5.508-5.661-9.077-1.427-3.57-2.132-7.598-2.132-12.086 0-5.033.72-10.204 2.132-15.51 1.426-5.304 3.634-11.042 6.62-17.224 2.973-6.178 6.188-11.515 9.596-16.015 3.439-4.496 7.178-8.427 11.247-11.783 4.07-3.358 8.349-6.027 12.868-8.009 4.505-1.98 9.083-2.971 13.77-2.971 1.56 0 2.776.308 3.663.917a9.43 9.43 0 0 1 2.192 2.095c.57.784 1.126 1.552 1.667 2.3a4.674 4.674 0 0 0 2.04 1.634 9.3 9.3 0 0 0 2.495.664c.839.1 1.711.153 2.582.153.751 0 1.517-.017 2.298-.053.78-.033 1.531-.048 2.282-.048 1.021 0 1.965.1 2.853.303.87.206 1.652.646 2.327 1.33.676.684 1.201 1.633 1.577 2.858.36 1.225.555 2.895.555 5.006 0 3.223-.345 6.796-1.02 10.723a296.911 296.911 0 0 1-2.313 12.07c-.872 4.12-1.862 8.813-2.973 14.09-1.111 5.271-1.668 9.715-1.668 13.33 0 3.089.287 5.503.857 7.24.586 1.744 1.8 2.613 3.694 2.613 1.411 0 2.898-.351 4.443-1.05a27.945 27.945 0 0 0 4.701-2.755 53.642 53.642 0 0 0 4.76-3.86 70.739 70.739 0 0 0 4.49-4.461c3.302-3.605 6.637-7.682 10.015-12.223l4.85 22.247z" fill="#612116"/>
9
+ <path d="M765.867 172.704c-2.43 2.224-5.449 4.598-9.053 7.13a96.388 96.388 0 0 1-11.667 6.97 88.86 88.86 0 0 1-12.793 5.307c-4.34 1.416-8.47 2.123-12.372 2.123-3.514 0-6.457-.49-8.86-1.464-2.387-.977-4.324-2.34-5.81-4.094-1.472-1.751-2.538-3.895-3.169-6.418-.645-2.53-.976-5.308-.976-8.341 0-4.245.48-9.198 1.427-14.86 1.937-11.708 3.183-18.282 3.739-19.73.916-2.878 12.763-65.43 15.51-75.305 2.568-8.05 4.145-13.285 4.745-15.715.33-1.702 1.247-3.235 2.778-4.602a18.457 18.457 0 0 1 4.715-3.012 25.63 25.63 0 0 1 5.466-1.739c1.877-.375 3.588-.561 5.12-.561 2.778 0 4.655.52 5.66 1.569.992 1.044 1.487 2.441 1.487 4.192 0 1.484-.345 3.578-1.05 6.284-.691 2.709-1.472 5.793-2.358 9.254-.888 3.466-2.192 7.918-3.936 13.36-1.74 5.44-12.926 66.26-13.557 70.097a136.637 136.637 0 0 1-2.403 11.446c-.976 3.789-1.456 7.233-1.456 10.33 0 3.032.33 5.438 1.006 7.225.674 1.784 2.057 2.677 4.144 2.677 2.433 0 5.12-.84 8.094-2.527 2.958-1.682 5.96-3.724 8.994-6.117a202.022 202.022 0 0 0 8.889-7.428 276.486 276.486 0 0 1 7.686-6.57v20.519z" fill="#612116"/>
10
+ <path d="M809.167 146.295c-.272 2.171-.86 4.881-1.772 8.136a56.238 56.238 0 0 1-3.591 9.457c-1.482 3.053-3.238 5.66-5.26 7.827-2.027 2.17-4.284 3.258-6.781 3.258-1.548 0-2.834-.404-3.843-1.199-1.013-.799-1.821-1.837-2.426-3.126-.61-1.285-1.03-2.744-1.269-4.37a35.652 35.652 0 0 1-.354-5.055c0-2.941.387-6.08 1.162-9.416.775-3.337 2.105-7.205 3.99-11.616 1.884-4.404 3.803-8.107 5.76-11.114 1.953-3.003 4.09-5.672 6.41-8.008 2.327-2.335 4.803-4.189 7.426-5.56 2.628-1.368 5.318-2.052 8.081-2.052l-7.533 32.838zm64.903 14.042c.123-3.51-1.295-7.014-4.783-8.534-4.276-1.866-7.707.432-10.245 3.616a59.476 59.476 0 0 1-5.231 5.75c-4.102 3.955-10.434 10.064-16.514 10.064-1.886 0-3.114-.87-3.686-2.608-.574-1.738-.862-4.152-.862-7.237 0-3.609.561-8.053 1.668-13.322l2.974-14.079c.865-4.12 1.64-8.14 2.311-12.061.672-3.921 1.014-7.493 1.014-10.714 0-2.109-.185-3.777-.56-5-.371-1.228-.89-2.176-1.566-2.86-.679-.68-1.454-1.124-2.335-1.33a12.727 12.727 0 0 0-2.847-.305c-.745 0-1.508.02-2.285.054-.78.033-1.541.05-2.287.05-.877 0-1.747-.05-2.59-.153a9.082 9.082 0 0 1-2.488-.663c-.816-.338-1.492-.882-2.032-1.632a372 372 0 0 0-1.68-2.298c-.572-.783-1.302-1.479-2.184-2.093-.876-.613-2.1-.918-3.657-.918-4.676 0-9.265.988-13.766 2.97-4.506 1.981-8.79 4.646-12.857 8-4.066 3.356-7.806 7.282-11.228 11.776-3.42 4.498-6.625 9.832-9.602 16.007-2.978 6.175-5.182 11.913-6.603 17.21-1.426 5.302-2.135 10.467-2.135 15.5 0 4.486.709 8.51 2.122 12.074 1.413 3.567 3.296 6.59 5.656 9.07 2.356 2.48 5.066 4.383 8.131 5.706 3.065 1.326 6.212 1.99 9.446 1.99 3.051 0 6.108-.5 9.161-1.5a50.753 50.753 0 0 0 8.811-3.847c2.812-1.57 5.412-3.316 7.789-5.253 2.372-1.931 4.378-3.83 6.006-5.696 2.17 5.4 4.749 9.52 7.74 12.349 2.982 2.834 6.713 4.247 11.188 4.247 3.703 0 7.406-.919 11.113-2.756a54.844 54.844 0 0 0 10.401-6.739c3.233-2.657 6.146-5.45 8.74-8.378 3.387-3.827 7.18-7.736 8.993-12.613a12.37 12.37 0 0 0 .759-3.844zM751.618 85.583c.527-.25 1.428-.338 2.689-.267 1.261.075 2.718.096 4.37.069 1.651-.03 3.436-.063 5.358-.107 1.909-.04 3.77-.072 5.573-.097 1.801-.021 3.483-.036 5.045-.05 1.561-.009 2.851-.004 3.874.01 1.2.014 2.102.723 2.717 2.125.601 1.403.961 3.196 1.082 5.377.118 2.524-.376 4.613-1.502 6.259-1.111 1.65-2.387 2.507-3.829 2.58l-34.535 1.732-29.956-1.75c-1.832-.21-3.243-.421-4.25-.636a121.865 121.865 0 0 0-3.2-.629 78.107 78.107 0 0 0-4.292-.634c-1.742-.214-4.25-.467-7.523-.753-1.456-.154-2.597-.53-3.408-1.131-.811-.6-1.427-1.323-1.832-2.171a8.271 8.271 0 0 1-.766-2.678 36.448 36.448 0 0 1-.21-2.422c-.06-1.066.495-1.91 1.637-2.528 1.14-.622 2.627-1.116 4.443-1.49 1.832-.372 3.83-.63 6.037-.777 2.191-.143 4.295-.229 6.32-.265 2.014-.033 3.83-.073 5.422-.121 1.592-.044 2.688-.149 3.289-.316l37.447.67z" fill="#612116"/>
11
+ </g>
12
+ </svg>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ember-data/tracking",
3
3
  "description": "Tracking Primitives for controlling change notification of Tracked properties when working with EmberData",
4
- "version": "5.4.0-beta.0",
4
+ "version": "5.4.0-beta.10",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "author": "Chris Thoburn <runspired@users.noreply.github.com>",
@@ -13,7 +13,7 @@
13
13
  "homepage": "https://github.com/emberjs/data",
14
14
  "bugs": "https://github.com/emberjs/data/issues",
15
15
  "engines": {
16
- "node": "16.* || >= 18"
16
+ "node": ">= 18.20.3"
17
17
  },
18
18
  "keywords": [
19
19
  "ember-addon"
@@ -22,52 +22,68 @@
22
22
  "extends": "../../package.json"
23
23
  },
24
24
  "dependenciesMeta": {
25
- "@ember-data/private-build-infra": {
25
+ "@warp-drive/build-config": {
26
+ "injected": true
27
+ },
28
+ "@warp-drive/core-types": {
26
29
  "injected": true
27
30
  }
28
31
  },
29
32
  "dependencies": {
30
- "@ember-data/private-build-infra": "5.4.0-beta.0",
31
- "@embroider/macros": "^1.13.1",
32
- "ember-cli-babel": "^8.0.0"
33
+ "@embroider/macros": "^1.16.1",
34
+ "@warp-drive/build-config": "0.0.0-beta.5"
35
+ },
36
+ "peerDependencies": {
37
+ "ember-source": ">= 3.28.12",
38
+ "@warp-drive/core-types": "0.0.0-beta.10"
33
39
  },
34
40
  "files": [
35
- "addon-main.js",
36
- "addon",
41
+ "unstable-preview-types",
42
+ "addon-main.cjs",
43
+ "dist",
37
44
  "README.md",
38
45
  "LICENSE.md",
39
46
  "ember-data-logo-dark.svg",
40
47
  "ember-data-logo-light.svg"
41
48
  ],
49
+ "exports": {
50
+ ".": {
51
+ "default": "./dist/index.js"
52
+ },
53
+ "./*": {
54
+ "default": "./dist/*.js"
55
+ }
56
+ },
57
+ "scripts": {
58
+ "lint": "eslint . --quiet --cache --cache-strategy=content --report-unused-disable-directives",
59
+ "build:pkg": "vite build;",
60
+ "sync-hardlinks": "bun run sync-dependencies-meta-injected"
61
+ },
42
62
  "ember-addon": {
43
- "main": "addon-main.js",
63
+ "main": "addon-main.cjs",
44
64
  "type": "addon",
45
- "version": 1
65
+ "version": 2,
66
+ "externals": [
67
+ "@ember/-internals",
68
+ "@ember/-internals/metal",
69
+ "@glimmer/validator"
70
+ ]
46
71
  },
47
72
  "devDependencies": {
48
- "@babel/cli": "^7.22.15",
49
- "@babel/core": "^7.22.19",
50
- "@babel/plugin-proposal-decorators": "^7.22.15",
51
- "@babel/plugin-transform-class-properties": "^7.22.5",
52
- "@babel/plugin-transform-private-methods": "^7.22.5",
53
- "@babel/plugin-transform-runtime": "^7.22.15",
54
- "@babel/plugin-transform-typescript": "^7.22.15",
55
- "@babel/preset-env": "^7.22.15",
56
- "@babel/preset-typescript": "^7.22.15",
57
- "@babel/runtime": "^7.22.15",
58
- "@embroider/addon-dev": "^4.1.0",
59
- "@rollup/plugin-babel": "^6.0.3",
60
- "@rollup/plugin-node-resolve": "^15.2.1",
61
- "rollup": "^3.29.1",
62
- "tslib": "^2.6.2",
63
- "typescript": "^5.2.2",
64
- "walk-sync": "^3.0.0"
73
+ "@babel/core": "^7.24.5",
74
+ "@babel/plugin-transform-typescript": "^7.24.5",
75
+ "@babel/preset-env": "^7.24.5",
76
+ "@babel/preset-typescript": "^7.24.1",
77
+ "@glimmer/component": "^1.1.2",
78
+ "@glimmer/validator": "^0.92.0",
79
+ "@warp-drive/core-types": "0.0.0-beta.10",
80
+ "@warp-drive/internal-config": "5.4.0-beta.10",
81
+ "ember-source": "~5.8.0",
82
+ "pnpm-sync-dependencies-meta-injected": "0.0.14",
83
+ "typescript": "^5.4.5",
84
+ "vite": "^5.2.11"
65
85
  },
66
86
  "ember": {
67
87
  "edition": "octane"
68
- },
69
- "scripts": {
70
- "build": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js",
71
- "start": "rollup --config --watch"
72
88
  }
73
- }
89
+ }
@@ -0,0 +1,188 @@
1
+ declare module '@ember-data/tracking/-private' {
2
+ /// <reference types="ember-source/types" />
3
+ /// <reference types="ember-source/types" />
4
+ import { tagForProperty } from '@ember/-internals/metal';
5
+ /**
6
+ * This package provides primitives that allow powerful low-level
7
+ * adjustments to change tracking notification behaviors.
8
+ *
9
+ * Typically you want to use these primitives when you want to divorce
10
+ * property accesses on EmberData provided objects from the current
11
+ * tracking context. Typically this sort of thing occurs when serializing
12
+ * tracked data to send in a request: the data itself is often ancillary
13
+ * to the thing which triggered the request in the first place and you
14
+ * would not want to re-trigger the request for any update to the data.
15
+ *
16
+ * @module @ember-data/tracking
17
+ * @main @ember-data/tracking
18
+ */
19
+ type OpaqueFn = (...args: unknown[]) => unknown;
20
+ type Tag = {
21
+ ref: null;
22
+ t: boolean;
23
+ };
24
+ /**
25
+ * If there is a current transaction, ensures that the relevant tag (and any
26
+ * array computed chains symbols, if applicable) will be consumed during the
27
+ * transaction.
28
+ *
29
+ * If there is no current transaction, will consume the tag(s) immediately.
30
+ *
31
+ * @internal
32
+ * @param obj
33
+ */
34
+ export function subscribe(obj: Tag | Signal): void;
35
+ export function addToTransaction(obj: Tag | Signal): void;
36
+ export function addTransactionCB(method: OpaqueFn): void;
37
+ /**
38
+ * Run `method` without subscribing to any tracked properties
39
+ * controlled by EmberData.
40
+ *
41
+ * This should rarely be used except by libraries that really
42
+ * know what they are doing. It is most useful for wrapping
43
+ * certain kinds of fetch/query logic from within a `Resource`
44
+ * `hook` or other similar pattern.
45
+ *
46
+ * @function untracked
47
+ * @public
48
+ * @static
49
+ * @for @ember-data/tracking
50
+ * @param method
51
+ * @return result of invoking method
52
+ */
53
+ export function untracked<T extends OpaqueFn>(method: T): ReturnType<T>;
54
+ /**
55
+ * Run the method, subscribing to any tracked properties
56
+ * managed by EmberData that were accessed or written during
57
+ * the method's execution as per-normal but while allowing
58
+ * interleaving of reads and writes.
59
+ *
60
+ * This is useful when for instance you want to perform
61
+ * a mutation based on existing state that must be read first.
62
+ *
63
+ * @function transact
64
+ * @public
65
+ * @static
66
+ * @for @ember-data/tracking
67
+ * @param method
68
+ * @return result of invoking method
69
+ */
70
+ export function transact<T extends OpaqueFn>(method: T): ReturnType<T>;
71
+ /**
72
+ * A helpful utility for creating a new function that
73
+ * always runs in a transaction. E.G. this "memoizes"
74
+ * calling `transact(fn)`, currying args as necessary.
75
+ *
76
+ * @method memoTransact
77
+ * @public
78
+ * @static
79
+ * @for @ember-data/tracking
80
+ * @param method
81
+ * @return a function that will invoke method in a transaction with any provided args and return its result
82
+ */
83
+ export function memoTransact<T extends OpaqueFn>(method: T): (...args: unknown[]) => ReturnType<T>;
84
+ export const Signals: "___(unique) Symbol(Signals)";
85
+ /**
86
+ * use to add a signal property to the prototype of something.
87
+ *
88
+ * First arg is the thing to define on
89
+ * Second arg is the property name
90
+ * Third agg is the initial value of the property if any.
91
+ *
92
+ * for instance
93
+ *
94
+ * ```ts
95
+ * class Model {}
96
+ * defineSignal(Model.prototype, 'isLoading', false);
97
+ * ```
98
+ *
99
+ * This is sort of like using a stage-3 decorator but works today
100
+ * while we are still on legacy decorators.
101
+ *
102
+ * e.g. it is equivalent to
103
+ *
104
+ * ```ts
105
+ * class Model {
106
+ * @signal accessor isLoading = false;
107
+ * }
108
+ * ```
109
+ *
110
+ * @internal
111
+ */
112
+ export function defineSignal<T extends object>(obj: T, key: string, v?: unknown): void;
113
+ export interface Signal {
114
+ /**
115
+ * Key on the associated object
116
+ * @internal
117
+ */
118
+ key: string;
119
+ _debug_base?: string;
120
+ /**
121
+ * Whether this signal is part of an active transaction.
122
+ * @internal
123
+ */
124
+ t: boolean;
125
+ /**
126
+ * Whether to "bust" the lastValue cache
127
+ * @internal
128
+ */
129
+ shouldReset: boolean;
130
+ /**
131
+ * The framework specific "signal" e.g. glimmer "tracked"
132
+ * or starbeam "cell" to consume/invalidate when appropriate.
133
+ *
134
+ * @internal
135
+ */
136
+ tag: ReturnType<typeof tagForProperty>;
137
+ /**
138
+ * In classic ember, arrays must entangle a `[]` symbol
139
+ * in addition to any other tag in order for array chains to work.
140
+ *
141
+ * Note, this symbol MUST be the one that ember itself generates
142
+ *
143
+ * @internal
144
+ */
145
+ '[]': ReturnType<typeof tagForProperty> | null;
146
+ /**
147
+ * In classic ember, arrays must entangle a `@length` symbol
148
+ * in addition to any other tag in order for array chains to work.
149
+ *
150
+ * Note, this symbol MUST be the one that ember itself generates
151
+ *
152
+ * @internal
153
+ */
154
+ '@length': ReturnType<typeof tagForProperty> | null;
155
+ /**
156
+ * The lastValue computed for this signal when
157
+ * a signal is also used for storage.
158
+ * @internal
159
+ */
160
+ lastValue: unknown;
161
+ }
162
+ export function createArrayTags<T extends object>(obj: T, signal: Signal): void;
163
+ /**
164
+ * Create a signal for the key/object pairing.
165
+ *
166
+ * @internal
167
+ * @param obj Object we're creating the signal on
168
+ * @param key Key to create the signal for
169
+ * @return the signal
170
+ */
171
+ export function createSignal<T extends object>(obj: T, key: string): Signal;
172
+ /**
173
+ * Create a signal for the key/object pairing and subscribes to the signal.
174
+ *
175
+ * Use when you need to ensure a signal exists and is subscribed to.
176
+ *
177
+ * @internal
178
+ * @param signals Map of signals
179
+ * @param obj Object we're creating the signal on
180
+ * @param key Key to create the signal for
181
+ * @return the signal
182
+ */
183
+ export function entangleSignal<T extends object>(signals: Map<string, Signal>, obj: T, key: string): Signal;
184
+ export function getSignal<T extends object>(obj: T, key: string, initialState: boolean): Signal;
185
+ export function peekSignal<T extends object>(obj: T, key: string): Signal | undefined;
186
+ export {};
187
+ }
188
+ //# sourceMappingURL=-private.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"-private.d.ts","sourceRoot":"","sources":["../src/-private.ts"],"names":[],"mappings":";;AAAA,OAAO,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AAC;IAErB;;;OAGG;IACH,CAAC,EAAE,OAAO,CAAC;IAEX;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,GAAG,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAEvC;;;;;;;OAOG;IACH,IAAI,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,GAAG,IAAI,CAAC;IAC/C;;;;;;;OAOG;IACH,SAAS,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,GAAG,IAAI,CAAC;IAEpD;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,QAKvE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CA6B1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ1G;AAMD,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,CAe9F;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKpF"}
@@ -0,0 +1,11 @@
1
+ /// <reference path="./-private.d.ts" />
2
+ declare module '@ember-data/tracking' {
3
+ /// <reference types="ember-source/types" />
4
+ /// <reference types="ember-source/types" />
5
+ import { createCache, getValue } from '@glimmer/tracking/primitives/cache';
6
+ export { transact, memoTransact, untracked } from '@ember-data/tracking/-private';
7
+ export { dependentKeyCompat as compat } from '@ember/object/compat';
8
+ export function cached<T extends object, K extends keyof T & string>(target: T, key: K, descriptor: PropertyDescriptor): void;
9
+ export { createCache, getValue };
10
+ }
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAI3E,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI/D,OAAO,EAAE,kBAAkB,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEpE,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EACjE,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,CAAC,EACN,UAAU,EAAE,kBAAkB,QA6B/B;AAED,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC"}
package/addon/-private.js DELETED
@@ -1,199 +0,0 @@
1
- import { macroCondition, getOwnConfig } from '@embroider/macros';
2
-
3
- /**
4
- * This package provides primitives that allow powerful low-level
5
- * adjustments to change tracking notification behaviors.
6
- *
7
- * Typically you want to use these primitives when you want to divorce
8
- * property accesses on EmberData provided objects from the current
9
- * tracking context. Typically this sort of thing occurs when serializing
10
- * tracked data to send in a request: the data itself is often ancillary
11
- * to the thing which triggered the request in the first place and you
12
- * would not want to re-trigger the request for any update to the data.
13
- *
14
- * @module @ember-data/tracking
15
- * @main @ember-data/tracking
16
- */
17
- let TRANSACTION = null;
18
- function createTransaction() {
19
- let transaction = {
20
- cbs: new Set(),
21
- props: new Set(),
22
- sub: new Set(),
23
- parent: null
24
- };
25
- if (TRANSACTION) {
26
- transaction.parent = TRANSACTION;
27
- }
28
- TRANSACTION = transaction;
29
- }
30
- function subscribe(obj) {
31
- if (TRANSACTION) {
32
- TRANSACTION.sub.add(obj);
33
- } else {
34
- obj.ref;
35
- }
36
- }
37
- function updateRef(obj) {
38
- if (macroCondition(getOwnConfig().env.DEBUG)) {
39
- try {
40
- obj.ref = null;
41
- } catch (e) {
42
- if (e instanceof Error) {
43
- if (e.message.includes('You attempted to update `ref` on `Tag`')) {
44
- e.message = e.message.replace('You attempted to update `ref` on `Tag`',
45
- // @ts-expect-error
46
- `You attempted to update <${obj._debug_base}>.${obj._debug_prop}` // eslint-disable-line
47
- );
48
-
49
- e.stack = e.stack?.replace('You attempted to update `ref` on `Tag`',
50
- // @ts-expect-error
51
- `You attempted to update <${obj._debug_base}>.${obj._debug_prop}` // eslint-disable-line
52
- );
53
-
54
- const lines = e.stack?.split(`\n`);
55
- const finalLines = [];
56
- let lastFile = null;
57
- lines?.forEach(line => {
58
- if (line.trim().startsWith('at ')) {
59
- // get the last string in the line which contains the code source location
60
- const location = line.split(' ').at(-1);
61
- // remove the line and char offset info
62
-
63
- if (location.includes(':')) {
64
- const parts = location.split(':');
65
- parts.pop();
66
- parts.pop();
67
- const file = parts.join(':');
68
- if (file !== lastFile) {
69
- lastFile = file;
70
- finalLines.push('');
71
- }
72
- }
73
- finalLines.push(line);
74
- }
75
- });
76
- const splitstr = '`ref` was first used:';
77
- const parts = e.message.split(splitstr);
78
- parts.splice(1, 0, `Original Stack\n=============\n${finalLines.join(`\n`)}\n\n${splitstr}`);
79
- e.message = parts.join('');
80
- }
81
- }
82
- throw e;
83
- }
84
- } else {
85
- obj.ref = null;
86
- }
87
- }
88
- function flushTransaction() {
89
- let transaction = TRANSACTION;
90
- TRANSACTION = transaction.parent;
91
- transaction.cbs.forEach(cb => {
92
- cb();
93
- });
94
- transaction.props.forEach(obj => {
95
- // mark this mutation as part of a transaction
96
- obj.t = true;
97
- updateRef(obj);
98
- });
99
- transaction.sub.forEach(obj => {
100
- obj.ref;
101
- });
102
- }
103
- async function untrack() {
104
- let transaction = TRANSACTION;
105
- TRANSACTION = transaction.parent;
106
-
107
- // defer writes
108
- await Promise.resolve();
109
- transaction.cbs.forEach(cb => {
110
- cb();
111
- });
112
- transaction.props.forEach(obj => {
113
- // mark this mutation as part of a transaction
114
- obj.t = true;
115
- updateRef(obj);
116
- });
117
- }
118
- function addToTransaction(obj) {
119
- if (TRANSACTION) {
120
- TRANSACTION.props.add(obj);
121
- } else {
122
- updateRef(obj);
123
- }
124
- }
125
- function addTransactionCB(method) {
126
- if (TRANSACTION) {
127
- TRANSACTION.cbs.add(method);
128
- } else {
129
- method();
130
- }
131
- }
132
-
133
- /**
134
- * Run `method` without subscribing to any tracked properties
135
- * controlled by EmberData.
136
- *
137
- * This should rarely be used except by libraries that really
138
- * know what they are doing. It is most useful for wrapping
139
- * certain kinds of fetch/query logic from within a `Resource`
140
- * `hook` or other similar pattern.
141
- *
142
- * @function untracked
143
- * @public
144
- * @static
145
- * @for @ember-data/tracking
146
- * @param method
147
- * @returns result of invoking method
148
- */
149
- function untracked(method) {
150
- createTransaction();
151
- const ret = method();
152
- void untrack();
153
- return ret;
154
- }
155
-
156
- /**
157
- * Run the method, subscribing to any tracked properties
158
- * managed by EmberData that were accessed or written during
159
- * the method's execution as per-normal but while allowing
160
- * interleaving of reads and writes.
161
- *
162
- * This is useful when for instance you want to perform
163
- * a mutation based on existing state that must be read first.
164
- *
165
- * @function transact
166
- * @public
167
- * @static
168
- * @for @ember-data/tracking
169
- * @param method
170
- * @returns result of invoking method
171
- */
172
- function transact(method) {
173
- createTransaction();
174
- const ret = method();
175
- flushTransaction();
176
- return ret;
177
- }
178
-
179
- /**
180
- * A helpful utility for creating a new function that
181
- * always runs in a transaction. E.G. this "memoizes"
182
- * calling `transact(fn)`, currying args as necessary.
183
- *
184
- * @method memoTransact
185
- * @public
186
- * @static
187
- * @for @ember-data/tracking
188
- * @param method
189
- * @returns a function that will invoke method in a transaction with any provided args and return its result
190
- */
191
- function memoTransact(method) {
192
- return function (...args) {
193
- createTransaction();
194
- const ret = method(...args);
195
- flushTransaction();
196
- return ret;
197
- };
198
- }
199
- export { addToTransaction, addTransactionCB, memoTransact, subscribe, transact, untracked };
@@ -1 +0,0 @@
1
- {"version":3,"file":"-private.js","sources":["../src/-private.ts"],"sourcesContent":["import { DEBUG } from '@ember-data/env';\n\n/**\n * This package provides primitives that allow powerful low-level\n * adjustments to change tracking notification behaviors.\n *\n * Typically you want to use these primitives when you want to divorce\n * property accesses on EmberData provided objects from the current\n * tracking context. Typically this sort of thing occurs when serializing\n * tracked data to send in a request: the data itself is often ancillary\n * to the thing which triggered the request in the first place and you\n * would not want to re-trigger the request for any update to the data.\n *\n * @module @ember-data/tracking\n * @main @ember-data/tracking\n */\ntype OpaqueFn = (...args: unknown[]) => unknown;\ntype Tag = { ref: null; t: boolean };\ntype Transaction = {\n cbs: Set<OpaqueFn>;\n props: Set<Tag>;\n sub: Set<Tag>;\n parent: Transaction | null;\n};\nlet TRANSACTION: Transaction | null = null;\n\nfunction createTransaction() {\n let transaction: Transaction = {\n cbs: new Set(),\n props: new Set(),\n sub: new Set(),\n parent: null,\n };\n if (TRANSACTION) {\n transaction.parent = TRANSACTION;\n }\n TRANSACTION = transaction;\n}\n\nexport function subscribe(obj: Tag): void {\n if (TRANSACTION) {\n TRANSACTION.sub.add(obj);\n } else {\n obj.ref;\n }\n}\n\nfunction updateRef(obj: Tag): void {\n if (DEBUG) {\n try {\n obj.ref = null;\n } catch (e: unknown) {\n if (e instanceof Error) {\n if (e.message.includes('You attempted to update `ref` on `Tag`')) {\n e.message = e.message.replace(\n 'You attempted to update `ref` on `Tag`',\n // @ts-expect-error\n `You attempted to update <${obj._debug_base}>.${obj._debug_prop}` // eslint-disable-line\n );\n e.stack = e.stack?.replace(\n 'You attempted to update `ref` on `Tag`',\n // @ts-expect-error\n `You attempted to update <${obj._debug_base}>.${obj._debug_prop}` // eslint-disable-line\n );\n\n const lines = e.stack?.split(`\\n`);\n const finalLines: string[] = [];\n let lastFile: string | null = null;\n\n lines?.forEach((line) => {\n if (line.trim().startsWith('at ')) {\n // get the last string in the line which contains the code source location\n const location = line.split(' ').at(-1)!;\n // remove the line and char offset info\n\n if (location.includes(':')) {\n const parts = location.split(':');\n parts.pop();\n parts.pop();\n const file = parts.join(':');\n if (file !== lastFile) {\n lastFile = file;\n finalLines.push('');\n }\n }\n finalLines.push(line);\n }\n });\n\n const splitstr = '`ref` was first used:';\n const parts = e.message.split(splitstr);\n parts.splice(1, 0, `Original Stack\\n=============\\n${finalLines.join(`\\n`)}\\n\\n${splitstr}`);\n\n e.message = parts.join('');\n }\n }\n throw e;\n }\n } else {\n obj.ref = null;\n }\n}\n\nfunction flushTransaction() {\n let transaction = TRANSACTION!;\n TRANSACTION = transaction.parent;\n transaction.cbs.forEach((cb) => {\n cb();\n });\n transaction.props.forEach((obj: Tag) => {\n // mark this mutation as part of a transaction\n obj.t = true;\n updateRef(obj);\n });\n transaction.sub.forEach((obj: Tag) => {\n obj.ref;\n });\n}\nasync function untrack() {\n let transaction = TRANSACTION!;\n TRANSACTION = transaction.parent;\n\n // defer writes\n await Promise.resolve();\n transaction.cbs.forEach((cb) => {\n cb();\n });\n transaction.props.forEach((obj: Tag) => {\n // mark this mutation as part of a transaction\n obj.t = true;\n updateRef(obj);\n });\n}\n\nexport function addToTransaction(obj: Tag): void {\n if (TRANSACTION) {\n TRANSACTION.props.add(obj);\n } else {\n updateRef(obj);\n }\n}\nexport function addTransactionCB(method: OpaqueFn): void {\n if (TRANSACTION) {\n TRANSACTION.cbs.add(method);\n } else {\n method();\n }\n}\n\n/**\n * Run `method` without subscribing to any tracked properties\n * controlled by EmberData.\n *\n * This should rarely be used except by libraries that really\n * know what they are doing. It is most useful for wrapping\n * certain kinds of fetch/query logic from within a `Resource`\n * `hook` or other similar pattern.\n *\n * @function untracked\n * @public\n * @static\n * @for @ember-data/tracking\n * @param method\n * @returns result of invoking method\n */\nexport function untracked<T extends OpaqueFn>(method: T): ReturnType<T> {\n createTransaction();\n const ret = method();\n void untrack();\n return ret as ReturnType<T>;\n}\n\n/**\n * Run the method, subscribing to any tracked properties\n * managed by EmberData that were accessed or written during\n * the method's execution as per-normal but while allowing\n * interleaving of reads and writes.\n *\n * This is useful when for instance you want to perform\n * a mutation based on existing state that must be read first.\n *\n * @function transact\n * @public\n * @static\n * @for @ember-data/tracking\n * @param method\n * @returns result of invoking method\n */\nexport function transact<T extends OpaqueFn>(method: T): ReturnType<T> {\n createTransaction();\n const ret = method();\n flushTransaction();\n return ret as ReturnType<T>;\n}\n\n/**\n * A helpful utility for creating a new function that\n * always runs in a transaction. E.G. this \"memoizes\"\n * calling `transact(fn)`, currying args as necessary.\n *\n * @method memoTransact\n * @public\n * @static\n * @for @ember-data/tracking\n * @param method\n * @returns a function that will invoke method in a transaction with any provided args and return its result\n */\nexport function memoTransact<T extends OpaqueFn>(method: T): (...args: unknown[]) => ReturnType<T> {\n return function (...args: unknown[]) {\n createTransaction();\n const ret = method(...args);\n flushTransaction();\n return ret as ReturnType<T>;\n };\n}\n"],"names":["TRANSACTION","createTransaction","transaction","cbs","Set","props","sub","parent","subscribe","obj","add","ref","updateRef","macroCondition","getOwnConfig","env","DEBUG","e","Error","message","includes","replace","_debug_base","_debug_prop","stack","lines","split","finalLines","lastFile","forEach","line","trim","startsWith","location","at","parts","pop","file","join","push","splitstr","splice","flushTransaction","cb","t","untrack","Promise","resolve","addToTransaction","addTransactionCB","method","untracked","ret","transact","memoTransact","args"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA,IAAIA,WAA+B,GAAG,IAAI,CAAA;AAE1C,SAASC,iBAAiBA,GAAG;AAC3B,EAAA,IAAIC,WAAwB,GAAG;AAC7BC,IAAAA,GAAG,EAAE,IAAIC,GAAG,EAAE;AACdC,IAAAA,KAAK,EAAE,IAAID,GAAG,EAAE;AAChBE,IAAAA,GAAG,EAAE,IAAIF,GAAG,EAAE;AACdG,IAAAA,MAAM,EAAE,IAAA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.js DELETED
@@ -1 +0,0 @@
1
- export { memoTransact, transact, untracked } from "./-private";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/addon-main.js DELETED
@@ -1,93 +0,0 @@
1
- const requireModule = require('@ember-data/private-build-infra/src/utilities/require-module');
2
- const getEnv = require('@ember-data/private-build-infra/src/utilities/get-env');
3
- const detectModule = require('@ember-data/private-build-infra/src/utilities/detect-module');
4
-
5
- const pkg = require('./package.json');
6
-
7
- module.exports = {
8
- name: pkg.name,
9
-
10
- options: {
11
- '@embroider/macros': {
12
- setOwnConfig: {},
13
- },
14
- },
15
-
16
- _emberDataConfig: null,
17
- configureEmberData() {
18
- if (this._emberDataConfig) {
19
- return this._emberDataConfig;
20
- }
21
- const app = this._findHost();
22
- const isProd = /production/.test(process.env.EMBER_ENV);
23
- const hostOptions = app.options?.emberData || {};
24
- const debugOptions = Object.assign(
25
- {
26
- LOG_PAYLOADS: false,
27
- LOG_OPERATIONS: false,
28
- LOG_MUTATIONS: false,
29
- LOG_NOTIFICATIONS: false,
30
- LOG_REQUESTS: false,
31
- LOG_REQUEST_STATUS: false,
32
- LOG_IDENTIFIERS: false,
33
- LOG_GRAPH: false,
34
- LOG_INSTANCE_CACHE: false,
35
- },
36
- hostOptions.debug || {}
37
- );
38
-
39
- const HAS_DEBUG_PACKAGE = detectModule(require, '@ember-data/debug', __dirname, pkg);
40
- const HAS_META_PACKAGE = detectModule(require, 'ember-data', __dirname, pkg);
41
-
42
- const includeDataAdapterInProduction =
43
- typeof hostOptions.includeDataAdapterInProduction === 'boolean'
44
- ? hostOptions.includeDataAdapterInProduction
45
- : HAS_META_PACKAGE;
46
-
47
- const includeDataAdapter = HAS_DEBUG_PACKAGE ? (isProd ? includeDataAdapterInProduction : true) : false;
48
- const DEPRECATIONS = require('@ember-data/private-build-infra/src/deprecations')(hostOptions.compatWith || null);
49
- const FEATURES = require('@ember-data/private-build-infra/src/features')(isProd);
50
-
51
- const ALL_PACKAGES = requireModule('@ember-data/private-build-infra/virtual-packages/packages.js');
52
- const MACRO_PACKAGE_FLAGS = Object.assign({}, ALL_PACKAGES.default);
53
- delete MACRO_PACKAGE_FLAGS['HAS_DEBUG_PACKAGE'];
54
-
55
- Object.keys(MACRO_PACKAGE_FLAGS).forEach((key) => {
56
- MACRO_PACKAGE_FLAGS[key] = detectModule(require, MACRO_PACKAGE_FLAGS[key], __dirname, pkg);
57
- });
58
-
59
- // copy configs forward
60
- const ownConfig = this.options['@embroider/macros'].setOwnConfig;
61
- ownConfig.compatWith = hostOptions.compatWith || null;
62
- ownConfig.debug = debugOptions;
63
- ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
64
- ownConfig.features = Object.assign({}, FEATURES, ownConfig.features || {}, hostOptions.features || {});
65
- ownConfig.includeDataAdapter = includeDataAdapter;
66
- ownConfig.packages = MACRO_PACKAGE_FLAGS;
67
- ownConfig.env = getEnv(ownConfig);
68
-
69
- this._emberDataConfig = ownConfig;
70
- return ownConfig;
71
- },
72
-
73
- included() {
74
- this.configureEmberData();
75
- return this._super.included.call(this, ...arguments);
76
- },
77
-
78
- treeForVendor() {
79
- return;
80
- },
81
- treeForPublic() {
82
- return;
83
- },
84
- treeForStyles() {
85
- return;
86
- },
87
- treeForAddonStyles() {
88
- return;
89
- },
90
- treeForApp() {
91
- return;
92
- },
93
- };