@alloy-js/core 0.23.0-dev.10 → 0.23.0-dev.11
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/devtools/index.html +29 -17
- package/dist/src/binder.d.ts.map +1 -1
- package/dist/src/binder.js +5 -0
- package/dist/src/binder.js.map +1 -1
- package/dist/src/components/For.d.ts.map +1 -1
- package/dist/src/components/For.js +1 -1
- package/dist/src/components/For.js.map +1 -1
- package/dist/src/components/List.d.ts.map +1 -1
- package/dist/src/components/List.js +1 -1
- package/dist/src/components/List.js.map +1 -1
- package/dist/src/components/Switch.d.ts.map +1 -1
- package/dist/src/components/Switch.js +1 -1
- package/dist/src/components/Switch.js.map +1 -1
- package/dist/src/debug/diagnostics.test.js +3 -2
- package/dist/src/debug/diagnostics.test.js.map +1 -1
- package/dist/src/debug/effects.d.ts +12 -4
- package/dist/src/debug/effects.d.ts.map +1 -1
- package/dist/src/debug/effects.js +182 -52
- package/dist/src/debug/effects.js.map +1 -1
- package/dist/src/debug/effects.test.js +213 -41
- package/dist/src/debug/effects.test.js.map +1 -1
- package/dist/src/debug/files.d.ts.map +1 -1
- package/dist/src/debug/files.js +7 -18
- package/dist/src/debug/files.js.map +1 -1
- package/dist/src/debug/files.test.js +13 -36
- package/dist/src/debug/files.test.js.map +1 -1
- package/dist/src/debug/index.d.ts +4 -2
- package/dist/src/debug/index.d.ts.map +1 -1
- package/dist/src/debug/index.js +4 -2
- package/dist/src/debug/index.js.map +1 -1
- package/dist/src/debug/message-format.test.d.ts +2 -0
- package/dist/src/debug/message-format.test.d.ts.map +1 -0
- package/dist/src/debug/message-format.test.js +700 -0
- package/dist/src/debug/message-format.test.js.map +1 -0
- package/dist/src/debug/render-tree-orphans.test.d.ts +2 -0
- package/dist/src/debug/render-tree-orphans.test.d.ts.map +1 -0
- package/dist/src/debug/render-tree-orphans.test.js +297 -0
- package/dist/src/debug/render-tree-orphans.test.js.map +1 -0
- package/dist/src/debug/render.d.ts.map +1 -1
- package/dist/src/debug/render.js +83 -130
- package/dist/src/debug/render.js.map +1 -1
- package/dist/src/debug/render.test.js +91 -128
- package/dist/src/debug/render.test.js.map +1 -1
- package/dist/src/debug/symbols.d.ts +6 -5
- package/dist/src/debug/symbols.d.ts.map +1 -1
- package/dist/src/debug/symbols.js +46 -23
- package/dist/src/debug/symbols.js.map +1 -1
- package/dist/src/debug/symbols.test.js +15 -26
- package/dist/src/debug/symbols.test.js.map +1 -1
- package/dist/src/debug/trace-writer.d.ts +55 -0
- package/dist/src/debug/trace-writer.d.ts.map +1 -0
- package/dist/src/debug/trace-writer.js +658 -0
- package/dist/src/debug/trace-writer.js.map +1 -0
- package/dist/src/debug/trace.d.ts +10 -10
- package/dist/src/debug/trace.d.ts.map +1 -1
- package/dist/src/debug/trace.js +23 -20
- package/dist/src/debug/trace.js.map +1 -1
- package/dist/src/devtools/devtools-protocol.d.ts +318 -161
- package/dist/src/devtools/devtools-protocol.d.ts.map +1 -1
- package/dist/src/devtools/devtools-server.browser.d.ts +0 -5
- package/dist/src/devtools/devtools-server.browser.d.ts.map +1 -1
- package/dist/src/devtools/devtools-server.browser.js +0 -3
- package/dist/src/devtools/devtools-server.browser.js.map +1 -1
- package/dist/src/devtools/devtools-server.d.ts +0 -6
- package/dist/src/devtools/devtools-server.d.ts.map +1 -1
- package/dist/src/devtools/devtools-server.js +212 -24
- package/dist/src/devtools/devtools-server.js.map +1 -1
- package/dist/src/devtools/devtools-transport.d.ts +2 -2
- package/dist/src/devtools/devtools-transport.d.ts.map +1 -1
- package/dist/src/devtools/devtools-transport.js +2 -2
- package/dist/src/devtools/devtools-transport.js.map +1 -1
- package/dist/src/devtools-entry.browser.d.ts +1 -1
- package/dist/src/devtools-entry.browser.d.ts.map +1 -1
- package/dist/src/devtools-entry.browser.js.map +1 -1
- package/dist/src/devtools-entry.d.ts +1 -1
- package/dist/src/devtools-entry.d.ts.map +1 -1
- package/dist/src/devtools-entry.js.map +1 -1
- package/dist/src/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics.js +5 -5
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/reactivity.d.ts +13 -2
- package/dist/src/reactivity.d.ts.map +1 -1
- package/dist/src/reactivity.js +96 -13
- package/dist/src/reactivity.js.map +1 -1
- package/dist/src/render.d.ts.map +1 -1
- package/dist/src/render.js +84 -30
- package/dist/src/render.js.map +1 -1
- package/dist/src/scheduler.d.ts +5 -0
- package/dist/src/scheduler.d.ts.map +1 -1
- package/dist/src/scheduler.js +94 -23
- package/dist/src/scheduler.js.map +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +11 -5
- package/dist/src/utils.js.map +1 -1
- package/dist/testing/devtools-utils.d.ts +12 -3
- package/dist/testing/devtools-utils.d.ts.map +1 -1
- package/dist/testing/devtools-utils.js +26 -4
- package/dist/testing/devtools-utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/binder.ts +47 -38
- package/src/components/For.tsx +14 -10
- package/src/components/List.tsx +7 -4
- package/src/components/Switch.tsx +11 -7
- package/src/debug/diagnostics.test.tsx +3 -2
- package/src/debug/effects.test.tsx +248 -36
- package/src/debug/effects.ts +276 -62
- package/src/debug/files.test.tsx +15 -35
- package/src/debug/files.ts +11 -11
- package/src/debug/index.ts +4 -0
- package/src/debug/message-format.test.tsx +759 -0
- package/src/debug/render-tree-orphans.test.tsx +344 -0
- package/src/debug/render.test.tsx +96 -118
- package/src/debug/render.ts +183 -124
- package/src/debug/symbols.test.tsx +19 -20
- package/src/debug/symbols.ts +106 -23
- package/src/debug/trace-writer.ts +969 -0
- package/src/debug/trace.ts +25 -28
- package/src/devtools/devtools-protocol.ts +361 -176
- package/src/devtools/devtools-server.browser.ts +0 -9
- package/src/devtools/devtools-server.ts +210 -32
- package/src/devtools/devtools-transport.ts +4 -4
- package/src/devtools-entry.browser.ts +11 -15
- package/src/devtools-entry.ts +9 -15
- package/src/diagnostics.ts +14 -5
- package/src/reactivity.ts +113 -17
- package/src/render.ts +104 -30
- package/src/scheduler.ts +145 -26
- package/src/utils.tsx +7 -4
- package/temp/api.json +142 -20
- package/testing/devtools-utils.ts +46 -4
package/src/utils.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ref, toRaw } from "@vue/reactivity";
|
|
2
2
|
import { BaseListProps } from "./components/List.jsx";
|
|
3
3
|
import {
|
|
4
4
|
createCustomContext,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
getContext,
|
|
10
10
|
memo,
|
|
11
11
|
onCleanup,
|
|
12
|
+
ref,
|
|
12
13
|
root,
|
|
13
14
|
untrack,
|
|
14
15
|
} from "./reactivity.js";
|
|
@@ -129,14 +130,16 @@ export function mapJoin<T, U, V>(
|
|
|
129
130
|
}
|
|
130
131
|
return slot;
|
|
131
132
|
}
|
|
132
|
-
const firstNonEmptyIndex = ref(-1);
|
|
133
|
-
const lastNonEmptyIndex = ref(-1);
|
|
133
|
+
const firstNonEmptyIndex = ref(-1, { isInfrastructure: true });
|
|
134
|
+
const lastNonEmptyIndex = ref(-1, { isInfrastructure: true });
|
|
134
135
|
const mapped: Children[] = [];
|
|
135
136
|
let enderMemo: (() => Children) | undefined;
|
|
136
137
|
|
|
137
138
|
// Creates a ref placeholder that stores the joiner node for a boundary.
|
|
138
139
|
function createJoinerRef(): Ref<Children | undefined> {
|
|
139
|
-
return ref<unknown>(undefined) as Ref<
|
|
140
|
+
return ref<unknown>(undefined, { isInfrastructure: true }) as Ref<
|
|
141
|
+
Children | undefined
|
|
142
|
+
>;
|
|
140
143
|
}
|
|
141
144
|
|
|
142
145
|
// Makes sure we have a joiner ref at the requested boundary index.
|
package/temp/api.json
CHANGED
|
@@ -9054,6 +9054,67 @@
|
|
|
9054
9054
|
"endIndex": 8
|
|
9055
9055
|
}
|
|
9056
9056
|
},
|
|
9057
|
+
{
|
|
9058
|
+
"kind": "Function",
|
|
9059
|
+
"canonicalReference": "@alloy-js/core!formatReactivePropertyLabel:function(1)",
|
|
9060
|
+
"docComment": "/**\n * Build a human-readable label for a reactive property like `symbolName.prop`.\n */\n",
|
|
9061
|
+
"excerptTokens": [
|
|
9062
|
+
{
|
|
9063
|
+
"kind": "Content",
|
|
9064
|
+
"text": "export declare function formatReactivePropertyLabel(target: "
|
|
9065
|
+
},
|
|
9066
|
+
{
|
|
9067
|
+
"kind": "Content",
|
|
9068
|
+
"text": "object"
|
|
9069
|
+
},
|
|
9070
|
+
{
|
|
9071
|
+
"kind": "Content",
|
|
9072
|
+
"text": ", key: "
|
|
9073
|
+
},
|
|
9074
|
+
{
|
|
9075
|
+
"kind": "Content",
|
|
9076
|
+
"text": "string | number"
|
|
9077
|
+
},
|
|
9078
|
+
{
|
|
9079
|
+
"kind": "Content",
|
|
9080
|
+
"text": "): "
|
|
9081
|
+
},
|
|
9082
|
+
{
|
|
9083
|
+
"kind": "Content",
|
|
9084
|
+
"text": "string"
|
|
9085
|
+
},
|
|
9086
|
+
{
|
|
9087
|
+
"kind": "Content",
|
|
9088
|
+
"text": ";"
|
|
9089
|
+
}
|
|
9090
|
+
],
|
|
9091
|
+
"fileUrlPath": "src/reactivity.ts",
|
|
9092
|
+
"returnTypeTokenRange": {
|
|
9093
|
+
"startIndex": 5,
|
|
9094
|
+
"endIndex": 6
|
|
9095
|
+
},
|
|
9096
|
+
"releaseTag": "Public",
|
|
9097
|
+
"overloadIndex": 1,
|
|
9098
|
+
"parameters": [
|
|
9099
|
+
{
|
|
9100
|
+
"parameterName": "target",
|
|
9101
|
+
"parameterTypeTokenRange": {
|
|
9102
|
+
"startIndex": 1,
|
|
9103
|
+
"endIndex": 2
|
|
9104
|
+
},
|
|
9105
|
+
"isOptional": false
|
|
9106
|
+
},
|
|
9107
|
+
{
|
|
9108
|
+
"parameterName": "key",
|
|
9109
|
+
"parameterTypeTokenRange": {
|
|
9110
|
+
"startIndex": 3,
|
|
9111
|
+
"endIndex": 4
|
|
9112
|
+
},
|
|
9113
|
+
"isOptional": false
|
|
9114
|
+
}
|
|
9115
|
+
],
|
|
9116
|
+
"name": "formatReactivePropertyLabel"
|
|
9117
|
+
},
|
|
9057
9118
|
{
|
|
9058
9119
|
"kind": "Interface",
|
|
9059
9120
|
"canonicalReference": "@alloy-js/core!ForProps:interface",
|
|
@@ -19862,6 +19923,67 @@
|
|
|
19862
19923
|
],
|
|
19863
19924
|
"extendsTokenRanges": []
|
|
19864
19925
|
},
|
|
19926
|
+
{
|
|
19927
|
+
"kind": "Function",
|
|
19928
|
+
"canonicalReference": "@alloy-js/core!reactivePropertyRefId:function(1)",
|
|
19929
|
+
"docComment": "/**\n * Get a stable ref ID for a property of a reactive object.\n * Each (target, key) pair gets a unique positive ID from the same counter as refs.\n */\n",
|
|
19930
|
+
"excerptTokens": [
|
|
19931
|
+
{
|
|
19932
|
+
"kind": "Content",
|
|
19933
|
+
"text": "export declare function reactivePropertyRefId(target: "
|
|
19934
|
+
},
|
|
19935
|
+
{
|
|
19936
|
+
"kind": "Content",
|
|
19937
|
+
"text": "object"
|
|
19938
|
+
},
|
|
19939
|
+
{
|
|
19940
|
+
"kind": "Content",
|
|
19941
|
+
"text": ", key: "
|
|
19942
|
+
},
|
|
19943
|
+
{
|
|
19944
|
+
"kind": "Content",
|
|
19945
|
+
"text": "string | number"
|
|
19946
|
+
},
|
|
19947
|
+
{
|
|
19948
|
+
"kind": "Content",
|
|
19949
|
+
"text": "): "
|
|
19950
|
+
},
|
|
19951
|
+
{
|
|
19952
|
+
"kind": "Content",
|
|
19953
|
+
"text": "number"
|
|
19954
|
+
},
|
|
19955
|
+
{
|
|
19956
|
+
"kind": "Content",
|
|
19957
|
+
"text": ";"
|
|
19958
|
+
}
|
|
19959
|
+
],
|
|
19960
|
+
"fileUrlPath": "src/reactivity.ts",
|
|
19961
|
+
"returnTypeTokenRange": {
|
|
19962
|
+
"startIndex": 5,
|
|
19963
|
+
"endIndex": 6
|
|
19964
|
+
},
|
|
19965
|
+
"releaseTag": "Public",
|
|
19966
|
+
"overloadIndex": 1,
|
|
19967
|
+
"parameters": [
|
|
19968
|
+
{
|
|
19969
|
+
"parameterName": "target",
|
|
19970
|
+
"parameterTypeTokenRange": {
|
|
19971
|
+
"startIndex": 1,
|
|
19972
|
+
"endIndex": 2
|
|
19973
|
+
},
|
|
19974
|
+
"isOptional": false
|
|
19975
|
+
},
|
|
19976
|
+
{
|
|
19977
|
+
"parameterName": "key",
|
|
19978
|
+
"parameterTypeTokenRange": {
|
|
19979
|
+
"startIndex": 3,
|
|
19980
|
+
"endIndex": 4
|
|
19981
|
+
},
|
|
19982
|
+
"isOptional": false
|
|
19983
|
+
}
|
|
19984
|
+
],
|
|
19985
|
+
"name": "reactivePropertyRefId"
|
|
19986
|
+
},
|
|
19865
19987
|
{
|
|
19866
19988
|
"kind": "Class",
|
|
19867
19989
|
"canonicalReference": "@alloy-js/core!ReactiveUnionSet:class",
|
|
@@ -21045,14 +21167,6 @@
|
|
|
21045
21167
|
"kind": "Content",
|
|
21046
21168
|
"text": "<unknown>"
|
|
21047
21169
|
},
|
|
21048
|
-
{
|
|
21049
|
-
"kind": "Content",
|
|
21050
|
-
"text": ", isInfrastructure?: "
|
|
21051
|
-
},
|
|
21052
|
-
{
|
|
21053
|
-
"kind": "Content",
|
|
21054
|
-
"text": "boolean"
|
|
21055
|
-
},
|
|
21056
21170
|
{
|
|
21057
21171
|
"kind": "Content",
|
|
21058
21172
|
"text": "): "
|
|
@@ -21068,8 +21182,8 @@
|
|
|
21068
21182
|
],
|
|
21069
21183
|
"fileUrlPath": "src/reactivity.ts",
|
|
21070
21184
|
"returnTypeTokenRange": {
|
|
21071
|
-
"startIndex":
|
|
21072
|
-
"endIndex":
|
|
21185
|
+
"startIndex": 4,
|
|
21186
|
+
"endIndex": 5
|
|
21073
21187
|
},
|
|
21074
21188
|
"releaseTag": "Public",
|
|
21075
21189
|
"overloadIndex": 1,
|
|
@@ -21081,14 +21195,6 @@
|
|
|
21081
21195
|
"endIndex": 3
|
|
21082
21196
|
},
|
|
21083
21197
|
"isOptional": false
|
|
21084
|
-
},
|
|
21085
|
-
{
|
|
21086
|
-
"parameterName": "isInfrastructure",
|
|
21087
|
-
"parameterTypeTokenRange": {
|
|
21088
|
-
"startIndex": 4,
|
|
21089
|
-
"endIndex": 5
|
|
21090
|
-
},
|
|
21091
|
-
"isOptional": true
|
|
21092
21198
|
}
|
|
21093
21199
|
],
|
|
21094
21200
|
"name": "refId"
|
|
@@ -22856,6 +22962,14 @@
|
|
|
22856
22962
|
"kind": "Content",
|
|
22857
22963
|
"text": "T"
|
|
22858
22964
|
},
|
|
22965
|
+
{
|
|
22966
|
+
"kind": "Content",
|
|
22967
|
+
"text": ", options?: "
|
|
22968
|
+
},
|
|
22969
|
+
{
|
|
22970
|
+
"kind": "Content",
|
|
22971
|
+
"text": "{\n label?: string;\n}"
|
|
22972
|
+
},
|
|
22859
22973
|
{
|
|
22860
22974
|
"kind": "Content",
|
|
22861
22975
|
"text": "): "
|
|
@@ -22876,8 +22990,8 @@
|
|
|
22876
22990
|
],
|
|
22877
22991
|
"fileUrlPath": "src/reactivity.ts",
|
|
22878
22992
|
"returnTypeTokenRange": {
|
|
22879
|
-
"startIndex":
|
|
22880
|
-
"endIndex":
|
|
22993
|
+
"startIndex": 5,
|
|
22994
|
+
"endIndex": 7
|
|
22881
22995
|
},
|
|
22882
22996
|
"releaseTag": "Public",
|
|
22883
22997
|
"overloadIndex": 1,
|
|
@@ -22889,6 +23003,14 @@
|
|
|
22889
23003
|
"endIndex": 2
|
|
22890
23004
|
},
|
|
22891
23005
|
"isOptional": true
|
|
23006
|
+
},
|
|
23007
|
+
{
|
|
23008
|
+
"parameterName": "options",
|
|
23009
|
+
"parameterTypeTokenRange": {
|
|
23010
|
+
"startIndex": 3,
|
|
23011
|
+
"endIndex": 4
|
|
23012
|
+
},
|
|
23013
|
+
"isOptional": true
|
|
22892
23014
|
}
|
|
22893
23015
|
],
|
|
22894
23016
|
"typeParameters": [
|
|
@@ -5,11 +5,43 @@ export interface DevtoolsMessage {
|
|
|
5
5
|
[key: string]: unknown;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
const ALL_CHANNELS = [
|
|
9
|
+
"render",
|
|
10
|
+
"effects",
|
|
11
|
+
"refs",
|
|
12
|
+
"edges",
|
|
13
|
+
"symbols",
|
|
14
|
+
"scopes",
|
|
15
|
+
"files",
|
|
16
|
+
"directories",
|
|
17
|
+
"scheduler",
|
|
18
|
+
"diagnostics",
|
|
19
|
+
"errors",
|
|
20
|
+
"lifecycle",
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
/** Subscribe to all channels on the given socket. */
|
|
24
|
+
export function subscribeAll(socket: WebSocket): void {
|
|
25
|
+
socket.send(JSON.stringify({ type: "subscribe", channels: ALL_CHANNELS }));
|
|
26
|
+
}
|
|
27
|
+
|
|
8
28
|
/**
|
|
9
29
|
* Creates a message collector that accumulates messages and provides utilities
|
|
10
30
|
* for waiting on conditions. Useful for tests with reactive updates.
|
|
31
|
+
*
|
|
32
|
+
* Returns a Promise because it waits for the subscription to be processed by
|
|
33
|
+
* the server before the caller starts rendering.
|
|
34
|
+
*
|
|
35
|
+
* @param channels - Optional list of channels to subscribe to. Defaults to all channels.
|
|
11
36
|
*/
|
|
12
|
-
export function createMessageCollector(
|
|
37
|
+
export async function createMessageCollector(
|
|
38
|
+
socket: WebSocket,
|
|
39
|
+
channels?: string[],
|
|
40
|
+
) {
|
|
41
|
+
socket.send(
|
|
42
|
+
JSON.stringify({ type: "subscribe", channels: channels ?? ALL_CHANNELS }),
|
|
43
|
+
);
|
|
44
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
13
45
|
let renderBuffer: DevtoolsMessage[] = [];
|
|
14
46
|
let flushBuffer: DevtoolsMessage[] = [];
|
|
15
47
|
const completedRenderBatches: DevtoolsMessage[][] = [];
|
|
@@ -186,18 +218,28 @@ export function createMessageCollector(socket: WebSocket) {
|
|
|
186
218
|
|
|
187
219
|
/**
|
|
188
220
|
* Filter messages to only include render tree messages (those starting with "render:")
|
|
221
|
+
* Excludes trace messages (those with triggerIds).
|
|
189
222
|
*/
|
|
190
223
|
export function filterRenderTreeMessages(
|
|
191
224
|
messages: DevtoolsMessage[],
|
|
192
225
|
): DevtoolsMessage[] {
|
|
193
|
-
return messages.filter(
|
|
226
|
+
return messages.filter(
|
|
227
|
+
(m) => m.type.startsWith("render") && !("triggerIds" in m),
|
|
228
|
+
);
|
|
194
229
|
}
|
|
195
230
|
|
|
196
231
|
/**
|
|
197
|
-
* Filter messages to only include effect debug messages
|
|
232
|
+
* Filter messages to only include effect/ref/edge debug messages.
|
|
233
|
+
* Excludes trace messages (those with triggerIds).
|
|
198
234
|
*/
|
|
199
235
|
export function filterEffectsMessages(
|
|
200
236
|
messages: DevtoolsMessage[],
|
|
201
237
|
): DevtoolsMessage[] {
|
|
202
|
-
return messages.filter(
|
|
238
|
+
return messages.filter(
|
|
239
|
+
(m) =>
|
|
240
|
+
(m.type.startsWith("effect:") ||
|
|
241
|
+
m.type.startsWith("ref:") ||
|
|
242
|
+
m.type.startsWith("edge:")) &&
|
|
243
|
+
!("triggerIds" in m),
|
|
244
|
+
);
|
|
203
245
|
}
|