@ember-data/tracking 5.5.0-alpha.9 → 5.5.0-beta.0
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/LICENSE.md +19 -7
- package/README.md +19 -13
- package/addon-main.cjs +5 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -39
- package/unstable-preview-types/index.d.ts +18 -0
- package/unstable-preview-types/index.d.ts.map +1 -0
- package/addon/-private.js +0 -199
- package/addon/-private.js.map +0 -1
- package/addon/index.js +0 -1
- package/addon/index.js.map +0 -1
- package/addon-main.js +0 -93
package/LICENSE.md
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Copyright (c) 2017-2025 Ember.js and contributors
|
|
4
|
+
Copyright (c) 2011-2017 Tilde, Inc. and contributors
|
|
5
|
+
Copyright (c) 2011 LivingSocial Inc.
|
|
6
6
|
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
8
13
|
|
|
9
|
-
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
10
16
|
|
|
11
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
# ⚠️ Decommissioned ⚠️
|
|
2
|
+
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
> This package is no longer providing any code as of release version 5.5
|
|
5
|
+
> Posted on 4/25/2025
|
|
6
|
+
|
|
7
|
+
This package is no longer part of the EmberData/WarpDrive experience.
|
|
8
|
+
|
|
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.
|
|
12
|
+
|
|
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.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import '@warp-drive/ember/install';
|
|
19
|
+
```
|
package/addon-main.cjs
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { tagForProperty } from '@ember/-internals/metal';
|
|
2
|
+
import { _backburner } from '@ember/runloop';
|
|
3
|
+
import { createCache, track, updateTag, consumeTag, getValue, dirtyTag } from '@glimmer/validator';
|
|
4
|
+
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
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;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export { buildSignalConfig };
|
|
@@ -0,0 +1 @@
|
|
|
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,Y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AA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,YAAA,CAAAC,yBAAA,CAA+B,EAAA;AAC7B,QAAA,MAAMU,WAAW,GAAGT,cAAc,CAACO,MAAM,EAAEb,GAAG,CAAiB;AAC/D,QAAA,MAAMgB,IAAI,GAAGC,WAAW,CAACH,EAAE,CAAC;AAC5B,QAAA,IAAII,GAAkB;QACtB,MAAMC,SAAS,GAAGA,MAAM;AACtBD,UAAAA,GAAG,GAAGE,QAAQ,CAACJ,IAAI,CAAM;SAC1B;AACD,QAAA,OAAO,MAAM;AACX,UAAA,MAAMK,GAAG,GAAGC,KAAK,CAACH,SAAS,CAAC;AAC5BI,UAAAA,SAAS,CAACR,WAAW,EAAEM,GAAG,CAAC;UAC3BX,UAAU,CAACW,GAAG,CAAC;AACf,UAAA,OAAOH,GAAG;SACX;AACH,OAAC,MAAM;AACL,QAAA,MAAMF,IAAI,GAAGC,WAAW,CAACH,EAAE,CAAC;AAC5B,QAAA,OAAO,MAAMM,QAAQ,CAACJ,IAAI,CAAM;AAClC;KACD;IACDQ,qBAAqB,EAAEA,MAAM;AAC3B;MACA,OAAO,CAAC,CAACC,WAAW,CAACC,eAAe,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-
|
|
3
|
+
"description": "DEPRECATED - Use @warp-drive/ember",
|
|
4
|
+
"version": "5.5.0-beta.0",
|
|
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,62 +13,72 @@
|
|
|
12
13
|
},
|
|
13
14
|
"homepage": "https://github.com/emberjs/data",
|
|
14
15
|
"bugs": "https://github.com/emberjs/data/issues",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": "16.* || >= 18"
|
|
17
|
-
},
|
|
18
16
|
"keywords": [
|
|
19
17
|
"ember-addon"
|
|
20
18
|
],
|
|
21
19
|
"volta": {
|
|
22
20
|
"extends": "../../package.json"
|
|
23
21
|
},
|
|
24
|
-
"dependenciesMeta": {
|
|
25
|
-
"@ember-data/private-build-infra": {
|
|
26
|
-
"injected": true
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
22
|
"dependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
|
|
23
|
+
"@embroider/macros": "^1.16.12",
|
|
24
|
+
"@warp-drive/build-config": "5.5.0-beta.0"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"ember-source": "3.28.12 || ^4.0.4 || ^5.0.0 || ^6.0.0",
|
|
28
|
+
"@warp-drive/core-types": "5.5.0-beta.0"
|
|
33
29
|
},
|
|
34
30
|
"files": [
|
|
35
|
-
"
|
|
36
|
-
"addon",
|
|
31
|
+
"unstable-preview-types",
|
|
32
|
+
"addon-main.cjs",
|
|
33
|
+
"dist",
|
|
37
34
|
"README.md",
|
|
38
|
-
"LICENSE.md"
|
|
39
|
-
"ember-data-logo-dark.svg",
|
|
40
|
-
"ember-data-logo-light.svg"
|
|
35
|
+
"LICENSE.md"
|
|
41
36
|
],
|
|
37
|
+
"exports": {
|
|
38
|
+
".": {
|
|
39
|
+
"default": "./dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./unstable-preview-types": {
|
|
42
|
+
"types": "./unstable-preview-types/index.d.ts"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
42
45
|
"ember-addon": {
|
|
43
|
-
"main": "addon-main.
|
|
46
|
+
"main": "addon-main.cjs",
|
|
44
47
|
"type": "addon",
|
|
45
|
-
"version":
|
|
48
|
+
"version": 2,
|
|
49
|
+
"externals": [
|
|
50
|
+
"@ember/-internals",
|
|
51
|
+
"@ember/-internals/metal",
|
|
52
|
+
"@glimmer/validator"
|
|
53
|
+
]
|
|
46
54
|
},
|
|
47
55
|
"devDependencies": {
|
|
48
|
-
"@babel/
|
|
49
|
-
"@babel/
|
|
50
|
-
"@babel/
|
|
51
|
-
"@babel/
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"@rollup/plugin-babel": "^6.0.3",
|
|
60
|
-
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
61
|
-
"rollup": "^3.29.3",
|
|
62
|
-
"tslib": "^2.6.2",
|
|
63
|
-
"typescript": "^5.2.2",
|
|
64
|
-
"walk-sync": "^3.0.0"
|
|
56
|
+
"@babel/core": "^7.26.10",
|
|
57
|
+
"@babel/plugin-transform-typescript": "^7.27.0",
|
|
58
|
+
"@babel/preset-env": "^7.26.9",
|
|
59
|
+
"@babel/preset-typescript": "^7.27.0",
|
|
60
|
+
"@glimmer/component": "^2.0.0",
|
|
61
|
+
"@glimmer/validator": "^0.94.8",
|
|
62
|
+
"@warp-drive/core-types": "5.5.0-beta.0",
|
|
63
|
+
"@warp-drive/internal-config": "5.5.0-beta.0",
|
|
64
|
+
"ember-source": "~6.3.0",
|
|
65
|
+
"typescript": "^5.8.3",
|
|
66
|
+
"vite": "^5.4.15"
|
|
65
67
|
},
|
|
66
68
|
"ember": {
|
|
67
69
|
"edition": "octane"
|
|
68
70
|
},
|
|
71
|
+
"typesVersions": {
|
|
72
|
+
"*": {
|
|
73
|
+
"unstable-preview-types": [
|
|
74
|
+
"./unstable-preview-types"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
69
78
|
"scripts": {
|
|
70
|
-
"
|
|
71
|
-
"
|
|
79
|
+
"lint": "eslint . --quiet --cache --cache-strategy=content",
|
|
80
|
+
"build:pkg": "vite build;",
|
|
81
|
+
"sync": "echo \"syncing\"",
|
|
82
|
+
"start": "vite"
|
|
72
83
|
}
|
|
73
84
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
declare module '@ember-data/tracking' {
|
|
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 {};
|
|
17
|
+
}
|
|
18
|
+
//# 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,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"}
|
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 };
|
package/addon/-private.js.map
DELETED
|
@@ -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;GACT,CAAA;AACD,EAAA,IAAIP,WAAW,EAAE;IACfE,WAAW,CAACK,MAAM,GAAGP,WAAW,CAAA;AAClC,GAAA;AACAA,EAAAA,WAAW,GAAGE,WAAW,CAAA;AAC3B,CAAA;AAEO,SAASM,SAASA,CAACC,GAAQ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AE;AACfA,IAAAA,WAAW,CAACG,GAAG,CAACO,GAAG,CAACwC,MAAM,CAAC,CAAA;AAC7B,GAAC,MAAM;AACLA,IAAAA,MAAM,EAAE,CAAA;AACV,GAAA;AACF,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAqBD,MAAS,EAAiB;AACtEjD,EAAAA,iBAAiB,EAAE,CAAA;AACnB,EAAA,MAAMmD,GAAG,GAAGF,MAAM,EAAE,CAAA;EACpB,KAAKL,OAAO,EAAE,CAAA;AACd,EAAA,OAAOO,GAAG,CAAA;AACZ,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQA,CAAqBH,MAAS,EAAiB;AACrEjD,EAAAA,iBAAiB,EAAE,CAAA;AACnB,EAAA,MAAMmD,GAAG,GAAGF,MAAM,EAAE,CAAA;AACpBR,EAAAA,gBAAgB,EAAE,CAAA;AAClB,EAAA,OAAOU,GAAG,CAAA;AACZ,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,YAAYA,CAAqBJ,MAAS,EAAyC;EACjG,OAAO,UAAU,GAAGK,IAAe,EAAE;AACnCtD,IAAAA,iBAAiB,EAAE,CAAA;AACnB,IAAA,MAAMmD,GAAG,GAAGF,MAAM,CAAC,GAAGK,IAAI,CAAC,CAAA;AAC3Bb,IAAAA,gBAAgB,EAAE,CAAA;AAClB,IAAA,OAAOU,GAAG,CAAA;GACX,CAAA;AACH;;;;"}
|
package/addon/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { memoTransact, transact, untracked } from "./-private";
|
package/addon/index.js.map
DELETED
|
@@ -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
|
-
};
|