@warp-drive/tc39-proposal-signals 5.10.0-alpha.13 → 5.10.0-alpha.14
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/dist/install.d.ts +26 -3
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +11 -6
- package/dist/install.js.map +1 -1
- package/dist/unpkg/dev/install.js +11 -6
- package/dist/unpkg/dev/install.js.map +1 -1
- package/dist/unpkg/dev-deprecated/install.js +11 -6
- package/dist/unpkg/dev-deprecated/install.js.map +1 -1
- package/dist/unpkg/prod/install.js +11 -6
- package/dist/unpkg/prod/install.js.map +1 -1
- package/dist/unpkg/prod-deprecated/install.js +11 -6
- package/dist/unpkg/prod-deprecated/install.js.map +1 -1
- package/logos/README.md +1 -1
- package/package.json +5 -5
package/dist/install.d.ts
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importing this entry point configures ***Warp*Drive** to use the
|
|
3
|
+
* [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:
|
|
4
|
+
* on import it calls `registerSignals` with {@link buildSignalConfig}.
|
|
5
|
+
*
|
|
6
|
+
* If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with
|
|
7
|
+
* its signals graph, alongside any other framework's signals, and memos come from that graph.
|
|
8
|
+
* Otherwise it configures the polyfill on its own with `setupSignals`.
|
|
9
|
+
*
|
|
10
|
+
* Add the import to the top of your application. If you have tests which do not invoke your
|
|
11
|
+
* app, add it to your test setup as well:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* import '@warp-drive/tc39-proposal-signals/install';
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* A library should do this only in its tests, not in its published code. See
|
|
18
|
+
* [Installation](/guides/installation/#tc39-signals) for the full setup.
|
|
19
|
+
*
|
|
20
|
+
* @summary Side-effect import that configures WarpDrive to use the TC39 Signals polyfill, `signal-polyfill`, for
|
|
21
|
+
* reactivity.
|
|
22
|
+
* @module
|
|
23
|
+
*/
|
|
1
24
|
import { Signal } from "signal-polyfill";
|
|
2
25
|
import { HooksOptions, SignalHooks } from "@warp-drive/core/configure";
|
|
3
26
|
//#region src/install.d.ts
|
|
@@ -9,15 +32,15 @@ import { HooksOptions, SignalHooks } from "@warp-drive/core/configure";
|
|
|
9
32
|
* is no `waitFor` hook, so requests are not wrapped for test waiters.
|
|
10
33
|
*
|
|
11
34
|
* Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to
|
|
12
|
-
*
|
|
35
|
+
* `registerSignals`, which passes it to `setupSignals` when no other signals are configured.
|
|
13
36
|
*
|
|
14
37
|
* @example
|
|
15
38
|
* ```ts
|
|
16
39
|
* // what importing '@warp-drive/tc39-proposal-signals/install' does
|
|
17
|
-
* import {
|
|
40
|
+
* import { registerSignals } from '@warp-drive/core/configure';
|
|
18
41
|
* import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';
|
|
19
42
|
*
|
|
20
|
-
*
|
|
43
|
+
* registerSignals(buildSignalConfig);
|
|
21
44
|
* ```
|
|
22
45
|
*
|
|
23
46
|
* @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them
|
package/dist/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","names":[],"sources":["../src/install.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","names":[],"sources":["../src/install.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqDgB,kBAAkB,UAAU,eAAe,YAAY,OAAO"}
|
package/dist/install.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Signal } from "signal-polyfill";
|
|
2
|
-
import {
|
|
2
|
+
import { registerSignals } from "@warp-drive/core/configure";
|
|
3
3
|
|
|
4
4
|
//#region src/install.ts
|
|
5
5
|
/**
|
|
6
6
|
* Importing this entry point configures ***Warp*Drive** to use the
|
|
7
7
|
* [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:
|
|
8
|
-
* on import it calls
|
|
8
|
+
* on import it calls `registerSignals` with {@link buildSignalConfig}.
|
|
9
|
+
*
|
|
10
|
+
* If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with
|
|
11
|
+
* its signals graph, alongside any other framework's signals, and memos come from that graph.
|
|
12
|
+
* Otherwise it configures the polyfill on its own with `setupSignals`.
|
|
9
13
|
*
|
|
10
14
|
* Add the import to the top of your application. If you have tests which do not invoke your
|
|
11
15
|
* app, add it to your test setup as well:
|
|
@@ -29,15 +33,15 @@ import { setupSignals } from "@warp-drive/core/configure";
|
|
|
29
33
|
* is no `waitFor` hook, so requests are not wrapped for test waiters.
|
|
30
34
|
*
|
|
31
35
|
* Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to
|
|
32
|
-
*
|
|
36
|
+
* `registerSignals`, which passes it to `setupSignals` when no other signals are configured.
|
|
33
37
|
*
|
|
34
38
|
* @example
|
|
35
39
|
* ```ts
|
|
36
40
|
* // what importing '@warp-drive/tc39-proposal-signals/install' does
|
|
37
|
-
* import {
|
|
41
|
+
* import { registerSignals } from '@warp-drive/core/configure';
|
|
38
42
|
* import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';
|
|
39
43
|
*
|
|
40
|
-
*
|
|
44
|
+
* registerSignals(buildSignalConfig);
|
|
41
45
|
* ```
|
|
42
46
|
*
|
|
43
47
|
* @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them
|
|
@@ -56,10 +60,11 @@ function buildSignalConfig(_options) {
|
|
|
56
60
|
const memo = new Signal.Computed(fn);
|
|
57
61
|
return () => memo.get();
|
|
58
62
|
},
|
|
63
|
+
isTracking: () => Signal.subtle.currentComputed() !== void 0,
|
|
59
64
|
willSyncFlushWatchers: () => false
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
|
-
|
|
67
|
+
registerSignals(buildSignalConfig);
|
|
63
68
|
|
|
64
69
|
//#endregion
|
|
65
70
|
export { buildSignalConfig };
|
package/dist/install.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","names":["Signal","
|
|
1
|
+
{"version":3,"file":"install.js","names":["Signal","registerSignals","buildSignalConfig","_options","createSignal","obj","key","State","equals","consumeSignal","signal","get","notifySignal","set","createMemo","object","fn","memo","Computed","isTracking","subtle","currentComputed","undefined","willSyncFlushWatchers"],"sources":["../src/install.ts"],"sourcesContent":["/**\n * Importing this entry point configures ***Warp*Drive** to use the\n * [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:\n * on import it calls `registerSignals` with {@link buildSignalConfig}.\n *\n * If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with\n * its signals graph, alongside any other framework's signals, and memos come from that graph.\n * Otherwise it configures the polyfill on its own with `setupSignals`.\n *\n * Add the import to the top of your application. If you have tests which do not invoke your\n * app, add it to your test setup as well:\n *\n * ```ts\n * import '@warp-drive/tc39-proposal-signals/install';\n * ```\n *\n * A library should do this only in its tests, not in its published code. See\n * [Installation](/guides/installation/#tc39-signals) for the full setup.\n *\n * @summary Side-effect import that configures WarpDrive to use the TC39 Signals polyfill, `signal-polyfill`, for\n * reactivity.\n * @module\n */\nimport { Signal } from 'signal-polyfill';\n\nimport { type HooksOptions, registerSignals, type SignalHooks } from '@warp-drive/core/configure';\n\n/**\n * Builds the {@link SignalHooks} that back ***Warp*Drive**'s reactivity with the\n * [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill). Each signal is a\n * `Signal.State` whose `equals` always returns `false`, so every notification counts as a change,\n * and each memo is a `Signal.Computed`. `willSyncFlushWatchers` always returns `false`, and there\n * is no `waitFor` hook, so requests are not wrapped for test waiters.\n *\n * Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to\n * `registerSignals`, which passes it to `setupSignals` when no other signals are configured.\n *\n * @example\n * ```ts\n * // what importing '@warp-drive/tc39-proposal-signals/install' does\n * import { registerSignals } from '@warp-drive/core/configure';\n * import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';\n *\n * registerSignals(buildSignalConfig);\n * ```\n *\n * @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them\n * @return the signal hooks backed by `signal-polyfill`\n * @summary Builds the signal hooks that back WarpDrive reactivity with `Signal.State` and `Signal.Computed` from\n * the TC39 Signals polyfill.\n * @since 5.7.0\n * @public\n */\nexport function buildSignalConfig(_options: HooksOptions): SignalHooks<Signal.State<unknown>> {\n return {\n createSignal: (obj: object, key: string | symbol) => new Signal.State(null, { equals: () => false }),\n consumeSignal: (signal: Signal.State<unknown>) => void signal.get(),\n notifySignal: (signal: Signal.State<unknown>) => signal.set(1),\n createMemo: <F>(object: object, key: string | symbol, fn: () => F): (() => F) => {\n const memo = new Signal.Computed<F>(fn);\n return () => memo.get();\n },\n isTracking: () => Signal.subtle.currentComputed() !== undefined,\n willSyncFlushWatchers: () => false,\n };\n}\n\nregisterSignals(buildSignalConfig);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAgBE,kBAAkBC,UAA4D;CAC5F,OAAO;EACLC,eAAeC,KAAaC,QAAyB,IAAIN,OAAOO,MAAM,MAAM,EAAEC,cAAc,MAAM,CAAC;EACnGC,gBAAgBC,WAAkC,KAAKA,OAAOC,IAAI;EAClEC,eAAeF,WAAkCA,OAAOG,IAAI,CAAC;EAC7DC,aAAgBC,QAAgBT,KAAsBU,OAA2B;GAC/E,MAAMC,OAAO,IAAIjB,OAAOkB,SAAYF,EAAE;GACtC,aAAaC,KAAKN,IAAI;EACxB;EACAQ,kBAAkBnB,OAAOoB,OAAOC,gBAAgB,MAAMC;EACtDC,6BAA6B;CAC/B;AACF;AAEAtB,gBAAgBC,iBAAiB"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Signal } from "signal-polyfill";
|
|
2
|
-
import {
|
|
2
|
+
import { registerSignals } from "@warp-drive/core/configure";
|
|
3
3
|
|
|
4
4
|
//#region src/install.ts
|
|
5
5
|
/**
|
|
6
6
|
* Importing this entry point configures ***Warp*Drive** to use the
|
|
7
7
|
* [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:
|
|
8
|
-
* on import it calls
|
|
8
|
+
* on import it calls `registerSignals` with {@link buildSignalConfig}.
|
|
9
|
+
*
|
|
10
|
+
* If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with
|
|
11
|
+
* its signals graph, alongside any other framework's signals, and memos come from that graph.
|
|
12
|
+
* Otherwise it configures the polyfill on its own with `setupSignals`.
|
|
9
13
|
*
|
|
10
14
|
* Add the import to the top of your application. If you have tests which do not invoke your
|
|
11
15
|
* app, add it to your test setup as well:
|
|
@@ -29,15 +33,15 @@ import { setupSignals } from "@warp-drive/core/configure";
|
|
|
29
33
|
* is no `waitFor` hook, so requests are not wrapped for test waiters.
|
|
30
34
|
*
|
|
31
35
|
* Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to
|
|
32
|
-
*
|
|
36
|
+
* `registerSignals`, which passes it to `setupSignals` when no other signals are configured.
|
|
33
37
|
*
|
|
34
38
|
* @example
|
|
35
39
|
* ```ts
|
|
36
40
|
* // what importing '@warp-drive/tc39-proposal-signals/install' does
|
|
37
|
-
* import {
|
|
41
|
+
* import { registerSignals } from '@warp-drive/core/configure';
|
|
38
42
|
* import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';
|
|
39
43
|
*
|
|
40
|
-
*
|
|
44
|
+
* registerSignals(buildSignalConfig);
|
|
41
45
|
* ```
|
|
42
46
|
*
|
|
43
47
|
* @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them
|
|
@@ -56,10 +60,11 @@ function buildSignalConfig(_options) {
|
|
|
56
60
|
const memo = new Signal.Computed(fn);
|
|
57
61
|
return () => memo.get();
|
|
58
62
|
},
|
|
63
|
+
isTracking: () => Signal.subtle.currentComputed() !== void 0,
|
|
59
64
|
willSyncFlushWatchers: () => false
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
|
-
|
|
67
|
+
registerSignals(buildSignalConfig);
|
|
63
68
|
|
|
64
69
|
//#endregion
|
|
65
70
|
export { buildSignalConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","names":["Signal","
|
|
1
|
+
{"version":3,"file":"install.js","names":["Signal","registerSignals","buildSignalConfig","_options","createSignal","obj","key","State","equals","consumeSignal","signal","get","notifySignal","set","createMemo","object","fn","memo","Computed","isTracking","subtle","currentComputed","undefined","willSyncFlushWatchers"],"sources":["../../../src/install.ts"],"sourcesContent":["/**\n * Importing this entry point configures ***Warp*Drive** to use the\n * [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:\n * on import it calls `registerSignals` with {@link buildSignalConfig}.\n *\n * If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with\n * its signals graph, alongside any other framework's signals, and memos come from that graph.\n * Otherwise it configures the polyfill on its own with `setupSignals`.\n *\n * Add the import to the top of your application. If you have tests which do not invoke your\n * app, add it to your test setup as well:\n *\n * ```ts\n * import '@warp-drive/tc39-proposal-signals/install';\n * ```\n *\n * A library should do this only in its tests, not in its published code. See\n * [Installation](/guides/installation/#tc39-signals) for the full setup.\n *\n * @summary Side-effect import that configures WarpDrive to use the TC39 Signals polyfill, `signal-polyfill`, for\n * reactivity.\n * @module\n */\nimport { Signal } from 'signal-polyfill';\n\nimport { type HooksOptions, registerSignals, type SignalHooks } from '@warp-drive/core/configure';\n\n/**\n * Builds the {@link SignalHooks} that back ***Warp*Drive**'s reactivity with the\n * [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill). Each signal is a\n * `Signal.State` whose `equals` always returns `false`, so every notification counts as a change,\n * and each memo is a `Signal.Computed`. `willSyncFlushWatchers` always returns `false`, and there\n * is no `waitFor` hook, so requests are not wrapped for test waiters.\n *\n * Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to\n * `registerSignals`, which passes it to `setupSignals` when no other signals are configured.\n *\n * @example\n * ```ts\n * // what importing '@warp-drive/tc39-proposal-signals/install' does\n * import { registerSignals } from '@warp-drive/core/configure';\n * import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';\n *\n * registerSignals(buildSignalConfig);\n * ```\n *\n * @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them\n * @return the signal hooks backed by `signal-polyfill`\n * @summary Builds the signal hooks that back WarpDrive reactivity with `Signal.State` and `Signal.Computed` from\n * the TC39 Signals polyfill.\n * @since 5.7.0\n * @public\n */\nexport function buildSignalConfig(_options: HooksOptions): SignalHooks<Signal.State<unknown>> {\n return {\n createSignal: (obj: object, key: string | symbol) => new Signal.State(null, { equals: () => false }),\n consumeSignal: (signal: Signal.State<unknown>) => void signal.get(),\n notifySignal: (signal: Signal.State<unknown>) => signal.set(1),\n createMemo: <F>(object: object, key: string | symbol, fn: () => F): (() => F) => {\n const memo = new Signal.Computed<F>(fn);\n return () => memo.get();\n },\n isTracking: () => Signal.subtle.currentComputed() !== undefined,\n willSyncFlushWatchers: () => false,\n };\n}\n\nregisterSignals(buildSignalConfig);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAgBE,kBAAkBC,UAA4D;CAC5F,OAAO;EACLC,eAAeC,KAAaC,QAAyB,IAAIN,OAAOO,MAAM,MAAM,EAAEC,cAAc,MAAM,CAAC;EACnGC,gBAAgBC,WAAkC,KAAKA,OAAOC,IAAI;EAClEC,eAAeF,WAAkCA,OAAOG,IAAI,CAAC;EAC7DC,aAAgBC,QAAgBT,KAAsBU,OAA2B;GAC/E,MAAMC,OAAO,IAAIjB,OAAOkB,SAAYF,EAAE;GACtC,aAAaC,KAAKN,IAAI;EACxB;EACAQ,kBAAkBnB,OAAOoB,OAAOC,gBAAgB,MAAMC;EACtDC,6BAA6B;CAC/B;AACF;AAEAtB,gBAAgBC,iBAAiB"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Signal } from "signal-polyfill";
|
|
2
|
-
import {
|
|
2
|
+
import { registerSignals } from "@warp-drive/core/configure";
|
|
3
3
|
|
|
4
4
|
//#region src/install.ts
|
|
5
5
|
/**
|
|
6
6
|
* Importing this entry point configures ***Warp*Drive** to use the
|
|
7
7
|
* [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:
|
|
8
|
-
* on import it calls
|
|
8
|
+
* on import it calls `registerSignals` with {@link buildSignalConfig}.
|
|
9
|
+
*
|
|
10
|
+
* If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with
|
|
11
|
+
* its signals graph, alongside any other framework's signals, and memos come from that graph.
|
|
12
|
+
* Otherwise it configures the polyfill on its own with `setupSignals`.
|
|
9
13
|
*
|
|
10
14
|
* Add the import to the top of your application. If you have tests which do not invoke your
|
|
11
15
|
* app, add it to your test setup as well:
|
|
@@ -29,15 +33,15 @@ import { setupSignals } from "@warp-drive/core/configure";
|
|
|
29
33
|
* is no `waitFor` hook, so requests are not wrapped for test waiters.
|
|
30
34
|
*
|
|
31
35
|
* Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to
|
|
32
|
-
*
|
|
36
|
+
* `registerSignals`, which passes it to `setupSignals` when no other signals are configured.
|
|
33
37
|
*
|
|
34
38
|
* @example
|
|
35
39
|
* ```ts
|
|
36
40
|
* // what importing '@warp-drive/tc39-proposal-signals/install' does
|
|
37
|
-
* import {
|
|
41
|
+
* import { registerSignals } from '@warp-drive/core/configure';
|
|
38
42
|
* import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';
|
|
39
43
|
*
|
|
40
|
-
*
|
|
44
|
+
* registerSignals(buildSignalConfig);
|
|
41
45
|
* ```
|
|
42
46
|
*
|
|
43
47
|
* @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them
|
|
@@ -56,10 +60,11 @@ function buildSignalConfig(_options) {
|
|
|
56
60
|
const memo = new Signal.Computed(fn);
|
|
57
61
|
return () => memo.get();
|
|
58
62
|
},
|
|
63
|
+
isTracking: () => Signal.subtle.currentComputed() !== void 0,
|
|
59
64
|
willSyncFlushWatchers: () => false
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
|
-
|
|
67
|
+
registerSignals(buildSignalConfig);
|
|
63
68
|
|
|
64
69
|
//#endregion
|
|
65
70
|
export { buildSignalConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","names":["Signal","
|
|
1
|
+
{"version":3,"file":"install.js","names":["Signal","registerSignals","buildSignalConfig","_options","createSignal","obj","key","State","equals","consumeSignal","signal","get","notifySignal","set","createMemo","object","fn","memo","Computed","isTracking","subtle","currentComputed","undefined","willSyncFlushWatchers"],"sources":["../../../src/install.ts"],"sourcesContent":["/**\n * Importing this entry point configures ***Warp*Drive** to use the\n * [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:\n * on import it calls `registerSignals` with {@link buildSignalConfig}.\n *\n * If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with\n * its signals graph, alongside any other framework's signals, and memos come from that graph.\n * Otherwise it configures the polyfill on its own with `setupSignals`.\n *\n * Add the import to the top of your application. If you have tests which do not invoke your\n * app, add it to your test setup as well:\n *\n * ```ts\n * import '@warp-drive/tc39-proposal-signals/install';\n * ```\n *\n * A library should do this only in its tests, not in its published code. See\n * [Installation](/guides/installation/#tc39-signals) for the full setup.\n *\n * @summary Side-effect import that configures WarpDrive to use the TC39 Signals polyfill, `signal-polyfill`, for\n * reactivity.\n * @module\n */\nimport { Signal } from 'signal-polyfill';\n\nimport { type HooksOptions, registerSignals, type SignalHooks } from '@warp-drive/core/configure';\n\n/**\n * Builds the {@link SignalHooks} that back ***Warp*Drive**'s reactivity with the\n * [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill). Each signal is a\n * `Signal.State` whose `equals` always returns `false`, so every notification counts as a change,\n * and each memo is a `Signal.Computed`. `willSyncFlushWatchers` always returns `false`, and there\n * is no `waitFor` hook, so requests are not wrapped for test waiters.\n *\n * Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to\n * `registerSignals`, which passes it to `setupSignals` when no other signals are configured.\n *\n * @example\n * ```ts\n * // what importing '@warp-drive/tc39-proposal-signals/install' does\n * import { registerSignals } from '@warp-drive/core/configure';\n * import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';\n *\n * registerSignals(buildSignalConfig);\n * ```\n *\n * @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them\n * @return the signal hooks backed by `signal-polyfill`\n * @summary Builds the signal hooks that back WarpDrive reactivity with `Signal.State` and `Signal.Computed` from\n * the TC39 Signals polyfill.\n * @since 5.7.0\n * @public\n */\nexport function buildSignalConfig(_options: HooksOptions): SignalHooks<Signal.State<unknown>> {\n return {\n createSignal: (obj: object, key: string | symbol) => new Signal.State(null, { equals: () => false }),\n consumeSignal: (signal: Signal.State<unknown>) => void signal.get(),\n notifySignal: (signal: Signal.State<unknown>) => signal.set(1),\n createMemo: <F>(object: object, key: string | symbol, fn: () => F): (() => F) => {\n const memo = new Signal.Computed<F>(fn);\n return () => memo.get();\n },\n isTracking: () => Signal.subtle.currentComputed() !== undefined,\n willSyncFlushWatchers: () => false,\n };\n}\n\nregisterSignals(buildSignalConfig);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAgBE,kBAAkBC,UAA4D;CAC5F,OAAO;EACLC,eAAeC,KAAaC,QAAyB,IAAIN,OAAOO,MAAM,MAAM,EAAEC,cAAc,MAAM,CAAC;EACnGC,gBAAgBC,WAAkC,KAAKA,OAAOC,IAAI;EAClEC,eAAeF,WAAkCA,OAAOG,IAAI,CAAC;EAC7DC,aAAgBC,QAAgBT,KAAsBU,OAA2B;GAC/E,MAAMC,OAAO,IAAIjB,OAAOkB,SAAYF,EAAE;GACtC,aAAaC,KAAKN,IAAI;EACxB;EACAQ,kBAAkBnB,OAAOoB,OAAOC,gBAAgB,MAAMC;EACtDC,6BAA6B;CAC/B;AACF;AAEAtB,gBAAgBC,iBAAiB"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Signal } from "signal-polyfill";
|
|
2
|
-
import {
|
|
2
|
+
import { registerSignals } from "@warp-drive/core/configure";
|
|
3
3
|
|
|
4
4
|
//#region src/install.ts
|
|
5
5
|
/**
|
|
6
6
|
* Importing this entry point configures ***Warp*Drive** to use the
|
|
7
7
|
* [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:
|
|
8
|
-
* on import it calls
|
|
8
|
+
* on import it calls `registerSignals` with {@link buildSignalConfig}.
|
|
9
|
+
*
|
|
10
|
+
* If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with
|
|
11
|
+
* its signals graph, alongside any other framework's signals, and memos come from that graph.
|
|
12
|
+
* Otherwise it configures the polyfill on its own with `setupSignals`.
|
|
9
13
|
*
|
|
10
14
|
* Add the import to the top of your application. If you have tests which do not invoke your
|
|
11
15
|
* app, add it to your test setup as well:
|
|
@@ -29,15 +33,15 @@ import { setupSignals } from "@warp-drive/core/configure";
|
|
|
29
33
|
* is no `waitFor` hook, so requests are not wrapped for test waiters.
|
|
30
34
|
*
|
|
31
35
|
* Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to
|
|
32
|
-
*
|
|
36
|
+
* `registerSignals`, which passes it to `setupSignals` when no other signals are configured.
|
|
33
37
|
*
|
|
34
38
|
* @example
|
|
35
39
|
* ```ts
|
|
36
40
|
* // what importing '@warp-drive/tc39-proposal-signals/install' does
|
|
37
|
-
* import {
|
|
41
|
+
* import { registerSignals } from '@warp-drive/core/configure';
|
|
38
42
|
* import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';
|
|
39
43
|
*
|
|
40
|
-
*
|
|
44
|
+
* registerSignals(buildSignalConfig);
|
|
41
45
|
* ```
|
|
42
46
|
*
|
|
43
47
|
* @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them
|
|
@@ -56,10 +60,11 @@ function buildSignalConfig(_options) {
|
|
|
56
60
|
const memo = new Signal.Computed(fn);
|
|
57
61
|
return () => memo.get();
|
|
58
62
|
},
|
|
63
|
+
isTracking: () => Signal.subtle.currentComputed() !== void 0,
|
|
59
64
|
willSyncFlushWatchers: () => false
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
|
-
|
|
67
|
+
registerSignals(buildSignalConfig);
|
|
63
68
|
|
|
64
69
|
//#endregion
|
|
65
70
|
export { buildSignalConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","names":["Signal","
|
|
1
|
+
{"version":3,"file":"install.js","names":["Signal","registerSignals","buildSignalConfig","_options","createSignal","obj","key","State","equals","consumeSignal","signal","get","notifySignal","set","createMemo","object","fn","memo","Computed","isTracking","subtle","currentComputed","undefined","willSyncFlushWatchers"],"sources":["../../../src/install.ts"],"sourcesContent":["/**\n * Importing this entry point configures ***Warp*Drive** to use the\n * [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:\n * on import it calls `registerSignals` with {@link buildSignalConfig}.\n *\n * If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with\n * its signals graph, alongside any other framework's signals, and memos come from that graph.\n * Otherwise it configures the polyfill on its own with `setupSignals`.\n *\n * Add the import to the top of your application. If you have tests which do not invoke your\n * app, add it to your test setup as well:\n *\n * ```ts\n * import '@warp-drive/tc39-proposal-signals/install';\n * ```\n *\n * A library should do this only in its tests, not in its published code. See\n * [Installation](/guides/installation/#tc39-signals) for the full setup.\n *\n * @summary Side-effect import that configures WarpDrive to use the TC39 Signals polyfill, `signal-polyfill`, for\n * reactivity.\n * @module\n */\nimport { Signal } from 'signal-polyfill';\n\nimport { type HooksOptions, registerSignals, type SignalHooks } from '@warp-drive/core/configure';\n\n/**\n * Builds the {@link SignalHooks} that back ***Warp*Drive**'s reactivity with the\n * [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill). Each signal is a\n * `Signal.State` whose `equals` always returns `false`, so every notification counts as a change,\n * and each memo is a `Signal.Computed`. `willSyncFlushWatchers` always returns `false`, and there\n * is no `waitFor` hook, so requests are not wrapped for test waiters.\n *\n * Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to\n * `registerSignals`, which passes it to `setupSignals` when no other signals are configured.\n *\n * @example\n * ```ts\n * // what importing '@warp-drive/tc39-proposal-signals/install' does\n * import { registerSignals } from '@warp-drive/core/configure';\n * import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';\n *\n * registerSignals(buildSignalConfig);\n * ```\n *\n * @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them\n * @return the signal hooks backed by `signal-polyfill`\n * @summary Builds the signal hooks that back WarpDrive reactivity with `Signal.State` and `Signal.Computed` from\n * the TC39 Signals polyfill.\n * @since 5.7.0\n * @public\n */\nexport function buildSignalConfig(_options: HooksOptions): SignalHooks<Signal.State<unknown>> {\n return {\n createSignal: (obj: object, key: string | symbol) => new Signal.State(null, { equals: () => false }),\n consumeSignal: (signal: Signal.State<unknown>) => void signal.get(),\n notifySignal: (signal: Signal.State<unknown>) => signal.set(1),\n createMemo: <F>(object: object, key: string | symbol, fn: () => F): (() => F) => {\n const memo = new Signal.Computed<F>(fn);\n return () => memo.get();\n },\n isTracking: () => Signal.subtle.currentComputed() !== undefined,\n willSyncFlushWatchers: () => false,\n };\n}\n\nregisterSignals(buildSignalConfig);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAgBE,kBAAkBC,UAA4D;CAC5F,OAAO;EACLC,eAAeC,KAAaC,QAAyB,IAAIN,OAAOO,MAAM,MAAM,EAAEC,cAAc,MAAM,CAAC;EACnGC,gBAAgBC,WAAkC,KAAKA,OAAOC,IAAI;EAClEC,eAAeF,WAAkCA,OAAOG,IAAI,CAAC;EAC7DC,aAAgBC,QAAgBT,KAAsBU,OAA2B;GAC/E,MAAMC,OAAO,IAAIjB,OAAOkB,SAAYF,EAAE;GACtC,aAAaC,KAAKN,IAAI;EACxB;EACAQ,kBAAkBnB,OAAOoB,OAAOC,gBAAgB,MAAMC;EACtDC,6BAA6B;CAC/B;AACF;AAEAtB,gBAAgBC,iBAAiB"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Signal } from "signal-polyfill";
|
|
2
|
-
import {
|
|
2
|
+
import { registerSignals } from "@warp-drive/core/configure";
|
|
3
3
|
|
|
4
4
|
//#region src/install.ts
|
|
5
5
|
/**
|
|
6
6
|
* Importing this entry point configures ***Warp*Drive** to use the
|
|
7
7
|
* [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:
|
|
8
|
-
* on import it calls
|
|
8
|
+
* on import it calls `registerSignals` with {@link buildSignalConfig}.
|
|
9
|
+
*
|
|
10
|
+
* If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with
|
|
11
|
+
* its signals graph, alongside any other framework's signals, and memos come from that graph.
|
|
12
|
+
* Otherwise it configures the polyfill on its own with `setupSignals`.
|
|
9
13
|
*
|
|
10
14
|
* Add the import to the top of your application. If you have tests which do not invoke your
|
|
11
15
|
* app, add it to your test setup as well:
|
|
@@ -29,15 +33,15 @@ import { setupSignals } from "@warp-drive/core/configure";
|
|
|
29
33
|
* is no `waitFor` hook, so requests are not wrapped for test waiters.
|
|
30
34
|
*
|
|
31
35
|
* Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to
|
|
32
|
-
*
|
|
36
|
+
* `registerSignals`, which passes it to `setupSignals` when no other signals are configured.
|
|
33
37
|
*
|
|
34
38
|
* @example
|
|
35
39
|
* ```ts
|
|
36
40
|
* // what importing '@warp-drive/tc39-proposal-signals/install' does
|
|
37
|
-
* import {
|
|
41
|
+
* import { registerSignals } from '@warp-drive/core/configure';
|
|
38
42
|
* import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';
|
|
39
43
|
*
|
|
40
|
-
*
|
|
44
|
+
* registerSignals(buildSignalConfig);
|
|
41
45
|
* ```
|
|
42
46
|
*
|
|
43
47
|
* @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them
|
|
@@ -56,10 +60,11 @@ function buildSignalConfig(_options) {
|
|
|
56
60
|
const memo = new Signal.Computed(fn);
|
|
57
61
|
return () => memo.get();
|
|
58
62
|
},
|
|
63
|
+
isTracking: () => Signal.subtle.currentComputed() !== void 0,
|
|
59
64
|
willSyncFlushWatchers: () => false
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
|
-
|
|
67
|
+
registerSignals(buildSignalConfig);
|
|
63
68
|
|
|
64
69
|
//#endregion
|
|
65
70
|
export { buildSignalConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","names":["Signal","
|
|
1
|
+
{"version":3,"file":"install.js","names":["Signal","registerSignals","buildSignalConfig","_options","createSignal","obj","key","State","equals","consumeSignal","signal","get","notifySignal","set","createMemo","object","fn","memo","Computed","isTracking","subtle","currentComputed","undefined","willSyncFlushWatchers"],"sources":["../../../src/install.ts"],"sourcesContent":["/**\n * Importing this entry point configures ***Warp*Drive** to use the\n * [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill) for reactivity:\n * on import it calls `registerSignals` with {@link buildSignalConfig}.\n *\n * If `@warp-drive/alien-signals/install` was imported first, each `Signal.State` is registered with\n * its signals graph, alongside any other framework's signals, and memos come from that graph.\n * Otherwise it configures the polyfill on its own with `setupSignals`.\n *\n * Add the import to the top of your application. If you have tests which do not invoke your\n * app, add it to your test setup as well:\n *\n * ```ts\n * import '@warp-drive/tc39-proposal-signals/install';\n * ```\n *\n * A library should do this only in its tests, not in its published code. See\n * [Installation](/guides/installation/#tc39-signals) for the full setup.\n *\n * @summary Side-effect import that configures WarpDrive to use the TC39 Signals polyfill, `signal-polyfill`, for\n * reactivity.\n * @module\n */\nimport { Signal } from 'signal-polyfill';\n\nimport { type HooksOptions, registerSignals, type SignalHooks } from '@warp-drive/core/configure';\n\n/**\n * Builds the {@link SignalHooks} that back ***Warp*Drive**'s reactivity with the\n * [TC39 Signals polyfill](https://github.com/proposal-signals/signal-polyfill). Each signal is a\n * `Signal.State` whose `equals` always returns `false`, so every notification counts as a change,\n * and each memo is a `Signal.Computed`. `willSyncFlushWatchers` always returns `false`, and there\n * is no `waitFor` hook, so requests are not wrapped for test waiters.\n *\n * Importing `@warp-drive/tc39-proposal-signals/install` already passes this function to\n * `registerSignals`, which passes it to `setupSignals` when no other signals are configured.\n *\n * @example\n * ```ts\n * // what importing '@warp-drive/tc39-proposal-signals/install' does\n * import { registerSignals } from '@warp-drive/core/configure';\n * import { buildSignalConfig } from '@warp-drive/tc39-proposal-signals/install';\n *\n * registerSignals(buildSignalConfig);\n * ```\n *\n * @param _options - the {@link HooksOptions} that `setupSignals` passes in; this implementation does not read them\n * @return the signal hooks backed by `signal-polyfill`\n * @summary Builds the signal hooks that back WarpDrive reactivity with `Signal.State` and `Signal.Computed` from\n * the TC39 Signals polyfill.\n * @since 5.7.0\n * @public\n */\nexport function buildSignalConfig(_options: HooksOptions): SignalHooks<Signal.State<unknown>> {\n return {\n createSignal: (obj: object, key: string | symbol) => new Signal.State(null, { equals: () => false }),\n consumeSignal: (signal: Signal.State<unknown>) => void signal.get(),\n notifySignal: (signal: Signal.State<unknown>) => signal.set(1),\n createMemo: <F>(object: object, key: string | symbol, fn: () => F): (() => F) => {\n const memo = new Signal.Computed<F>(fn);\n return () => memo.get();\n },\n isTracking: () => Signal.subtle.currentComputed() !== undefined,\n willSyncFlushWatchers: () => false,\n };\n}\n\nregisterSignals(buildSignalConfig);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAgBE,kBAAkBC,UAA4D;CAC5F,OAAO;EACLC,eAAeC,KAAaC,QAAyB,IAAIN,OAAOO,MAAM,MAAM,EAAEC,cAAc,MAAM,CAAC;EACnGC,gBAAgBC,WAAkC,KAAKA,OAAOC,IAAI;EAClEC,eAAeF,WAAkCA,OAAOG,IAAI,CAAC;EAC7DC,aAAgBC,QAAgBT,KAAsBU,OAA2B;GAC/E,MAAMC,OAAO,IAAIjB,OAAOkB,SAAYF,EAAE;GACtC,aAAaC,KAAKN,IAAI;EACxB;EACAQ,kBAAkBnB,OAAOoB,OAAOC,gBAAgB,MAAMC;EACtDC,6BAA6B;CAC/B;AACF;AAEAtB,gBAAgBC,iBAAiB"}
|
package/logos/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive/tc39-proposal-signals",
|
|
3
3
|
"description": "Configures WarpDrive reactivity to use the TC39 Signals polyfill (signal-polyfill); import its install entry in apps that use TC39 Signals.",
|
|
4
|
-
"version": "5.10.0-alpha.
|
|
4
|
+
"version": "5.10.0-alpha.14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
|
|
7
7
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@embroider/macros": "^1.21.1",
|
|
34
|
-
"@warp-drive/core": "5.10.0-alpha.
|
|
34
|
+
"@warp-drive/core": "5.10.0-alpha.14",
|
|
35
35
|
"signal-polyfill": "0.2.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {},
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"@babel/preset-env": "^7.29.7",
|
|
42
42
|
"@babel/preset-typescript": "^7.29.7",
|
|
43
43
|
"@babel/runtime": "^7.29.7",
|
|
44
|
-
"@warp-drive/core": "5.10.0-alpha.
|
|
45
|
-
"@warp-drive/internal-config": "5.10.0-alpha.
|
|
44
|
+
"@warp-drive/core": "5.10.0-alpha.14",
|
|
45
|
+
"@warp-drive/internal-config": "5.10.0-alpha.14",
|
|
46
46
|
"tsdown": "^0.23.0",
|
|
47
|
-
"typescript-7": "npm:typescript@7.1.0-dev.
|
|
47
|
+
"typescript-7": "npm:typescript@7.1.0-dev.20260929.1"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build:pkg": "node node_modules/tsdown/dist/run.mjs",
|