@ember-data/tracking 5.5.0-alpha.20 → 5.5.0-alpha.21
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 +14 -30
- package/dist/index.js +60 -27
- package/dist/index.js.map +1 -1
- package/package.json +8 -14
- package/unstable-preview-types/index.d.ts +15 -5
- package/unstable-preview-types/index.d.ts.map +1 -1
- package/dist/-private.js +0 -415
- package/dist/-private.js.map +0 -1
- package/logos/NCC-1701-a-blue.svg +0 -4
- package/logos/NCC-1701-a-gold.svg +0 -4
- package/logos/NCC-1701-a-gold_100.svg +0 -1
- package/logos/NCC-1701-a-gold_base-64.txt +0 -1
- package/logos/NCC-1701-a.svg +0 -4
- package/logos/README.md +0 -4
- package/logos/docs-badge.svg +0 -2
- package/logos/ember-data-logo-dark.svg +0 -12
- package/logos/ember-data-logo-light.svg +0 -12
- package/logos/github-header.svg +0 -444
- package/logos/social1.png +0 -0
- package/logos/social2.png +0 -0
- package/logos/warp-drive-logo-dark.svg +0 -4
- package/logos/warp-drive-logo-gold.svg +0 -4
- package/unstable-preview-types/-private.d.ts +0 -196
- package/unstable-preview-types/-private.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
<img
|
|
3
|
-
class="project-logo"
|
|
4
|
-
src="./logos/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="./logos/ember-data-logo-light.svg#gh-light-mode-only"
|
|
12
|
-
alt="EmberData Store"
|
|
13
|
-
width="240px"
|
|
14
|
-
title="EmberData Store"
|
|
15
|
-
/>
|
|
16
|
-
</p>
|
|
1
|
+
# ⚠️ Decommissioned ⚠️
|
|
17
2
|
|
|
18
|
-
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
> This package is no longer providing any code as of release version 5.5
|
|
5
|
+
> Posted on 4/25/2025
|
|
19
6
|
|
|
20
|
-
|
|
7
|
+
This package is no longer part of the EmberData/WarpDrive experience.
|
|
21
8
|
|
|
22
|
-
|
|
9
|
+
Previously it provided the reactivity integration for EmberData/WarpDrive to use Ember's reactivity
|
|
10
|
+
system. Agnostic reactivity primitives are now provided by @ember-data/store (and thus @warp-drive/core)
|
|
11
|
+
while ember specific configuration is provided by @warp-drive/ember.
|
|
23
12
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
**Tagged Releases**
|
|
29
|
-
|
|
30
|
-
- 
|
|
31
|
-
- 
|
|
32
|
-
- 
|
|
33
|
-
- 
|
|
34
|
-
- 
|
|
13
|
+
If using the `ember-data` package, you can remove any references to this package, no other changes needed.
|
|
14
|
+
If using individual packages, ensure you have `@warp-drive/ember` installed and add the following line to
|
|
15
|
+
your `app.ts` file.
|
|
35
16
|
|
|
17
|
+
```ts
|
|
18
|
+
import '@warp-drive/ember/install';
|
|
19
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -1,31 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { tagForProperty } from '@ember/-internals/metal';
|
|
2
|
+
import { _backburner } from '@ember/runloop';
|
|
3
|
+
import { createCache, track, updateTag, consumeTag, getValue, dirtyTag } from '@glimmer/validator';
|
|
3
4
|
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const emberDirtyTag = dirtyTag;
|
|
6
|
+
function buildSignalConfig(options) {
|
|
7
|
+
const ARRAY_SIGNAL = options.wellknown.Array;
|
|
8
|
+
return {
|
|
9
|
+
createSignal(obj, key) {
|
|
10
|
+
if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
|
|
11
|
+
if (key === ARRAY_SIGNAL) {
|
|
12
|
+
return [tagForProperty(obj, key), tagForProperty(obj, 'length'), tagForProperty(obj, '[]')];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return tagForProperty(obj, key);
|
|
16
|
+
},
|
|
17
|
+
consumeSignal(signal) {
|
|
18
|
+
if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
|
|
19
|
+
if (Array.isArray(signal)) {
|
|
20
|
+
consumeTag(signal[0]);
|
|
21
|
+
consumeTag(signal[1]);
|
|
22
|
+
consumeTag(signal[2]);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
consumeTag(signal);
|
|
27
|
+
},
|
|
28
|
+
notifySignal(signal) {
|
|
29
|
+
if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
|
|
30
|
+
if (Array.isArray(signal)) {
|
|
31
|
+
emberDirtyTag(signal[0]);
|
|
32
|
+
emberDirtyTag(signal[1]);
|
|
33
|
+
emberDirtyTag(signal[2]);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
emberDirtyTag(signal);
|
|
38
|
+
},
|
|
39
|
+
createMemo: (object, key, fn) => {
|
|
40
|
+
if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
|
|
41
|
+
const propertyTag = tagForProperty(object, key);
|
|
42
|
+
const memo = createCache(fn);
|
|
43
|
+
let ret;
|
|
44
|
+
const wrappedFn = () => {
|
|
45
|
+
ret = getValue(memo);
|
|
46
|
+
};
|
|
47
|
+
return () => {
|
|
48
|
+
const tag = track(wrappedFn);
|
|
49
|
+
updateTag(propertyTag, tag);
|
|
50
|
+
consumeTag(tag);
|
|
51
|
+
return ret;
|
|
52
|
+
};
|
|
53
|
+
} else {
|
|
54
|
+
const memo = createCache(fn);
|
|
55
|
+
return () => getValue(memo);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
willSyncFlushWatchers: () => {
|
|
59
|
+
//@ts-expect-error
|
|
60
|
+
return !!_backburner.currentInstance && _backburner._autorun !== true;
|
|
11
61
|
}
|
|
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
62
|
};
|
|
30
63
|
}
|
|
31
|
-
export {
|
|
64
|
+
export { buildSignalConfig };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { createCache, getValue } from '@glimmer/tracking/primitives/cache';\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { tagForProperty } from '@ember/-internals/metal';\nimport { _backburner } from '@ember/runloop';\nimport { consumeTag, createCache, dirtyTag, getValue, track, type UpdatableTag, updateTag } from '@glimmer/validator';\n\n// import { createCache, getValue } from '@glimmer/tracking/primitives/cache';\nimport { DEPRECATE_COMPUTED_CHAINS } from '@warp-drive/build-config/deprecations';\n\ntype Tag = ReturnType<typeof tagForProperty>;\nconst emberDirtyTag = dirtyTag as unknown as (tag: Tag) => void;\n\nexport function buildSignalConfig(options: {\n wellknown: {\n Array: symbol | string;\n };\n}) {\n const ARRAY_SIGNAL = options.wellknown.Array;\n\n return {\n createSignal(obj: object, key: string | symbol) {\n if (DEPRECATE_COMPUTED_CHAINS) {\n if (key === ARRAY_SIGNAL) {\n return [tagForProperty(obj, key), tagForProperty(obj, 'length'), tagForProperty(obj, '[]')] as const;\n }\n }\n return tagForProperty(obj, key);\n },\n consumeSignal(signal: Tag | [Tag, Tag, Tag]) {\n if (DEPRECATE_COMPUTED_CHAINS) {\n if (Array.isArray(signal)) {\n consumeTag(signal[0]);\n consumeTag(signal[1]);\n consumeTag(signal[2]);\n return;\n }\n }\n consumeTag(signal as Tag);\n },\n notifySignal(signal: Tag | [Tag, Tag, Tag]) {\n if (DEPRECATE_COMPUTED_CHAINS) {\n if (Array.isArray(signal)) {\n emberDirtyTag(signal[0]);\n emberDirtyTag(signal[1]);\n emberDirtyTag(signal[2]);\n return;\n }\n }\n\n emberDirtyTag(signal as Tag);\n },\n createMemo: <F>(object: object, key: string | symbol, fn: () => F): (() => F) => {\n if (DEPRECATE_COMPUTED_CHAINS) {\n const propertyTag = tagForProperty(object, key) as UpdatableTag;\n const memo = createCache(fn);\n let ret: F | undefined;\n const wrappedFn = () => {\n ret = getValue(memo) as F;\n };\n return () => {\n const tag = track(wrappedFn);\n updateTag(propertyTag, tag);\n consumeTag(tag);\n return ret!;\n };\n } else {\n const memo = createCache(fn);\n return () => getValue(memo) as F;\n }\n },\n willSyncFlushWatchers: () => {\n //@ts-expect-error\n return !!_backburner.currentInstance && _backburner._autorun !== true;\n },\n };\n}\n"],"names":["emberDirtyTag","dirtyTag","buildSignalConfig","options","ARRAY_SIGNAL","wellknown","Array","createSignal","obj","key","macroCondition","getGlobalConfig","WarpDrive","deprecations","DEPRECATE_COMPUTED_CHAINS","tagForProperty","consumeSignal","signal","isArray","consumeTag","notifySignal","createMemo","object","fn","propertyTag","memo","createCache","ret","wrappedFn","getValue","tag","track","updateTag","willSyncFlushWatchers","_backburner","currentInstance","_autorun"],"mappings":";;;;;AAQA,MAAMA,aAAa,GAAGC,QAAyC;AAExD,SAASC,iBAAiBA,CAACC,OAIjC,EAAE;AACD,EAAA,MAAMC,YAAY,GAAGD,OAAO,CAACE,SAAS,CAACC,KAAK;EAE5C,OAAO;AACLC,IAAAA,YAAYA,CAACC,GAAW,EAAEC,GAAoB,EAAE;MAC9C,IAAAC,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,YAAA,CAAAC,yBAAA,CAA+B,EAAA;QAC7B,IAAIL,GAAG,KAAKL,YAAY,EAAE;UACxB,OAAO,CAACW,cAAc,CAACP,GAAG,EAAEC,GAAG,CAAC,EAAEM,cAAc,CAACP,GAAG,EAAE,QAAQ,CAAC,EAAEO,cAAc,CAACP,GAAG,EAAE,IAAI,CAAC,CAAC;AAC7F;AACF;AACA,MAAA,OAAOO,cAAc,CAACP,GAAG,EAAEC,GAAG,CAAC;KAChC;IACDO,aAAaA,CAACC,MAA6B,EAAE;MAC3C,IAAAP,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,YAAA,CAAAC,yBAAA,CAA+B,EAAA;AAC7B,QAAA,IAAIR,KAAK,CAACY,OAAO,CAACD,MAAM,CAAC,EAAE;AACzBE,UAAAA,UAAU,CAACF,MAAM,CAAC,CAAC,CAAC,CAAC;AACrBE,UAAAA,UAAU,CAACF,MAAM,CAAC,CAAC,CAAC,CAAC;AACrBE,UAAAA,UAAU,CAACF,MAAM,CAAC,CAAC,CAAC,CAAC;AACrB,UAAA;AACF;AACF;MACAE,UAAU,CAACF,MAAa,CAAC;KAC1B;IACDG,YAAYA,CAACH,MA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IAAID,WAAW,CAACE,QAAQ,KAAK,IAAI;AACvE;GACD;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data/tracking",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "5.5.0-alpha.
|
|
3
|
+
"description": "DEPRECATED - Use @warp-drive/ember",
|
|
4
|
+
"version": "5.5.0-alpha.21",
|
|
5
|
+
"deprecated": "Use @warp-drive/ember",
|
|
5
6
|
"private": false,
|
|
6
7
|
"license": "MIT",
|
|
7
8
|
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
|
|
@@ -12,9 +13,6 @@
|
|
|
12
13
|
},
|
|
13
14
|
"homepage": "https://github.com/emberjs/data",
|
|
14
15
|
"bugs": "https://github.com/emberjs/data/issues",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">= 18.20.8"
|
|
17
|
-
},
|
|
18
16
|
"keywords": [
|
|
19
17
|
"ember-addon"
|
|
20
18
|
],
|
|
@@ -23,27 +21,23 @@
|
|
|
23
21
|
},
|
|
24
22
|
"dependencies": {
|
|
25
23
|
"@embroider/macros": "^1.16.12",
|
|
26
|
-
"@warp-drive/build-config": "5.5.0-alpha.
|
|
24
|
+
"@warp-drive/build-config": "5.5.0-alpha.21"
|
|
27
25
|
},
|
|
28
26
|
"peerDependencies": {
|
|
29
27
|
"ember-source": "3.28.12 || ^4.0.4 || ^5.0.0 || ^6.0.0",
|
|
30
|
-
"@warp-drive/core-types": "5.5.0-alpha.
|
|
28
|
+
"@warp-drive/core-types": "5.5.0-alpha.21"
|
|
31
29
|
},
|
|
32
30
|
"files": [
|
|
33
31
|
"unstable-preview-types",
|
|
34
32
|
"addon-main.cjs",
|
|
35
33
|
"dist",
|
|
36
34
|
"README.md",
|
|
37
|
-
"LICENSE.md"
|
|
38
|
-
"logos"
|
|
35
|
+
"LICENSE.md"
|
|
39
36
|
],
|
|
40
37
|
"exports": {
|
|
41
38
|
".": {
|
|
42
39
|
"default": "./dist/index.js"
|
|
43
40
|
},
|
|
44
|
-
"./*": {
|
|
45
|
-
"default": "./dist/*.js"
|
|
46
|
-
},
|
|
47
41
|
"./unstable-preview-types": {
|
|
48
42
|
"types": "./unstable-preview-types/index.d.ts"
|
|
49
43
|
}
|
|
@@ -65,8 +59,8 @@
|
|
|
65
59
|
"@babel/preset-typescript": "^7.27.0",
|
|
66
60
|
"@glimmer/component": "^2.0.0",
|
|
67
61
|
"@glimmer/validator": "^0.94.8",
|
|
68
|
-
"@warp-drive/core-types": "5.5.0-alpha.
|
|
69
|
-
"@warp-drive/internal-config": "5.5.0-alpha.
|
|
62
|
+
"@warp-drive/core-types": "5.5.0-alpha.21",
|
|
63
|
+
"@warp-drive/internal-config": "5.5.0-alpha.21",
|
|
70
64
|
"ember-source": "~6.3.0",
|
|
71
65
|
"typescript": "^5.8.3",
|
|
72
66
|
"vite": "^5.4.15"
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
declare module '@ember-data/tracking' {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export function
|
|
6
|
-
|
|
3
|
+
import { tagForProperty } from '@ember/-internals/metal';
|
|
4
|
+
type Tag = ReturnType<typeof tagForProperty>;
|
|
5
|
+
export function buildSignalConfig(options: {
|
|
6
|
+
wellknown: {
|
|
7
|
+
Array: symbol | string;
|
|
8
|
+
};
|
|
9
|
+
}): {
|
|
10
|
+
createSignal(obj: object, key: string | symbol): import("@glimmer/validator").Tag | readonly [import("@glimmer/validator").Tag, import("@glimmer/validator").Tag, import("@glimmer/validator").Tag];
|
|
11
|
+
consumeSignal(signal: Tag | [Tag, Tag, Tag]): void;
|
|
12
|
+
notifySignal(signal: Tag | [Tag, Tag, Tag]): void;
|
|
13
|
+
createMemo: <F>(object: object, key: string | symbol, fn: () => F) => (() => F);
|
|
14
|
+
willSyncFlushWatchers: () => boolean;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
7
17
|
}
|
|
8
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAOzD,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAG7C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,CAAC;CACH;sBAIqB,MAAM,OAAO,MAAM,GAAG,MAAM;0BAQxB,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;yBAWtB,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;iBAY7B,CAAC,UAAU,MAAM,OAAO,MAAM,GAAG,MAAM,MAAM,MAAM,CAAC,KAAG,CAAC,MAAM,CAAC,CAAC;;EAwBhF"}
|