@torpor/view 1.3.3 → 1.4.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/dist/{Effect-Bp-BIDDm.d.cts → Effect-Bi_nt6cx.d.cts} +16 -3
- package/dist/Effect-Bi_nt6cx.d.cts.map +1 -0
- package/dist/{Effect-VsIY2vPx.d.mts → Effect-Bi_nt6cx.d.mts} +16 -3
- package/dist/Effect-Bi_nt6cx.d.mts.map +1 -0
- package/dist/ListItemSpec-DFkYr2TE.d.cts +28 -0
- package/dist/ListItemSpec-DFkYr2TE.d.cts.map +1 -0
- package/dist/ListItemSpec-DFkYr2TE.d.mts +28 -0
- package/dist/ListItemSpec-DFkYr2TE.d.mts.map +1 -0
- package/dist/{AsyncOptions-BDtArmeL.d.mts → WatchOptions--xq-Gn4e.d.cts} +77 -4
- package/dist/WatchOptions--xq-Gn4e.d.cts.map +1 -0
- package/dist/{AsyncOptions-C_7mWR6F.d.cts → WatchOptions-DWF4EqB6.d.mts} +77 -4
- package/dist/WatchOptions-DWF4EqB6.d.mts.map +1 -0
- package/dist/compile.cjs +1299 -401
- package/dist/compile.d.cts +16 -12
- package/dist/compile.d.cts.map +1 -1
- package/dist/compile.d.mts +16 -12
- package/dist/compile.d.mts.map +1 -1
- package/dist/compile.mjs +1299 -401
- package/dist/compile.mjs.map +1 -1
- package/dist/dev.cjs +101 -51
- package/dist/dev.d.cts +33 -2
- package/dist/dev.d.cts.map +1 -1
- package/dist/dev.d.mts +33 -2
- package/dist/dev.d.mts.map +1 -1
- package/dist/dev.mjs +51 -2
- package/dist/dev.mjs.map +1 -1
- package/dist/{fromWebSocket-ERhd9KZR.mjs → fromWebSocket-B22DIys7.mjs} +11 -2
- package/dist/fromWebSocket-B22DIys7.mjs.map +1 -0
- package/dist/{fromWebSocket-Cdoghvmh.cjs → fromWebSocket-C56rkQpZ.cjs} +15 -0
- package/dist/index.cjs +605 -266
- package/dist/index.d.cts +36 -129
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +36 -129
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +593 -255
- package/dist/index.mjs.map +1 -1
- package/dist/runtime.iife.js +1 -1
- package/dist/ssr.cjs +122 -22
- package/dist/ssr.d.cts +46 -12
- package/dist/ssr.d.cts.map +1 -1
- package/dist/ssr.d.mts +46 -12
- package/dist/ssr.d.mts.map +1 -1
- package/dist/ssr.mjs +121 -23
- package/dist/ssr.mjs.map +1 -1
- package/dist/titleWarning-BMjLAXpn.mjs +72 -0
- package/dist/titleWarning-BMjLAXpn.mjs.map +1 -0
- package/dist/titleWarning-DXp4fK7q.cjs +87 -0
- package/package.json +2 -1
- package/dist/AsyncOptions-BDtArmeL.d.mts.map +0 -1
- package/dist/AsyncOptions-C_7mWR6F.d.cts.map +0 -1
- package/dist/Cleanup-D0wvGW5d.d.cts +0 -9
- package/dist/Cleanup-D0wvGW5d.d.cts.map +0 -1
- package/dist/Cleanup-D0wvGW5d.d.mts +0 -9
- package/dist/Cleanup-D0wvGW5d.d.mts.map +0 -1
- package/dist/Effect-Bp-BIDDm.d.cts.map +0 -1
- package/dist/Effect-VsIY2vPx.d.mts.map +0 -1
- package/dist/devContext-BulTn3U5.cjs +0 -27
- package/dist/devContext-ZNsPyOgB.mjs +0 -24
- package/dist/devContext-ZNsPyOgB.mjs.map +0 -1
- package/dist/fromWebSocket-ERhd9KZR.mjs.map +0 -1
package/dist/dev.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_titleWarning = require("./titleWarning-DXp4fK7q.cjs");
|
|
3
3
|
//#region src/dev/popDevBoundary.ts
|
|
4
4
|
function popDevBoundary() {
|
|
5
|
-
|
|
5
|
+
require_titleWarning.devContext.depth--;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/dev/pushDevBoundary.ts
|
|
@@ -11,42 +11,91 @@ function pushDevBoundary(type, name) {
|
|
|
11
11
|
type,
|
|
12
12
|
id: crypto.randomUUID(),
|
|
13
13
|
name,
|
|
14
|
-
depth:
|
|
14
|
+
depth: require_titleWarning.devContext.depth
|
|
15
15
|
};
|
|
16
|
-
if (
|
|
16
|
+
if (require_titleWarning.devContext.index === -1) require_titleWarning.devContext.boundaries.push(newBoundary);
|
|
17
17
|
else {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
require_titleWarning.devContext.boundaries.splice(require_titleWarning.devContext.index, 0, newBoundary);
|
|
19
|
+
require_titleWarning.devContext.index++;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
require_titleWarning.devContext.depth++;
|
|
22
22
|
return newBoundary;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
+
//#region src/dev/checkListKeys.ts
|
|
26
|
+
const warnedByRegion = /* @__PURE__ */ new WeakMap();
|
|
27
|
+
/**
|
|
28
|
+
* DEV-ONLY: warns when a keyed `@for` list contains duplicate `@key` values.
|
|
29
|
+
*
|
|
30
|
+
* `runListItems` matches old and new rows by key (first match wins), so
|
|
31
|
+
* duplicate keys make updates and removals hit the wrong rows, desyncing the
|
|
32
|
+
* DOM from the data. `setDevMode` installs this as
|
|
33
|
+
* `devContext.checkListKeys`; `runList` calls it only when
|
|
34
|
+
* `devContext.enabled`, so it is never bundled into a production app (this
|
|
35
|
+
* module is only reachable through the `@torpor/view/dev` entry point).
|
|
36
|
+
*
|
|
37
|
+
* `undefined`/`null` keys are the "unkeyed" case (rows are matched
|
|
38
|
+
* positionally) and are ignored.
|
|
39
|
+
*
|
|
40
|
+
* @param region The `@for` list's region, used to dedupe warnings per list.
|
|
41
|
+
* @param specs The new row specs, in order.
|
|
42
|
+
*/
|
|
43
|
+
function checkListKeys(region, specs) {
|
|
44
|
+
let seen;
|
|
45
|
+
for (let i = 0; i < specs.length; i++) {
|
|
46
|
+
const key = specs[i].key;
|
|
47
|
+
if (key === void 0 || key === null) continue;
|
|
48
|
+
if (seen === void 0) seen = /* @__PURE__ */ new Set();
|
|
49
|
+
if (!seen.has(key)) {
|
|
50
|
+
seen.add(key);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
let warned = warnedByRegion.get(region);
|
|
54
|
+
if (warned === void 0) {
|
|
55
|
+
warned = /* @__PURE__ */ new Set();
|
|
56
|
+
warnedByRegion.set(region, warned);
|
|
57
|
+
}
|
|
58
|
+
if (!warned.has(key)) {
|
|
59
|
+
warned.add(key);
|
|
60
|
+
console.warn(`[torpor] Duplicate @key value ${formatKey(key)} in a keyed @for list. Keys must be unique, or updates and removals will affect the wrong rows.`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function formatKey(key) {
|
|
65
|
+
try {
|
|
66
|
+
const json = JSON.stringify(key);
|
|
67
|
+
return json === void 0 ? String(key) : json;
|
|
68
|
+
} catch {
|
|
69
|
+
return String(key);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
25
73
|
//#region src/dev/setDevMode.ts
|
|
26
74
|
function setDevMode() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
75
|
+
require_titleWarning.devContext.enabled = true;
|
|
76
|
+
require_titleWarning.devContext.checkListKeys = checkListKeys;
|
|
77
|
+
require_titleWarning.devContext.format = () => {
|
|
78
|
+
return { boundaries: require_titleWarning.devContext.boundaries.map((b) => ({
|
|
30
79
|
type: b.type,
|
|
31
80
|
id: b.id,
|
|
32
81
|
name: b.name,
|
|
33
82
|
depth: b.depth
|
|
34
83
|
})) };
|
|
35
84
|
};
|
|
36
|
-
|
|
37
|
-
const boundary =
|
|
85
|
+
require_titleWarning.devContext.getDetails = (id) => {
|
|
86
|
+
const boundary = require_titleWarning.devContext.boundaries.find((b) => b.id === id);
|
|
38
87
|
if (boundary) switch (boundary.type) {
|
|
39
88
|
case "run": return String(boundary.target.run);
|
|
40
89
|
default: return "I'm a " + boundary.type;
|
|
41
90
|
}
|
|
42
91
|
return "??";
|
|
43
92
|
};
|
|
44
|
-
|
|
93
|
+
require_titleWarning.devContext.unmark = () => {
|
|
45
94
|
const el = document.getElementById("t_dev_mark");
|
|
46
95
|
if (el) el.style.display = "none";
|
|
47
96
|
};
|
|
48
|
-
|
|
49
|
-
const boundary =
|
|
97
|
+
require_titleWarning.devContext.mark = (id) => {
|
|
98
|
+
const boundary = require_titleWarning.devContext.boundaries.find((b) => b.id === id);
|
|
50
99
|
if (boundary && boundary.target?.startNode && boundary.target?.endNode) {
|
|
51
100
|
let el = document.getElementById("t_dev_mark");
|
|
52
101
|
if (!el) {
|
|
@@ -70,7 +119,7 @@ function setDevMode() {
|
|
|
70
119
|
}
|
|
71
120
|
};
|
|
72
121
|
let oldDepths = [];
|
|
73
|
-
|
|
122
|
+
require_titleWarning.devContext.onWatch = (proxy) => {
|
|
74
123
|
let keys = Object.keys(proxy.target);
|
|
75
124
|
if (keys.length > 5) keys = [...keys.slice(0, 5), "…"];
|
|
76
125
|
let name = keys.length > 0 ? `{ ${keys.join(", ")} }` : "{}";
|
|
@@ -78,16 +127,16 @@ function setDevMode() {
|
|
|
78
127
|
type: "watch",
|
|
79
128
|
id: crypto.randomUUID(),
|
|
80
129
|
name,
|
|
81
|
-
depth:
|
|
130
|
+
depth: require_titleWarning.devContext.depth,
|
|
82
131
|
target: proxy
|
|
83
132
|
};
|
|
84
|
-
if (
|
|
133
|
+
if (require_titleWarning.devContext.index === -1) require_titleWarning.devContext.boundaries.push(newBoundary);
|
|
85
134
|
else {
|
|
86
|
-
|
|
87
|
-
|
|
135
|
+
require_titleWarning.devContext.boundaries.splice(require_titleWarning.devContext.index, 0, newBoundary);
|
|
136
|
+
require_titleWarning.devContext.index++;
|
|
88
137
|
}
|
|
89
138
|
};
|
|
90
|
-
|
|
139
|
+
require_titleWarning.devContext.onRun = (effect) => {
|
|
91
140
|
let name = effect.name;
|
|
92
141
|
if (name === void 0) {
|
|
93
142
|
const details = String(effect.run);
|
|
@@ -101,17 +150,17 @@ function setDevMode() {
|
|
|
101
150
|
type: "run",
|
|
102
151
|
id: crypto.randomUUID(),
|
|
103
152
|
name,
|
|
104
|
-
depth:
|
|
153
|
+
depth: require_titleWarning.devContext.depth,
|
|
105
154
|
target: effect
|
|
106
155
|
};
|
|
107
|
-
if (
|
|
156
|
+
if (require_titleWarning.devContext.index === -1) require_titleWarning.devContext.boundaries.push(newBoundary);
|
|
108
157
|
else {
|
|
109
|
-
|
|
110
|
-
|
|
158
|
+
require_titleWarning.devContext.boundaries.splice(require_titleWarning.devContext.index, 0, newBoundary);
|
|
159
|
+
require_titleWarning.devContext.index++;
|
|
111
160
|
}
|
|
112
161
|
};
|
|
113
|
-
|
|
114
|
-
oldDepths.push(
|
|
162
|
+
require_titleWarning.devContext.onRegionPushed = (region, toParent) => {
|
|
163
|
+
oldDepths.push(require_titleWarning.devContext.depth);
|
|
115
164
|
if (toParent) {
|
|
116
165
|
const name = region.name || "Anon Region";
|
|
117
166
|
const id = crypto.randomUUID();
|
|
@@ -119,52 +168,52 @@ function setDevMode() {
|
|
|
119
168
|
type: "region",
|
|
120
169
|
id,
|
|
121
170
|
name,
|
|
122
|
-
depth:
|
|
171
|
+
depth: require_titleWarning.devContext.depth,
|
|
123
172
|
target: region
|
|
124
173
|
};
|
|
125
|
-
if (
|
|
174
|
+
if (require_titleWarning.devContext.index === -1) require_titleWarning.devContext.boundaries.push(newBoundary);
|
|
126
175
|
else {
|
|
127
|
-
|
|
128
|
-
|
|
176
|
+
require_titleWarning.devContext.boundaries.splice(require_titleWarning.devContext.index, 0, newBoundary);
|
|
177
|
+
require_titleWarning.devContext.index++;
|
|
129
178
|
}
|
|
130
179
|
region.name = `${name} [${id}]`;
|
|
131
|
-
|
|
180
|
+
require_titleWarning.devContext.depth++;
|
|
132
181
|
sendMessage({ name: "REFRESH" });
|
|
133
182
|
} else if (region.name) {
|
|
134
|
-
|
|
183
|
+
require_titleWarning.devContext.index = -1;
|
|
135
184
|
const match = region.name.match(/.+?\[(.+?)\]/);
|
|
136
185
|
if (match !== null && match.length > 0) {
|
|
137
186
|
let id = match[1];
|
|
138
|
-
let index =
|
|
187
|
+
let index = require_titleWarning.devContext.boundaries.findIndex((b) => b.id === id);
|
|
139
188
|
if (index !== -1) {
|
|
140
|
-
const parentDepth =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
while (
|
|
189
|
+
const parentDepth = require_titleWarning.devContext.boundaries[index].depth;
|
|
190
|
+
require_titleWarning.devContext.depth = parentDepth + 1;
|
|
191
|
+
require_titleWarning.devContext.index = index + 1;
|
|
192
|
+
while (require_titleWarning.devContext.index < require_titleWarning.devContext.boundaries.length && require_titleWarning.devContext.boundaries[require_titleWarning.devContext.index].depth > parentDepth) require_titleWarning.devContext.index++;
|
|
144
193
|
}
|
|
145
194
|
}
|
|
146
195
|
}
|
|
147
196
|
};
|
|
148
|
-
|
|
149
|
-
|
|
197
|
+
require_titleWarning.devContext.onRegionPopped = () => {
|
|
198
|
+
require_titleWarning.devContext.depth = oldDepths.pop() ?? 0;
|
|
150
199
|
};
|
|
151
|
-
|
|
200
|
+
require_titleWarning.devContext.onRegionCleared = (region) => {
|
|
152
201
|
let nextRegion = region;
|
|
153
202
|
while (true) {
|
|
154
203
|
if (nextRegion.name) {
|
|
155
204
|
let match = nextRegion.name.match(/.+?\[(.+?)\]/);
|
|
156
205
|
if (match !== null && match.length > 0) {
|
|
157
206
|
const id = match[1];
|
|
158
|
-
let i =
|
|
207
|
+
let i = require_titleWarning.devContext.boundaries.findIndex((b) => b.id === id);
|
|
159
208
|
if (i !== -1) {
|
|
160
|
-
let depth =
|
|
209
|
+
let depth = require_titleWarning.devContext.boundaries[i].depth;
|
|
161
210
|
let start = i;
|
|
162
|
-
let end =
|
|
163
|
-
for (i++; i <
|
|
211
|
+
let end = require_titleWarning.devContext.boundaries.length;
|
|
212
|
+
for (i++; i < require_titleWarning.devContext.boundaries.length; i++) if (require_titleWarning.devContext.boundaries[i].depth <= depth) {
|
|
164
213
|
end = i;
|
|
165
214
|
break;
|
|
166
215
|
}
|
|
167
|
-
|
|
216
|
+
require_titleWarning.devContext.boundaries.splice(start, end - start);
|
|
168
217
|
}
|
|
169
218
|
}
|
|
170
219
|
}
|
|
@@ -173,16 +222,16 @@ function setDevMode() {
|
|
|
173
222
|
}
|
|
174
223
|
sendMessage({ name: "REFRESH" });
|
|
175
224
|
};
|
|
176
|
-
|
|
177
|
-
const boundary =
|
|
225
|
+
require_titleWarning.devContext.signalSet = (proxy, key) => {
|
|
226
|
+
const boundary = require_titleWarning.devContext.boundaries.find((b) => b.target === proxy);
|
|
178
227
|
if (boundary !== void 0) sendMessage({
|
|
179
228
|
name: "Signal set",
|
|
180
229
|
id: boundary.id,
|
|
181
230
|
key: String(key)
|
|
182
231
|
});
|
|
183
232
|
};
|
|
184
|
-
|
|
185
|
-
const boundary =
|
|
233
|
+
require_titleWarning.devContext.effectRun = (effect) => {
|
|
234
|
+
const boundary = require_titleWarning.devContext.boundaries.find((b) => b.target === effect);
|
|
186
235
|
if (boundary !== void 0) sendMessage({
|
|
187
236
|
name: "Effect run",
|
|
188
237
|
id: boundary.id
|
|
@@ -196,7 +245,8 @@ function setDevMode() {
|
|
|
196
245
|
}
|
|
197
246
|
}
|
|
198
247
|
//#endregion
|
|
199
|
-
exports.devContext =
|
|
248
|
+
exports.devContext = require_titleWarning.devContext;
|
|
200
249
|
exports.setDevMode = setDevMode;
|
|
250
|
+
exports.t_dev_title = require_titleWarning.devTitle;
|
|
201
251
|
exports.t_pop_dev_bound = popDevBoundary;
|
|
202
252
|
exports.t_push_dev_bound = pushDevBoundary;
|
package/dist/dev.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { i as ProxySignal, n as Region, r as Computed, t as Effect } from "./Effect-
|
|
1
|
+
import { i as ProxySignal, n as Region, r as Computed, t as Effect } from "./Effect-Bi_nt6cx.cjs";
|
|
2
|
+
import { t as ListItemSpec } from "./ListItemSpec-DFkYr2TE.cjs";
|
|
2
3
|
//#region src/types/ProxyData.d.ts
|
|
3
4
|
interface ProxyData {
|
|
4
5
|
target: Record<PropertyKey, any>;
|
|
@@ -6,8 +7,21 @@ interface ProxyData {
|
|
|
6
7
|
isDate: boolean;
|
|
7
8
|
isMap: boolean;
|
|
8
9
|
isSet: boolean;
|
|
10
|
+
isUrl: boolean;
|
|
11
|
+
isUrlParams: boolean;
|
|
9
12
|
shallow: boolean;
|
|
10
13
|
signals: Map<PropertyKey, ProxySignal | Computed>;
|
|
14
|
+
/** For a watched URL: the watched proxy data of its live `searchParams` */
|
|
15
|
+
urlParamsData?: ProxyData;
|
|
16
|
+
/** For a watched URLSearchParams: the URL whose `searchParams` it is */
|
|
17
|
+
linkedUrlData?: ProxyData;
|
|
18
|
+
/**
|
|
19
|
+
* True when every object element of this watched array has already been
|
|
20
|
+
* replaced by its proxy (see `wrapArrayElements` in proxyGet), so read
|
|
21
|
+
* methods can skip re-scanning the array. Reset whenever a mutation can
|
|
22
|
+
* insert a raw element (index assignment, push/unshift/splice).
|
|
23
|
+
*/
|
|
24
|
+
elementsWrapped?: boolean;
|
|
11
25
|
}
|
|
12
26
|
//#endregion
|
|
13
27
|
//#region src/dev/types/DevBoundary.d.ts
|
|
@@ -36,6 +50,12 @@ interface DevContext {
|
|
|
36
50
|
onRegionCleared: (region: Region) => void;
|
|
37
51
|
signalSet: (proxy: ProxyData, key: PropertyKey) => void;
|
|
38
52
|
effectRun: (effect: Effect) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Warns about duplicate `@key` values in a keyed `@for` list. Installed by
|
|
55
|
+
* `setDevMode`; a no-op in production so the implementation stays in the
|
|
56
|
+
* dev entry point.
|
|
57
|
+
*/
|
|
58
|
+
checkListKeys: (region: Region, specs: ListItemSpec[]) => void;
|
|
39
59
|
}
|
|
40
60
|
//#endregion
|
|
41
61
|
//#region src/dev/devContext.d.ts
|
|
@@ -50,5 +70,16 @@ declare function pushDevBoundary(type: "component" | "region" | "run" | "watch"
|
|
|
50
70
|
//#region src/dev/setDevMode.d.ts
|
|
51
71
|
declare function setDevMode(): void;
|
|
52
72
|
//#endregion
|
|
53
|
-
|
|
73
|
+
//#region src/dev/titleWarning.d.ts
|
|
74
|
+
/**
|
|
75
|
+
* Tracks a component's `@head` title, from the code generated for dev
|
|
76
|
+
* builds. Call at render time, then `set` and `unset` from the title's
|
|
77
|
+
* effect.
|
|
78
|
+
*/
|
|
79
|
+
declare function devTitle(): {
|
|
80
|
+
set: (value: string) => void;
|
|
81
|
+
unset: () => void;
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { devContext, setDevMode, devTitle as t_dev_title, popDevBoundary as t_pop_dev_bound, pushDevBoundary as t_push_dev_bound };
|
|
54
85
|
//# sourceMappingURL=dev.d.cts.map
|
package/dist/dev.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.cts","names":[],"sources":["../src/types/ProxyData.ts","../src/dev/types/DevBoundary.ts","../src/dev/types/DevContext.ts","../src/dev/devContext.ts","../src/dev/popDevBoundary.ts","../src/dev/pushDevBoundary.ts","../src/dev/setDevMode.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.d.cts","names":[],"sources":["../src/types/ProxyData.ts","../src/dev/types/DevBoundary.ts","../src/dev/types/DevContext.ts","../src/dev/devContext.ts","../src/dev/popDevBoundary.ts","../src/dev/pushDevBoundary.ts","../src/dev/setDevMode.ts","../src/dev/titleWarning.ts"],"mappings":";;;UAGyB;EACxB,QAAQ,OAAO;EACf;EAIA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,IAAI,aAAa,cAAc;;EAExC,gBAAgB;;EAEhB,gBAAgB;;;;;;;EAOhB;;;;UC1BwB;EACxB;EACA;EACA;EACA;EACA;;;;UCCwB;EACxB;EACA;EACA;EACA,YAAY;EAEZ;EACA,aAAa;EACb;EACA,OAAO;EAGP,UAAU,OAAO;EACjB,QAAQ,QAAQ;EAChB,iBAAiB,QAAQ,QAAQ,mBAAmB;EACpD;EACA,kBAAkB,QAAQ;EAE1B,YAAY,OAAO,WAAW,KAAK;EACnC,YAAY,QAAQ;;;;;;EAOpB,gBAAgB,QAAQ,QAAQ,OAAO;;;;cCzBlC,YAAY;;;iBCLM;;;iBCCA,gBACvB,uEACA,eACE;;;iBCCqB;;;;;;;;iBCmCA;EAAc,MAAM;EAAwB"}
|
package/dist/dev.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { i as ProxySignal, n as Region, r as Computed, t as Effect } from "./Effect-
|
|
1
|
+
import { i as ProxySignal, n as Region, r as Computed, t as Effect } from "./Effect-Bi_nt6cx.mjs";
|
|
2
|
+
import { t as ListItemSpec } from "./ListItemSpec-DFkYr2TE.mjs";
|
|
2
3
|
//#region src/types/ProxyData.d.ts
|
|
3
4
|
interface ProxyData {
|
|
4
5
|
target: Record<PropertyKey, any>;
|
|
@@ -6,8 +7,21 @@ interface ProxyData {
|
|
|
6
7
|
isDate: boolean;
|
|
7
8
|
isMap: boolean;
|
|
8
9
|
isSet: boolean;
|
|
10
|
+
isUrl: boolean;
|
|
11
|
+
isUrlParams: boolean;
|
|
9
12
|
shallow: boolean;
|
|
10
13
|
signals: Map<PropertyKey, ProxySignal | Computed>;
|
|
14
|
+
/** For a watched URL: the watched proxy data of its live `searchParams` */
|
|
15
|
+
urlParamsData?: ProxyData;
|
|
16
|
+
/** For a watched URLSearchParams: the URL whose `searchParams` it is */
|
|
17
|
+
linkedUrlData?: ProxyData;
|
|
18
|
+
/**
|
|
19
|
+
* True when every object element of this watched array has already been
|
|
20
|
+
* replaced by its proxy (see `wrapArrayElements` in proxyGet), so read
|
|
21
|
+
* methods can skip re-scanning the array. Reset whenever a mutation can
|
|
22
|
+
* insert a raw element (index assignment, push/unshift/splice).
|
|
23
|
+
*/
|
|
24
|
+
elementsWrapped?: boolean;
|
|
11
25
|
}
|
|
12
26
|
//#endregion
|
|
13
27
|
//#region src/dev/types/DevBoundary.d.ts
|
|
@@ -36,6 +50,12 @@ interface DevContext {
|
|
|
36
50
|
onRegionCleared: (region: Region) => void;
|
|
37
51
|
signalSet: (proxy: ProxyData, key: PropertyKey) => void;
|
|
38
52
|
effectRun: (effect: Effect) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Warns about duplicate `@key` values in a keyed `@for` list. Installed by
|
|
55
|
+
* `setDevMode`; a no-op in production so the implementation stays in the
|
|
56
|
+
* dev entry point.
|
|
57
|
+
*/
|
|
58
|
+
checkListKeys: (region: Region, specs: ListItemSpec[]) => void;
|
|
39
59
|
}
|
|
40
60
|
//#endregion
|
|
41
61
|
//#region src/dev/devContext.d.ts
|
|
@@ -50,5 +70,16 @@ declare function pushDevBoundary(type: "component" | "region" | "run" | "watch"
|
|
|
50
70
|
//#region src/dev/setDevMode.d.ts
|
|
51
71
|
declare function setDevMode(): void;
|
|
52
72
|
//#endregion
|
|
53
|
-
|
|
73
|
+
//#region src/dev/titleWarning.d.ts
|
|
74
|
+
/**
|
|
75
|
+
* Tracks a component's `@head` title, from the code generated for dev
|
|
76
|
+
* builds. Call at render time, then `set` and `unset` from the title's
|
|
77
|
+
* effect.
|
|
78
|
+
*/
|
|
79
|
+
declare function devTitle(): {
|
|
80
|
+
set: (value: string) => void;
|
|
81
|
+
unset: () => void;
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { devContext, setDevMode, devTitle as t_dev_title, popDevBoundary as t_pop_dev_bound, pushDevBoundary as t_push_dev_bound };
|
|
54
85
|
//# sourceMappingURL=dev.d.mts.map
|
package/dist/dev.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.mts","names":[],"sources":["../src/types/ProxyData.ts","../src/dev/types/DevBoundary.ts","../src/dev/types/DevContext.ts","../src/dev/devContext.ts","../src/dev/popDevBoundary.ts","../src/dev/pushDevBoundary.ts","../src/dev/setDevMode.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.d.mts","names":[],"sources":["../src/types/ProxyData.ts","../src/dev/types/DevBoundary.ts","../src/dev/types/DevContext.ts","../src/dev/devContext.ts","../src/dev/popDevBoundary.ts","../src/dev/pushDevBoundary.ts","../src/dev/setDevMode.ts","../src/dev/titleWarning.ts"],"mappings":";;;UAGyB;EACxB,QAAQ,OAAO;EACf;EAIA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,IAAI,aAAa,cAAc;;EAExC,gBAAgB;;EAEhB,gBAAgB;;;;;;;EAOhB;;;;UC1BwB;EACxB;EACA;EACA;EACA;EACA;;;;UCCwB;EACxB;EACA;EACA;EACA,YAAY;EAEZ;EACA,aAAa;EACb;EACA,OAAO;EAGP,UAAU,OAAO;EACjB,QAAQ,QAAQ;EAChB,iBAAiB,QAAQ,QAAQ,mBAAmB;EACpD;EACA,kBAAkB,QAAQ;EAE1B,YAAY,OAAO,WAAW,KAAK;EACnC,YAAY,QAAQ;;;;;;EAOpB,gBAAgB,QAAQ,QAAQ,OAAO;;;;cCzBlC,YAAY;;;iBCLM;;;iBCCA,gBACvB,uEACA,eACE;;;iBCCqB;;;;;;;;iBCmCA;EAAc,MAAM;EAAwB"}
|
package/dist/dev.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as devContext, t as devTitle } from "./titleWarning-BMjLAXpn.mjs";
|
|
2
2
|
//#region src/dev/popDevBoundary.ts
|
|
3
3
|
function popDevBoundary() {
|
|
4
4
|
devContext.depth--;
|
|
@@ -21,9 +21,58 @@ function pushDevBoundary(type, name) {
|
|
|
21
21
|
return newBoundary;
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
|
+
//#region src/dev/checkListKeys.ts
|
|
25
|
+
const warnedByRegion = /* @__PURE__ */ new WeakMap();
|
|
26
|
+
/**
|
|
27
|
+
* DEV-ONLY: warns when a keyed `@for` list contains duplicate `@key` values.
|
|
28
|
+
*
|
|
29
|
+
* `runListItems` matches old and new rows by key (first match wins), so
|
|
30
|
+
* duplicate keys make updates and removals hit the wrong rows, desyncing the
|
|
31
|
+
* DOM from the data. `setDevMode` installs this as
|
|
32
|
+
* `devContext.checkListKeys`; `runList` calls it only when
|
|
33
|
+
* `devContext.enabled`, so it is never bundled into a production app (this
|
|
34
|
+
* module is only reachable through the `@torpor/view/dev` entry point).
|
|
35
|
+
*
|
|
36
|
+
* `undefined`/`null` keys are the "unkeyed" case (rows are matched
|
|
37
|
+
* positionally) and are ignored.
|
|
38
|
+
*
|
|
39
|
+
* @param region The `@for` list's region, used to dedupe warnings per list.
|
|
40
|
+
* @param specs The new row specs, in order.
|
|
41
|
+
*/
|
|
42
|
+
function checkListKeys(region, specs) {
|
|
43
|
+
let seen;
|
|
44
|
+
for (let i = 0; i < specs.length; i++) {
|
|
45
|
+
const key = specs[i].key;
|
|
46
|
+
if (key === void 0 || key === null) continue;
|
|
47
|
+
if (seen === void 0) seen = /* @__PURE__ */ new Set();
|
|
48
|
+
if (!seen.has(key)) {
|
|
49
|
+
seen.add(key);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
let warned = warnedByRegion.get(region);
|
|
53
|
+
if (warned === void 0) {
|
|
54
|
+
warned = /* @__PURE__ */ new Set();
|
|
55
|
+
warnedByRegion.set(region, warned);
|
|
56
|
+
}
|
|
57
|
+
if (!warned.has(key)) {
|
|
58
|
+
warned.add(key);
|
|
59
|
+
console.warn(`[torpor] Duplicate @key value ${formatKey(key)} in a keyed @for list. Keys must be unique, or updates and removals will affect the wrong rows.`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function formatKey(key) {
|
|
64
|
+
try {
|
|
65
|
+
const json = JSON.stringify(key);
|
|
66
|
+
return json === void 0 ? String(key) : json;
|
|
67
|
+
} catch {
|
|
68
|
+
return String(key);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
24
72
|
//#region src/dev/setDevMode.ts
|
|
25
73
|
function setDevMode() {
|
|
26
74
|
devContext.enabled = true;
|
|
75
|
+
devContext.checkListKeys = checkListKeys;
|
|
27
76
|
devContext.format = () => {
|
|
28
77
|
return { boundaries: devContext.boundaries.map((b) => ({
|
|
29
78
|
type: b.type,
|
|
@@ -195,6 +244,6 @@ function setDevMode() {
|
|
|
195
244
|
}
|
|
196
245
|
}
|
|
197
246
|
//#endregion
|
|
198
|
-
export { devContext, setDevMode, popDevBoundary as t_pop_dev_bound, pushDevBoundary as t_push_dev_bound };
|
|
247
|
+
export { devContext, setDevMode, devTitle as t_dev_title, popDevBoundary as t_pop_dev_bound, pushDevBoundary as t_push_dev_bound };
|
|
199
248
|
|
|
200
249
|
//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.mjs","names":[],"sources":["../src/dev/popDevBoundary.ts","../src/dev/pushDevBoundary.ts","../src/dev/setDevMode.ts"],"sourcesContent":["import devContext from \"./devContext\";\n\nexport default function popDevBoundary(): void {\n\tdevContext.depth--;\n}\n","import devContext from \"../dev/devContext\";\nimport DevBoundary from \"./types/DevBoundary\";\n\nexport default function pushDevBoundary(\n\ttype: \"component\" | \"region\" | \"run\" | \"watch\" | \"control\" | \"branch\",\n\tname: string,\n): DevBoundary {\n\tconst newBoundary = {\n\t\ttype,\n\t\tid: crypto.randomUUID(),\n\t\tname,\n\t\tdepth: devContext.depth,\n\t};\n\n\tif (devContext.index === -1) {\n\t\tdevContext.boundaries.push(newBoundary);\n\t} else {\n\t\tdevContext.boundaries.splice(devContext.index, 0, newBoundary);\n\t\tdevContext.index++;\n\t}\n\n\tdevContext.depth++;\n\n\treturn newBoundary;\n}\n","import type Effect from \"../types/Effect\";\nimport type ProxyData from \"../types/ProxyData\";\nimport type Region from \"../types/Region\";\nimport devContext from \"./devContext\";\nimport type DevBoundary from \"./types/DevBoundary\";\n\nexport default function setDevMode(): void {\n\tdevContext.enabled = true;\n\n\t// Format devContext for passing to DevTools by stripping out nodes etc\n\tdevContext.format = () => {\n\t\treturn {\n\t\t\tboundaries: devContext.boundaries.map((b) => ({\n\t\t\t\ttype: b.type,\n\t\t\t\tid: b.id,\n\t\t\t\tname: b.name,\n\t\t\t\tdepth: b.depth,\n\t\t\t\t//details: b.details,\n\t\t\t})),\n\t\t};\n\t};\n\n\tdevContext.getDetails = (id: string) => {\n\t\tconst boundary = devContext.boundaries.find((b) => b.id === id);\n\t\tif (boundary) {\n\t\t\tswitch (boundary.type) {\n\t\t\t\tcase \"run\": {\n\t\t\t\t\treturn String(boundary.target.run);\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\t// TODO:\n\t\t\t\t\treturn \"I'm a \" + boundary.type;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn \"??\";\n\t};\n\n\tdevContext.unmark = () => {\n\t\tconst el = document.getElementById(\"t_dev_mark\");\n\t\tif (el) {\n\t\t\tel.style.display = \"none\";\n\t\t}\n\t};\n\n\tdevContext.mark = (id: string) => {\n\t\tconst boundary = devContext.boundaries.find((b) => b.id === id);\n\t\tif (boundary && boundary.target?.startNode && boundary.target?.endNode) {\n\t\t\tlet el = document.getElementById(\"t_dev_mark\");\n\t\t\tif (!el) {\n\t\t\t\tel = document.createElement(\"div\");\n\t\t\t\tel.id = \"t_dev_mark\";\n\t\t\t\tel.style.position = \"absolute\";\n\t\t\t\tdocument.body.append(el);\n\t\t\t}\n\n\t\t\tconst range = document.createRange();\n\t\t\trange.setStartBefore(boundary.target.startNode);\n\t\t\trange.setEndAfter(boundary.target.endNode);\n\t\t\tconst rect = range.getBoundingClientRect();\n\n\t\t\tel.style.display = \"block\";\n\t\t\tel.style.left = rect.left + \"px\";\n\t\t\tel.style.top = rect.top + \"px\";\n\t\t\tel.style.height = rect.height + \"px\";\n\t\t\tel.style.width = rect.width + \"px\";\n\t\t\t//el.style.border = \"2px solid limegreen\";\n\t\t\tel.style.borderRadius = \"2px\";\n\t\t\tel.style.boxShadow = \"rgba(50, 205, 50, 0.5) 0px 0px 0px 3px\";\n\t\t\tel.style.pointerEvents = \"none\";\n\t\t}\n\t};\n\n\t// TODO: make this more robust\n\tlet oldDepths: number[] = [];\n\n\tdevContext.onWatch = (proxy: ProxyData) => {\n\t\tlet keys = Object.keys(proxy.target);\n\t\tif (keys.length > 5) {\n\t\t\tkeys = [...keys.slice(0, 5), \"…\"];\n\t\t}\n\t\tlet name = keys.length > 0 ? `{ ${keys.join(\", \")} }` : \"{}\";\n\t\tconst id = crypto.randomUUID();\n\t\tconst newBoundary = {\n\t\t\ttype: \"watch\",\n\t\t\tid,\n\t\t\tname,\n\t\t\tdepth: devContext.depth,\n\t\t\ttarget: proxy,\n\t\t} satisfies DevBoundary;\n\t\tif (devContext.index === -1) {\n\t\t\tdevContext.boundaries.push(newBoundary);\n\t\t} else {\n\t\t\tdevContext.boundaries.splice(devContext.index, 0, newBoundary);\n\t\t\tdevContext.index++;\n\t\t}\n\t};\n\n\tdevContext.onRun = (effect: Effect) => {\n\t\tlet name = effect.name;\n\t\tif (name === undefined) {\n\t\t\tconst details = String(effect.run);\n\t\t\tif (details.startsWith(\"function \")) {\n\t\t\t\tname = details.substring(9);\n\t\t\t\tname = name.substring(0, name.indexOf(\"(\"));\n\t\t\t}\n\t\t}\n\t\tif (name === undefined) {\n\t\t\tname = \"runAnon\";\n\t\t}\n\t\tconst id = crypto.randomUUID();\n\t\tconst newBoundary = {\n\t\t\ttype: \"run\",\n\t\t\tid,\n\t\t\tname,\n\t\t\tdepth: devContext.depth,\n\t\t\ttarget: effect,\n\t\t} satisfies DevBoundary;\n\t\tif (devContext.index === -1) {\n\t\t\tdevContext.boundaries.push(newBoundary);\n\t\t} else {\n\t\t\tdevContext.boundaries.splice(devContext.index, 0, newBoundary);\n\t\t\tdevContext.index++;\n\t\t}\n\t};\n\n\tdevContext.onRegionPushed = (region: Region, toParent: boolean) => {\n\t\toldDepths.push(devContext.depth);\n\t\tif (toParent) {\n\t\t\t// It's a new region; bump the depth etc\n\t\t\tconst name = region.name || \"Anon Region\";\n\t\t\tconst id = crypto.randomUUID();\n\t\t\tconst newBoundary = {\n\t\t\t\ttype: \"region\",\n\t\t\t\tid,\n\t\t\t\tname,\n\t\t\t\tdepth: devContext.depth,\n\t\t\t\ttarget: region,\n\t\t\t} satisfies DevBoundary;\n\t\t\tif (devContext.index === -1) {\n\t\t\t\tdevContext.boundaries.push(newBoundary);\n\t\t\t} else {\n\t\t\t\tdevContext.boundaries.splice(devContext.index, 0, newBoundary);\n\t\t\t\tdevContext.index++;\n\t\t\t}\n\t\t\t//pushDevBoundary(\"region\", name);\n\t\t\tregion.name = `${name} [${id}]`;\n\n\t\t\tdevContext.depth++;\n\n\t\t\tsendMessage({ name: \"REFRESH\" });\n\t\t} else if (region.name) {\n\t\t\tdevContext.index = -1;\n\n\t\t\t// It's an old region; get and set its depth and position for adding children\n\t\t\tconst match = region.name.match(/.+?\\[(.+?)\\]/);\n\t\t\tif (match !== null && match.length > 0) {\n\t\t\t\tlet id = match[1];\n\t\t\t\tlet index = devContext.boundaries.findIndex((b) => b.id === id);\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tconst parentDepth = devContext.boundaries[index].depth;\n\t\t\t\t\tdevContext.depth = parentDepth + 1;\n\t\t\t\t\t// The index needs to be after the last child of the parent\n\t\t\t\t\tdevContext.index = index + 1;\n\t\t\t\t\twhile (\n\t\t\t\t\t\tdevContext.index < devContext.boundaries.length &&\n\t\t\t\t\t\tdevContext.boundaries[devContext.index].depth > parentDepth\n\t\t\t\t\t) {\n\t\t\t\t\t\tdevContext.index++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tdevContext.onRegionPopped = () => {\n\t\t//popDevBoundary();\n\t\tdevContext.depth = oldDepths.pop() ?? 0;\n\t};\n\n\tdevContext.onRegionCleared = (region: Region) => {\n\t\tlet nextRegion: Region | null = region;\n\t\twhile (true) {\n\t\t\t// Some regions (e.g. @if branch content created via t_region()\n\t\t\t// without a label) have no name — skip the boundary lookup for\n\t\t\t// those but keep walking the chain.\n\t\t\tif (nextRegion.name) {\n\t\t\t\tlet match = nextRegion.name.match(/.+?\\[(.+?)\\]/);\n\t\t\t\tif (match !== null && match.length > 0) {\n\t\t\t\t\tconst id = match[1];\n\t\t\t\t\tlet i = devContext.boundaries.findIndex((b) => b.id === id);\n\t\t\t\t\tif (i !== -1) {\n\t\t\t\t\t\tlet depth = devContext.boundaries[i].depth;\n\t\t\t\t\t\tlet start = i;\n\t\t\t\t\t\tlet end = devContext.boundaries.length;\n\t\t\t\t\t\tfor (i++; i < devContext.boundaries.length; i++) {\n\t\t\t\t\t\t\tif (devContext.boundaries[i].depth <= depth) {\n\t\t\t\t\t\t\t\tend = i;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdevContext.boundaries.splice(start, end - start);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnextRegion = nextRegion.nextRegion;\n\t\t\tif (nextRegion === null || nextRegion.depth <= region.depth) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tsendMessage({ name: \"REFRESH\" });\n\t};\n\n\t// Messages\n\n\tdevContext.signalSet = (proxy: ProxyData, key: PropertyKey) => {\n\t\tconst boundary = devContext.boundaries.find((b) => b.target === proxy);\n\t\tif (boundary !== undefined) {\n\t\t\tsendMessage({ name: \"Signal set\", id: boundary.id, key: String(key) });\n\t\t}\n\t};\n\n\tdevContext.effectRun = (effect: Effect) => {\n\t\tconst boundary = devContext.boundaries.find((b) => b.target === effect);\n\t\tif (boundary !== undefined) {\n\t\t\tsendMessage({ name: \"Effect run\", id: boundary.id });\n\t\t}\n\t};\n\n\tfunction sendMessage(message: { name: string } & Record<string, string>) {\n\t\twindow.postMessage(\n\t\t\t{\n\t\t\t\tsource: \"t_dev_tools\",\n\t\t\t\tmessage: JSON.stringify(message),\n\t\t\t},\n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GAAG;KACvC,MAAM,KAAK,MAAM;KACjB,IAAI,IAAI,WAAW,WAAW,WAAW,MAAM,EAAE,OAAO,EAAE;KAC1D,IAAI,MAAM,IAAI;MACb,IAAI,QAAQ,WAAW,WAAW,EAAE,CAAC;MACrC,IAAI,QAAQ;MACZ,IAAI,MAAM,WAAW,WAAW;MAChC,KAAK,KAAK,IAAI,WAAW,WAAW,QAAQ,KAC3C,IAAI,WAAW,WAAW,EAAE,CAAC,SAAS,OAAO;OAC5C,MAAM;OACN;MACD;MAED,WAAW,WAAW,OAAO,OAAO,MAAM,KAAK;KAChD;IACD;GACD;GACA,aAAa,WAAW;GACxB,IAAI,eAAe,QAAQ,WAAW,SAAS,OAAO,OACrD;EAEF;EAEA,YAAY,EAAE,MAAM,UAAU,CAAC;CAChC;CAIA,WAAW,aAAa,OAAkB,QAAqB;EAC9D,MAAM,WAAW,WAAW,WAAW,MAAM,MAAM,EAAE,WAAW,KAAK;EACrE,IAAI,aAAa,KAAA,GAChB,YAAY;GAAE,MAAM;GAAc,IAAI,SAAS;GAAI,KAAK,OAAO,GAAG;EAAE,CAAC;CAEvE;CAEA,WAAW,aAAa,WAAmB;EAC1C,MAAM,WAAW,WAAW,WAAW,MAAM,MAAM,EAAE,WAAW,MAAM;EACtE,IAAI,aAAa,KAAA,GAChB,YAAY;GAAE,MAAM;GAAc,IAAI,SAAS;EAAG,CAAC;CAErD;CAEA,SAAS,YAAY,SAAoD;EACxE,OAAO,YACN;GACC,QAAQ;GACR,SAAS,KAAK,UAAU,OAAO;EAChC,GACA,GACD;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"dev.mjs","names":[],"sources":["../src/dev/popDevBoundary.ts","../src/dev/pushDevBoundary.ts","../src/dev/checkListKeys.ts","../src/dev/setDevMode.ts"],"sourcesContent":["import devContext from \"./devContext\";\n\nexport default function popDevBoundary(): void {\n\tdevContext.depth--;\n}\n","import devContext from \"../dev/devContext\";\nimport DevBoundary from \"./types/DevBoundary\";\n\nexport default function pushDevBoundary(\n\ttype: \"component\" | \"region\" | \"run\" | \"watch\" | \"control\" | \"branch\",\n\tname: string,\n): DevBoundary {\n\tconst newBoundary = {\n\t\ttype,\n\t\tid: crypto.randomUUID(),\n\t\tname,\n\t\tdepth: devContext.depth,\n\t};\n\n\tif (devContext.index === -1) {\n\t\tdevContext.boundaries.push(newBoundary);\n\t} else {\n\t\tdevContext.boundaries.splice(devContext.index, 0, newBoundary);\n\t\tdevContext.index++;\n\t}\n\n\tdevContext.depth++;\n\n\treturn newBoundary;\n}\n","import type ListItemSpec from \"../types/ListItemSpec\";\nimport type Region from \"../types/Region\";\n\n// Warn once per (list region, key value), so a list that re-renders on every\n// keystroke doesn't flood the console. Keyed by region identity because a\n// region is stable for the lifetime of one `@for` instance.\nconst warnedByRegion = new WeakMap<Region, Set<unknown>>();\n\n/**\n * DEV-ONLY: warns when a keyed `@for` list contains duplicate `@key` values.\n *\n * `runListItems` matches old and new rows by key (first match wins), so\n * duplicate keys make updates and removals hit the wrong rows, desyncing the\n * DOM from the data. `setDevMode` installs this as\n * `devContext.checkListKeys`; `runList` calls it only when\n * `devContext.enabled`, so it is never bundled into a production app (this\n * module is only reachable through the `@torpor/view/dev` entry point).\n *\n * `undefined`/`null` keys are the \"unkeyed\" case (rows are matched\n * positionally) and are ignored.\n *\n * @param region The `@for` list's region, used to dedupe warnings per list.\n * @param specs The new row specs, in order.\n */\nexport default function checkListKeys(region: Region, specs: ListItemSpec[]): void {\n\tlet seen: Set<unknown> | undefined;\n\tfor (let i = 0; i < specs.length; i++) {\n\t\tconst key = specs[i]!.key;\n\t\tif (key === undefined || key === null) continue;\n\n\t\tif (seen === undefined) seen = new Set();\n\t\tif (!seen.has(key)) {\n\t\t\tseen.add(key);\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet warned = warnedByRegion.get(region);\n\t\tif (warned === undefined) {\n\t\t\twarned = new Set();\n\t\t\twarnedByRegion.set(region, warned);\n\t\t}\n\t\tif (!warned.has(key)) {\n\t\t\twarned.add(key);\n\t\t\tconsole.warn(\n\t\t\t\t`[torpor] Duplicate @key value ${formatKey(key)} in a keyed @for list. ` +\n\t\t\t\t\t\"Keys must be unique, or updates and removals will affect the wrong rows.\",\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction formatKey(key: unknown): string {\n\ttry {\n\t\tconst json = JSON.stringify(key);\n\t\treturn json === undefined ? String(key) : json;\n\t} catch {\n\t\treturn String(key);\n\t}\n}\n","import type Effect from \"../types/Effect\";\nimport type ProxyData from \"../types/ProxyData\";\nimport type Region from \"../types/Region\";\nimport checkListKeys from \"./checkListKeys\";\nimport devContext from \"./devContext\";\nimport type DevBoundary from \"./types/DevBoundary\";\n\nexport default function setDevMode(): void {\n\tdevContext.enabled = true;\n\n\t// Install the dev-only implementation of the duplicate-@key warning. It\n\t// lives in this entry point (not in the runtime) so production apps never\n\t// bundle it; `runList` calls the no-op default when dev mode is off.\n\tdevContext.checkListKeys = checkListKeys;\n\n\t// Format devContext for passing to DevTools by stripping out nodes etc\n\tdevContext.format = () => {\n\t\treturn {\n\t\t\tboundaries: devContext.boundaries.map((b) => ({\n\t\t\t\ttype: b.type,\n\t\t\t\tid: b.id,\n\t\t\t\tname: b.name,\n\t\t\t\tdepth: b.depth,\n\t\t\t\t//details: b.details,\n\t\t\t})),\n\t\t};\n\t};\n\n\tdevContext.getDetails = (id: string) => {\n\t\tconst boundary = devContext.boundaries.find((b) => b.id === id);\n\t\tif (boundary) {\n\t\t\tswitch (boundary.type) {\n\t\t\t\tcase \"run\": {\n\t\t\t\t\treturn String(boundary.target.run);\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn \"I'm a \" + boundary.type;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn \"??\";\n\t};\n\n\tdevContext.unmark = () => {\n\t\tconst el = document.getElementById(\"t_dev_mark\");\n\t\tif (el) {\n\t\t\tel.style.display = \"none\";\n\t\t}\n\t};\n\n\tdevContext.mark = (id: string) => {\n\t\tconst boundary = devContext.boundaries.find((b) => b.id === id);\n\t\tif (boundary && boundary.target?.startNode && boundary.target?.endNode) {\n\t\t\tlet el = document.getElementById(\"t_dev_mark\");\n\t\t\tif (!el) {\n\t\t\t\tel = document.createElement(\"div\");\n\t\t\t\tel.id = \"t_dev_mark\";\n\t\t\t\tel.style.position = \"absolute\";\n\t\t\t\tdocument.body.append(el);\n\t\t\t}\n\n\t\t\tconst range = document.createRange();\n\t\t\trange.setStartBefore(boundary.target.startNode);\n\t\t\trange.setEndAfter(boundary.target.endNode);\n\t\t\tconst rect = range.getBoundingClientRect();\n\n\t\t\tel.style.display = \"block\";\n\t\t\tel.style.left = rect.left + \"px\";\n\t\t\tel.style.top = rect.top + \"px\";\n\t\t\tel.style.height = rect.height + \"px\";\n\t\t\tel.style.width = rect.width + \"px\";\n\t\t\t//el.style.border = \"2px solid limegreen\";\n\t\t\tel.style.borderRadius = \"2px\";\n\t\t\tel.style.boxShadow = \"rgba(50, 205, 50, 0.5) 0px 0px 0px 3px\";\n\t\t\tel.style.pointerEvents = \"none\";\n\t\t}\n\t};\n\n\t// TODO: make the dev-boundary depth tracking robust to unmatched pops\n\tlet oldDepths: number[] = [];\n\n\tdevContext.onWatch = (proxy: ProxyData) => {\n\t\tlet keys = Object.keys(proxy.target);\n\t\tif (keys.length > 5) {\n\t\t\tkeys = [...keys.slice(0, 5), \"…\"];\n\t\t}\n\t\tlet name = keys.length > 0 ? `{ ${keys.join(\", \")} }` : \"{}\";\n\t\tconst id = crypto.randomUUID();\n\t\tconst newBoundary = {\n\t\t\ttype: \"watch\",\n\t\t\tid,\n\t\t\tname,\n\t\t\tdepth: devContext.depth,\n\t\t\ttarget: proxy,\n\t\t} satisfies DevBoundary;\n\t\tif (devContext.index === -1) {\n\t\t\tdevContext.boundaries.push(newBoundary);\n\t\t} else {\n\t\t\tdevContext.boundaries.splice(devContext.index, 0, newBoundary);\n\t\t\tdevContext.index++;\n\t\t}\n\t};\n\n\tdevContext.onRun = (effect: Effect) => {\n\t\tlet name = effect.name;\n\t\tif (name === undefined) {\n\t\t\tconst details = String(effect.run);\n\t\t\tif (details.startsWith(\"function \")) {\n\t\t\t\tname = details.substring(9);\n\t\t\t\tname = name.substring(0, name.indexOf(\"(\"));\n\t\t\t}\n\t\t}\n\t\tif (name === undefined) {\n\t\t\tname = \"runAnon\";\n\t\t}\n\t\tconst id = crypto.randomUUID();\n\t\tconst newBoundary = {\n\t\t\ttype: \"run\",\n\t\t\tid,\n\t\t\tname,\n\t\t\tdepth: devContext.depth,\n\t\t\ttarget: effect,\n\t\t} satisfies DevBoundary;\n\t\tif (devContext.index === -1) {\n\t\t\tdevContext.boundaries.push(newBoundary);\n\t\t} else {\n\t\t\tdevContext.boundaries.splice(devContext.index, 0, newBoundary);\n\t\t\tdevContext.index++;\n\t\t}\n\t};\n\n\tdevContext.onRegionPushed = (region: Region, toParent: boolean) => {\n\t\toldDepths.push(devContext.depth);\n\t\tif (toParent) {\n\t\t\t// It's a new region; bump the depth etc\n\t\t\tconst name = region.name || \"Anon Region\";\n\t\t\tconst id = crypto.randomUUID();\n\t\t\tconst newBoundary = {\n\t\t\t\ttype: \"region\",\n\t\t\t\tid,\n\t\t\t\tname,\n\t\t\t\tdepth: devContext.depth,\n\t\t\t\ttarget: region,\n\t\t\t} satisfies DevBoundary;\n\t\t\tif (devContext.index === -1) {\n\t\t\t\tdevContext.boundaries.push(newBoundary);\n\t\t\t} else {\n\t\t\t\tdevContext.boundaries.splice(devContext.index, 0, newBoundary);\n\t\t\t\tdevContext.index++;\n\t\t\t}\n\t\t\t//pushDevBoundary(\"region\", name);\n\t\t\tregion.name = `${name} [${id}]`;\n\n\t\t\tdevContext.depth++;\n\n\t\t\tsendMessage({ name: \"REFRESH\" });\n\t\t} else if (region.name) {\n\t\t\tdevContext.index = -1;\n\n\t\t\t// It's an old region; get and set its depth and position for adding children\n\t\t\tconst match = region.name.match(/.+?\\[(.+?)\\]/);\n\t\t\tif (match !== null && match.length > 0) {\n\t\t\t\tlet id = match[1];\n\t\t\t\tlet index = devContext.boundaries.findIndex((b) => b.id === id);\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tconst parentDepth = devContext.boundaries[index].depth;\n\t\t\t\t\tdevContext.depth = parentDepth + 1;\n\t\t\t\t\t// The index needs to be after the last child of the parent\n\t\t\t\t\tdevContext.index = index + 1;\n\t\t\t\t\twhile (\n\t\t\t\t\t\tdevContext.index < devContext.boundaries.length &&\n\t\t\t\t\t\tdevContext.boundaries[devContext.index].depth > parentDepth\n\t\t\t\t\t) {\n\t\t\t\t\t\tdevContext.index++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tdevContext.onRegionPopped = () => {\n\t\t//popDevBoundary();\n\t\tdevContext.depth = oldDepths.pop() ?? 0;\n\t};\n\n\tdevContext.onRegionCleared = (region: Region) => {\n\t\tlet nextRegion: Region | null = region;\n\t\twhile (true) {\n\t\t\t// Some regions (e.g. @if branch content created via t_region()\n\t\t\t// without a label) have no name — skip the boundary lookup for\n\t\t\t// those but keep walking the chain.\n\t\t\tif (nextRegion.name) {\n\t\t\t\tlet match = nextRegion.name.match(/.+?\\[(.+?)\\]/);\n\t\t\t\tif (match !== null && match.length > 0) {\n\t\t\t\t\tconst id = match[1];\n\t\t\t\t\tlet i = devContext.boundaries.findIndex((b) => b.id === id);\n\t\t\t\t\tif (i !== -1) {\n\t\t\t\t\t\tlet depth = devContext.boundaries[i].depth;\n\t\t\t\t\t\tlet start = i;\n\t\t\t\t\t\tlet end = devContext.boundaries.length;\n\t\t\t\t\t\tfor (i++; i < devContext.boundaries.length; i++) {\n\t\t\t\t\t\t\tif (devContext.boundaries[i].depth <= depth) {\n\t\t\t\t\t\t\t\tend = i;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdevContext.boundaries.splice(start, end - start);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnextRegion = nextRegion.nextRegion;\n\t\t\tif (nextRegion === null || nextRegion.depth <= region.depth) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tsendMessage({ name: \"REFRESH\" });\n\t};\n\n\t// Messages\n\n\tdevContext.signalSet = (proxy: ProxyData, key: PropertyKey) => {\n\t\tconst boundary = devContext.boundaries.find((b) => b.target === proxy);\n\t\tif (boundary !== undefined) {\n\t\t\tsendMessage({ name: \"Signal set\", id: boundary.id, key: String(key) });\n\t\t}\n\t};\n\n\tdevContext.effectRun = (effect: Effect) => {\n\t\tconst boundary = devContext.boundaries.find((b) => b.target === effect);\n\t\tif (boundary !== undefined) {\n\t\t\tsendMessage({ name: \"Effect run\", id: boundary.id });\n\t\t}\n\t};\n\n\tfunction sendMessage(message: { name: string } & Record<string, string>) {\n\t\twindow.postMessage(\n\t\t\t{\n\t\t\t\tsource: \"t_dev_tools\",\n\t\t\t\tmessage: JSON.stringify(message),\n\t\t\t},\n\t\t\t\"*\",\n\t\t);\n\t}\n}\n"],"mappings":";;AAEA,SAAwB,iBAAuB;CAC9C,WAAW;AACZ;;;ACDA,SAAwB,gBACvB,MACA,MACc;CACd,MAAM,cAAc;EACnB;EACA,IAAI,OAAO,WAAW;EACtB;EACA,OAAO,WAAW;CACnB;CAEA,IAAI,WAAW,UAAU,IACxB,WAAW,WAAW,KAAK,WAAW;MAChC;EACN,WAAW,WAAW,OAAO,WAAW,OAAO,GAAG,WAAW;EAC7D,WAAW;CACZ;CAEA,WAAW;CAEX,OAAO;AACR;;;AClBA,MAAM,iCAAiB,IAAI,QAA8B;;;;;;;;;;;;;;;;;AAkBzD,SAAwB,cAAc,QAAgB,OAA6B;CAClF,IAAI;CACJ,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACtC,MAAM,MAAM,MAAM,EAAE,CAAE;EACtB,IAAI,QAAQ,KAAA,KAAa,QAAQ,MAAM;EAEvC,IAAI,SAAS,KAAA,GAAW,uBAA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
|
|
9
9
|
* with a user property name.
|
|
10
10
|
*/
|
|
11
11
|
const proxyKeysSymbol = Symbol.for("torp.ProxyKeys");
|
|
12
|
+
/**
|
|
13
|
+
* Signal key for a watched array's contents (element identity). Tracked by
|
|
14
|
+
* anything whose result depends on which elements are at which indexes —
|
|
15
|
+
* iteration, `slice`/`map`/`filter`/`find`/`indexOf`/`at`/`join`/… — and
|
|
16
|
+
* propagated by direct index writes, which replace an element without
|
|
17
|
+
* changing `length`. Kept separate from `length` so `items.length` readers
|
|
18
|
+
* don't re-run (e.g. every list) just because one element was replaced.
|
|
19
|
+
*/
|
|
20
|
+
const proxyArrayContentSymbol = Symbol.for("torp.ProxyArrayContent");
|
|
12
21
|
//#endregion
|
|
13
22
|
//#region src/watch/$unwrap.ts
|
|
14
23
|
/**
|
|
@@ -143,6 +152,6 @@ function fromWebSocket(url) {
|
|
|
143
152
|
};
|
|
144
153
|
}
|
|
145
154
|
//#endregion
|
|
146
|
-
export { buildStyles as a,
|
|
155
|
+
export { buildStyles as a, proxyArrayContentSymbol as c, formatText as i, proxyDataSymbol as l, fromServer as n, buildClasses as o, fromElement as r, $unwrap as s, fromWebSocket as t, proxyKeysSymbol as u };
|
|
147
156
|
|
|
148
|
-
//# sourceMappingURL=fromWebSocket-
|
|
157
|
+
//# sourceMappingURL=fromWebSocket-B22DIys7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromWebSocket-B22DIys7.mjs","names":[],"sources":["../src/watch/symbols.ts","../src/watch/$unwrap.ts","../src/render/buildClasses.ts","../src/render/buildStyles.ts","../src/render/formatText.ts","../src/stream/fromElement.ts","../src/stream/fromServer.ts","../src/stream/fromWebSocket.ts"],"sourcesContent":["const proxyDataSymbol: unique symbol = Symbol.for(\"torp.ProxyData\");\n\n/**\n * Signal key for a watched object's key-set membership (`ownKeys`). Tracked by\n * the proxy's `ownKeys` trap — so `Object.keys`/`values`/`entries`, spread,\n * `for…in` and `JSON.stringify` re-run when a key is added or deleted — and\n * propagated by the `set`/`deleteProperty` traps (and the array mutation\n * handles) when the key set actually changes. A Symbol so it can't collide\n * with a user property name.\n */\nconst proxyKeysSymbol: unique symbol = Symbol.for(\"torp.ProxyKeys\");\n\n/**\n * Signal key for a watched array's contents (element identity). Tracked by\n * anything whose result depends on which elements are at which indexes —\n * iteration, `slice`/`map`/`filter`/`find`/`indexOf`/`at`/`join`/… — and\n * propagated by direct index writes, which replace an element without\n * changing `length`. Kept separate from `length` so `items.length` readers\n * don't re-run (e.g. every list) just because one element was replaced.\n */\nconst proxyArrayContentSymbol: unique symbol = Symbol.for(\"torp.ProxyArrayContent\");\n\nexport { proxyDataSymbol, proxyKeysSymbol, proxyArrayContentSymbol };\n","import { proxyDataSymbol } from \"./symbols\";\n\n/**\n * Returns the target object of a proxy\n *\n * @param object The proxy object\n */\nexport default function $unwrap<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object !== undefined && object !== null && object[proxyDataSymbol] !== undefined\n\t\t? (object[proxyDataSymbol].target ?? object)\n\t\t: object;\n}\n","import ClassValue from \"../types/ClassValue\";\nimport $unwrap from \"../watch/$unwrap\";\n\nexport default function buildClasses(value: ClassValue, styleHash?: string): string {\n\tif (typeof value === \"string\") {\n\t\tif (styleHash !== undefined) {\n\t\t\tvalue += \" \" + styleHash;\n\t\t}\n\t\treturn value;\n\t} else {\n\t\tlet classes: string[] = [];\n\t\tgatherClasses(\"\", value, classes);\n\t\tif (styleHash !== undefined) {\n\t\t\tclasses.push(styleHash);\n\t\t}\n\t\treturn classes.join(\" \");\n\t}\n}\n\nfunction gatherClasses(name: string, value: unknown, classes: string[]) {\n\tif (value) {\n\t\t// Unwrap watched values before iterating: component props are\n\t\t// deep-wrapped, and iterating a watched array disables the active\n\t\t// effect (see the array iterator in proxyGet), which would break\n\t\t// tracking of reads later in the same effect. Per-element tracking is\n\t\t// unnecessary here anyway -- the caller has already subscribed to the\n\t\t// property read that produced the value\n\t\tvalue = $unwrap(value as Record<PropertyKey, any>);\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (let v of value) {\n\t\t\t\tgatherClasses(v as string, v, classes);\n\t\t\t}\n\t\t} else if (typeof value === \"object\") {\n\t\t\t// Use `for-in` instead of `Object.entries(value)`. The entries\n\t\t\t// call allocates a new array (plus a [k, v] pair per entry) on\n\t\t\t// every invocation; `for-in` allocates nothing. Object literals\n\t\t\t// (the dominant case — e.g. `{ danger: bool }` in the row\n\t\t\t// template) have no inherited enumerable properties, so the two\n\t\t\t// are equivalent for our usage. This is on the per-effect re-run\n\t\t\t// hot path: a `select` op re-runs every row effect, each calling\n\t\t\t// `buildClasses({ danger: ... })`.\n\t\t\tfor (const n in value) {\n\t\t\t\tgatherClasses(n, (value as Record<string, unknown>)[n], classes);\n\t\t\t}\n\t\t} else {\n\t\t\tclasses.push(name);\n\t\t}\n\t}\n}\n","import type StyleValue from \"../types/StyleValue\";\n\nconst CAMEL_TO_DASH = /[A-Z]+(?![a-z])|[A-Z]/g;\n\nexport default function buildStyles(value: StyleValue): string {\n\tif (typeof value === \"string\") {\n\t\treturn value;\n\t} else {\n\t\tlet styles: string[] = [];\n\t\tgatherStyles(value, styles);\n\t\treturn styles.join(\"; \");\n\t}\n}\n\nfunction gatherStyles(value: unknown, styles: string[]) {\n\tif (value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (let v of value) {\n\t\t\t\tgatherStyles(v, styles);\n\t\t\t}\n\t\t} else if (typeof value === \"object\") {\n\t\t\tfor (let [n, v] of Object.entries(value)) {\n\t\t\t\tif (v === null || v === undefined) continue;\n\t\t\t\tconst key = n.replace(CAMEL_TO_DASH, (char, i) => (i > 0 ? \"-\" : \"\") + char.toLowerCase());\n\t\t\t\tstyles.push(`${key}: ${v}`);\n\t\t\t}\n\t\t} else {\n\t\t\t// oxlint-disable-next-line typescript/no-base-to-string\n\t\t\tstyles.push(String(value));\n\t\t}\n\t}\n}\n","import $unwrap from \"../watch/$unwrap\";\n\nexport default function formatText(value: any): string {\n\t// We could have anything in value, so we need to\n\t// - use String(...) because Symbols can't be implicitly converted\n\t// - use $unwrap because Proxies can't be converted to a string\n\tif (value === undefined || value === null) {\n\t\treturn \"\";\n\t}\n\t// Fast path: strings already satisfy both concerns above. Skipping the\n\t// `String($unwrap(value))` pair saves two function calls per text\n\t// interpolation on the dominant `typeof value === \"string\"` branch —\n\t// e.g. row labels in js-framework-bench hit this on every effect run.\n\tif (typeof value === \"string\") {\n\t\treturn value;\n\t}\n\treturn String($unwrap(value));\n}\n","import type StreamSource from \"../types/StreamSource\";\n\n/**\n * The element to listen on, or a getter returning it. Use a getter for\n * `&ref`-bound variables — they are only assigned once the element is\n * created, and subscriptions start at mount time:\n *\n * ```torp\n * let saveButton: HTMLButtonElement;\n *\n * $stream(fromElement(() => saveButton, \"click\"), () => save());\n * ```\n */\ntype EventTargetInput = HTMLElement | (() => HTMLElement | null | undefined);\n\n/**\n * Creates a StreamSource that pushes DOM events of the given type from an\n * element.\n *\n * ```torp\n * $stream(fromElement(() => saveButton, \"click\"), (e) => {\n * \t$state.clicks.push(e);\n * });\n * ```\n */\nexport default function fromElement<E extends Event = Event>(\n\ttarget: EventTargetInput,\n\ttype: string,\n): StreamSource<E> {\n\treturn (push) => {\n\t\tconst el = typeof target === \"function\" ? target() : target;\n\t\tif (!el) {\n\t\t\tthrow new Error(\n\t\t\t\t'fromElement: element not found. When passing a &ref variable, wrap it in a getter: fromElement(() => buttonEl, \"click\")',\n\t\t\t);\n\t\t}\n\t\tconst listener = push as EventListener;\n\t\tel.addEventListener(type, listener);\n\t\treturn () => {\n\t\t\tel.removeEventListener(type, listener);\n\t\t};\n\t};\n}\n","import type StreamSource from \"../types/StreamSource\";\n\n/**\n * Creates a StreamSource that receives `message` events from a server-sent\n * events endpoint. The URL may be a getter, so reactive state can be read\n * inside it — when it changes, the connection is closed and re-opened:\n *\n * ```torp\n * $stream(fromServer(`/sse/${$props.id}`), (e) => {\n * \t$state.messages.push(e.data);\n * });\n * ```\n *\n * Reconnection is handled by `EventSource` itself; errors are not pushed —\n * a source that can fail should surface errors as values.\n */\nexport default function fromServer(url: string | (() => string)): StreamSource<MessageEvent> {\n\treturn (push) => {\n\t\tconst eventSource = new EventSource(typeof url === \"function\" ? url() : url);\n\t\teventSource.onmessage = push;\n\t\treturn () => {\n\t\t\teventSource.close();\n\t\t};\n\t};\n}\n","import type StreamSource from \"../types/StreamSource\";\n\n/**\n * Creates a StreamSource that receives `message` events from a WebSocket.\n * The URL may be a getter, so reactive state can be read inside it — when\n * it changes, the socket is closed and re-opened:\n *\n * ```torp\n * $stream(fromWebSocket(`/ws/${$props.id}`), (e) => {\n * \t$state.inbox.push(e.data);\n * });\n * ```\n *\n * Errors are not pushed — a source that can fail should surface errors as\n * values and own its own reconnection.\n */\nexport default function fromWebSocket(url: string | (() => string)): StreamSource<MessageEvent> {\n\treturn (push) => {\n\t\tconst socket = new WebSocket(typeof url === \"function\" ? url() : url);\n\t\tsocket.onmessage = push;\n\t\treturn () => {\n\t\t\tsocket.close();\n\t\t};\n\t};\n}\n"],"mappings":";AAAA,MAAM,kBAAiC,OAAO,IAAI,gBAAgB;;;;;;;;;AAUlE,MAAM,kBAAiC,OAAO,IAAI,gBAAgB;;;;;;;;;AAUlE,MAAM,0BAAyC,OAAO,IAAI,wBAAwB;;;;;;;;ACblF,SAAwB,QAA4C,QAAc;CACjF,OAAO,WAAW,KAAA,KAAa,WAAW,QAAQ,OAAO,qBAAqB,KAAA,IAC1E,OAAO,gBAAgB,CAAC,UAAU,SACnC;AACJ;;;ACRA,SAAwB,aAAa,OAAmB,WAA4B;CACnF,IAAI,OAAO,UAAU,UAAU;EAC9B,IAAI,cAAc,KAAA,GACjB,SAAS,MAAM;EAEhB,OAAO;CACR,OAAO;EACN,IAAI,UAAoB,CAAC;EACzB,cAAc,IAAI,OAAO,OAAO;EAChC,IAAI,cAAc,KAAA,GACjB,QAAQ,KAAK,SAAS;EAEvB,OAAO,QAAQ,KAAK,GAAG;CACxB;AACD;AAEA,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2HACD;EAED,MAAM,WAAW;EACjB,GAAG,iBAAiB,MAAM,QAAQ;EAClC,aAAa;GACZ,GAAG,oBAAoB,MAAM,QAAQ;EACtC;CACD;AACD;;;;;;;;;;;;;;;;;AC1BA,SAAwB,WAAW,KAA0D;CAC5F,QAAQ,SAAS;EAChB,MAAM,cAAc,IAAI,YAAY,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAG;EAC3E,YAAY,YAAY;EACxB,aAAa;GACZ,YAAY,MAAM;EACnB;CACD;AACD;;;;;;;;;;;;;;;;;ACRA,SAAwB,cAAc,KAA0D;CAC/F,QAAQ,SAAS;EAChB,MAAM,SAAS,IAAI,UAAU,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAG;EACpE,OAAO,YAAY;EACnB,aAAa;GACZ,OAAO,MAAM;EACd;CACD;AACD"}
|
|
@@ -9,6 +9,15 @@ const proxyDataSymbol = Symbol.for("torp.ProxyData");
|
|
|
9
9
|
* with a user property name.
|
|
10
10
|
*/
|
|
11
11
|
const proxyKeysSymbol = Symbol.for("torp.ProxyKeys");
|
|
12
|
+
/**
|
|
13
|
+
* Signal key for a watched array's contents (element identity). Tracked by
|
|
14
|
+
* anything whose result depends on which elements are at which indexes —
|
|
15
|
+
* iteration, `slice`/`map`/`filter`/`find`/`indexOf`/`at`/`join`/… — and
|
|
16
|
+
* propagated by direct index writes, which replace an element without
|
|
17
|
+
* changing `length`. Kept separate from `length` so `items.length` readers
|
|
18
|
+
* don't re-run (e.g. every list) just because one element was replaced.
|
|
19
|
+
*/
|
|
20
|
+
const proxyArrayContentSymbol = Symbol.for("torp.ProxyArrayContent");
|
|
12
21
|
//#endregion
|
|
13
22
|
//#region src/watch/$unwrap.ts
|
|
14
23
|
/**
|
|
@@ -185,6 +194,12 @@ Object.defineProperty(exports, "fromWebSocket", {
|
|
|
185
194
|
return fromWebSocket;
|
|
186
195
|
}
|
|
187
196
|
});
|
|
197
|
+
Object.defineProperty(exports, "proxyArrayContentSymbol", {
|
|
198
|
+
enumerable: true,
|
|
199
|
+
get: function() {
|
|
200
|
+
return proxyArrayContentSymbol;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
188
203
|
Object.defineProperty(exports, "proxyDataSymbol", {
|
|
189
204
|
enumerable: true,
|
|
190
205
|
get: function() {
|