@fluixi/devtools 0.2.0-alpha.2 → 0.2.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -2
- package/dist/callsite.cjs +72 -0
- package/dist/callsite.d.ts +22 -0
- package/dist/callsite.d.ts.map +1 -0
- package/dist/callsite.js +82 -0
- package/dist/callsite.mjs +51 -0
- package/dist/change-view.cjs +134 -0
- package/dist/change-view.d.ts +10 -0
- package/dist/change-view.d.ts.map +1 -0
- package/dist/change-view.js +102 -0
- package/dist/change-view.mjs +111 -0
- package/dist/copy.cjs +63 -0
- package/dist/copy.d.ts +9 -0
- package/dist/copy.d.ts.map +1 -0
- package/dist/copy.js +52 -0
- package/dist/copy.mjs +42 -0
- package/dist/describe.cjs +55 -0
- package/dist/describe.d.ts +3 -0
- package/dist/describe.d.ts.map +1 -0
- package/dist/describe.js +47 -0
- package/dist/describe.mjs +34 -0
- package/dist/detail-panel.cjs +307 -0
- package/dist/detail-panel.d.ts +17 -0
- package/dist/detail-panel.d.ts.map +1 -0
- package/dist/detail-panel.js +217 -0
- package/dist/detail-panel.mjs +284 -0
- package/dist/diff.cjs +225 -0
- package/dist/diff.d.ts +31 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +132 -0
- package/dist/diff.mjs +202 -0
- package/dist/dom.cjs +204 -0
- package/dist/dom.d.ts +81 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +269 -0
- package/dist/dom.mjs +183 -0
- package/dist/export.cjs +221 -0
- package/dist/export.d.ts +55 -0
- package/dist/export.d.ts.map +1 -0
- package/dist/export.js +90 -0
- package/dist/export.mjs +209 -0
- package/dist/float.cjs +232 -0
- package/dist/float.d.ts +54 -0
- package/dist/float.d.ts.map +1 -0
- package/dist/float.js +256 -0
- package/dist/float.mjs +211 -0
- package/dist/format.cjs +175 -0
- package/dist/format.d.ts +16 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +188 -0
- package/dist/format.mjs +154 -0
- package/dist/graph-view.cjs +893 -0
- package/dist/graph-view.d.ts +79 -2
- package/dist/graph-view.d.ts.map +1 -1
- package/dist/graph-view.js +866 -50
- package/dist/graph-view.mjs +870 -0
- package/dist/highlight.cjs +140 -0
- package/dist/highlight.d.ts +56 -0
- package/dist/highlight.d.ts.map +1 -0
- package/dist/highlight.js +154 -0
- package/dist/highlight.mjs +119 -0
- package/dist/history.cjs +95 -0
- package/dist/history.d.ts +59 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +85 -0
- package/dist/history.mjs +74 -0
- package/dist/hook.cjs +1562 -0
- package/dist/hook.d.ts +60 -0
- package/dist/hook.d.ts.map +1 -0
- package/dist/hook.js +142 -0
- package/dist/hook.mjs +1553 -0
- package/dist/index.cjs +4552 -0
- package/dist/index.d.ts +44 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -1
- package/dist/index.mjs +4544 -0
- package/dist/inspector.cjs +688 -0
- package/dist/inspector.d.ts +60 -0
- package/dist/inspector.d.ts.map +1 -0
- package/dist/inspector.js +415 -0
- package/dist/inspector.mjs +676 -0
- package/dist/instrument.cjs +497 -0
- package/dist/instrument.d.ts +147 -5
- package/dist/instrument.d.ts.map +1 -1
- package/dist/instrument.js +164 -44
- package/dist/instrument.mjs +487 -0
- package/dist/kind-filter.cjs +172 -0
- package/dist/kind-filter.d.ts +39 -0
- package/dist/kind-filter.d.ts.map +1 -0
- package/dist/kind-filter.js +151 -0
- package/dist/kind-filter.mjs +151 -0
- package/dist/menu.cjs +141 -0
- package/dist/menu.d.ts +37 -0
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +125 -0
- package/dist/menu.mjs +120 -0
- package/dist/observe.cjs +1352 -0
- package/dist/observe.d.ts +80 -0
- package/dist/observe.d.ts.map +1 -0
- package/dist/observe.js +893 -0
- package/dist/observe.mjs +1345 -0
- package/dist/palette.cjs +52 -0
- package/dist/palette.d.ts +11 -0
- package/dist/palette.d.ts.map +1 -0
- package/dist/palette.js +27 -0
- package/dist/palette.mjs +31 -0
- package/dist/path.cjs +45 -0
- package/dist/path.d.ts +19 -0
- package/dist/path.d.ts.map +1 -0
- package/dist/path.js +49 -0
- package/dist/path.mjs +24 -0
- package/dist/plugin.cjs +87 -0
- package/dist/plugin.d.ts +121 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +74 -0
- package/dist/plugin.mjs +66 -0
- package/dist/plugins/context.cjs +98 -0
- package/dist/plugins/context.d.ts +10 -0
- package/dist/plugins/context.d.ts.map +1 -0
- package/dist/plugins/context.js +80 -0
- package/dist/plugins/context.mjs +75 -0
- package/dist/plugins/directives.cjs +98 -0
- package/dist/plugins/directives.d.ts +25 -0
- package/dist/plugins/directives.d.ts.map +1 -0
- package/dist/plugins/directives.js +78 -0
- package/dist/plugins/directives.mjs +75 -0
- package/dist/plugins/index.cjs +162 -0
- package/dist/plugins/index.d.ts +7 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +9 -0
- package/dist/plugins/index.mjs +140 -0
- package/dist/source.cjs +111 -0
- package/dist/source.d.ts +72 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +153 -0
- package/dist/source.mjs +90 -0
- package/dist/timeline.cjs +350 -0
- package/dist/timeline.d.ts +30 -0
- package/dist/timeline.d.ts.map +1 -0
- package/dist/timeline.js +271 -0
- package/dist/timeline.mjs +327 -0
- package/dist/tree.cjs +574 -0
- package/dist/tree.d.ts +128 -0
- package/dist/tree.d.ts.map +1 -0
- package/dist/tree.js +645 -0
- package/dist/tree.mjs +551 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/value-pane.cjs +223 -0
- package/dist/value-pane.d.ts +10 -0
- package/dist/value-pane.d.ts.map +1 -0
- package/dist/value-pane.js +61 -0
- package/dist/value-pane.mjs +200 -0
- package/dist/wire.cjs +109 -0
- package/dist/wire.d.ts +100 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +93 -0
- package/dist/wire.mjs +89 -0
- package/package.json +17 -5
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/*! @fluixi/devtools v0.2.0-alpha.4 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/plugins/index.ts
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
CONTEXT: () => NAME2,
|
|
25
|
+
DIRECTIVES: () => NAME,
|
|
26
|
+
contextPlugin: () => contextPlugin,
|
|
27
|
+
directivesPlugin: () => directivesPlugin
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(index_exports);
|
|
30
|
+
|
|
31
|
+
// src/plugin.ts
|
|
32
|
+
var plugins = [];
|
|
33
|
+
function registerDevtoolsPlugin(plugin) {
|
|
34
|
+
const at = plugins.findIndex((p) => p.name === plugin.name);
|
|
35
|
+
if (at === -1) plugins.push(plugin);
|
|
36
|
+
else plugins[at] = plugin;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// src/plugins/directives.ts
|
|
40
|
+
var NAME = "directives";
|
|
41
|
+
function directivesOn(extra) {
|
|
42
|
+
return extra?.[NAME] ?? [];
|
|
43
|
+
}
|
|
44
|
+
function directiveBadge(notes) {
|
|
45
|
+
if (!notes.length) return void 0;
|
|
46
|
+
const first = notes[0];
|
|
47
|
+
const short = first.kind === "ref" ? "ref" : label(first);
|
|
48
|
+
return notes.length > 1 ? `${short} +${notes.length - 1}` : short;
|
|
49
|
+
}
|
|
50
|
+
function directiveRows(notes) {
|
|
51
|
+
return notes.map((note) => ({
|
|
52
|
+
label: label(note),
|
|
53
|
+
value: note.element,
|
|
54
|
+
...note.at ? { at: note.at } : {}
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
var label = (note) => note.kind === "ref" ? `ref ${note.name}` : `${note.kind}:${note.name}`;
|
|
58
|
+
var directivesPlugin = {
|
|
59
|
+
name: NAME,
|
|
60
|
+
collect(ctx) {
|
|
61
|
+
ctx.onDirective((report) => {
|
|
62
|
+
if (!report.target) return;
|
|
63
|
+
const held = ctx.elementAnnotation(report.target) ?? [];
|
|
64
|
+
const already = held.some((n) => n.kind === report.kind && n.name === report.name);
|
|
65
|
+
if (already) return;
|
|
66
|
+
held.push({
|
|
67
|
+
kind: report.kind,
|
|
68
|
+
name: report.name,
|
|
69
|
+
element: report.element,
|
|
70
|
+
...report.at ? { at: report.at } : {}
|
|
71
|
+
});
|
|
72
|
+
ctx.annotateElement(report.target, held);
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
rows(node) {
|
|
76
|
+
const notes = node.extra?.[NAME];
|
|
77
|
+
if (!notes?.length) return [];
|
|
78
|
+
return notes.map((note) => ({
|
|
79
|
+
label: label(note),
|
|
80
|
+
value: note.element,
|
|
81
|
+
...note.at ? { at: note.at } : {}
|
|
82
|
+
}));
|
|
83
|
+
},
|
|
84
|
+
elementRows(extra) {
|
|
85
|
+
return directiveRows(directivesOn(extra));
|
|
86
|
+
},
|
|
87
|
+
elementBadge(extra) {
|
|
88
|
+
return directiveBadge(directivesOn(extra));
|
|
89
|
+
},
|
|
90
|
+
badge(node) {
|
|
91
|
+
const notes = node.extra?.[NAME];
|
|
92
|
+
if (!notes?.length) return void 0;
|
|
93
|
+
const first = notes[0];
|
|
94
|
+
const short = first.kind === "ref" ? "ref" : label(first);
|
|
95
|
+
return notes.length > 1 ? `${short} +${notes.length - 1}` : short;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
registerDevtoolsPlugin(directivesPlugin);
|
|
99
|
+
|
|
100
|
+
// src/format.ts
|
|
101
|
+
function shorten(text, limit = 18) {
|
|
102
|
+
return text.length > limit ? `${text.slice(0, limit - 1)}…` : text;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// src/plugins/context.ts
|
|
106
|
+
var NAME2 = "context";
|
|
107
|
+
var contextPlugin = {
|
|
108
|
+
name: NAME2,
|
|
109
|
+
collect(ctx) {
|
|
110
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
111
|
+
ctx.onContext((report) => {
|
|
112
|
+
if (report.owner === void 0) return;
|
|
113
|
+
let node = nodes.get(report.id);
|
|
114
|
+
if (node === void 0) {
|
|
115
|
+
const label2 = report.name === "context" && report.ownerLabel ? `${report.ownerLabel} context` : report.name;
|
|
116
|
+
node = ctx.add({
|
|
117
|
+
label: label2,
|
|
118
|
+
kind: "context",
|
|
119
|
+
// A context is created at module scope with nothing running, so the only line it
|
|
120
|
+
// can carry is the one that provided or read it.
|
|
121
|
+
...report.at ? { source: report.at } : {},
|
|
122
|
+
// The router's own contexts are the framework's, and belong in its card rather
|
|
123
|
+
// than beside the ones the application wrote.
|
|
124
|
+
authored: report.at?.external !== true,
|
|
125
|
+
// Under whoever provided it. A context read with no provider above it belongs to
|
|
126
|
+
// the reader, which is the honest place for a default value.
|
|
127
|
+
createdIn: report.owner,
|
|
128
|
+
// Short on the card, whole in the inspector, the way every other node works.
|
|
129
|
+
...report.value !== void 0 ? { value: shorten(report.value), detail: report.value } : {}
|
|
130
|
+
});
|
|
131
|
+
nodes.set(report.id, node);
|
|
132
|
+
}
|
|
133
|
+
if (report.kind === "provide") ctx.retype(report.owner, "provider");
|
|
134
|
+
const held = ctx.annotation(report.owner) ?? [];
|
|
135
|
+
const already = held.some((n) => n.name === report.name && n.kind === report.kind);
|
|
136
|
+
if (already) return;
|
|
137
|
+
held.push({
|
|
138
|
+
name: report.name,
|
|
139
|
+
kind: report.kind,
|
|
140
|
+
...report.value !== void 0 ? { value: report.value } : {}
|
|
141
|
+
});
|
|
142
|
+
ctx.annotate(report.owner, held);
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
rows(node) {
|
|
146
|
+
const notes = node.extra?.[NAME2];
|
|
147
|
+
if (!notes?.length) return [];
|
|
148
|
+
return notes.map((note) => ({
|
|
149
|
+
label: note.kind === "provide" ? `provides ${note.name}` : `reads ${note.name}`,
|
|
150
|
+
...note.value !== void 0 ? { value: note.value } : {}
|
|
151
|
+
}));
|
|
152
|
+
},
|
|
153
|
+
badge(node) {
|
|
154
|
+
const notes = node.extra?.[NAME2];
|
|
155
|
+
if (!notes?.length) return void 0;
|
|
156
|
+
const given = notes.filter((n) => n.kind === "provide");
|
|
157
|
+
if (given.length === 1) return `provides ${given[0].name}`;
|
|
158
|
+
if (given.length > 1) return `provides ${given.length}`;
|
|
159
|
+
return notes.length === 1 ? `reads ${notes[0].name}` : `reads ${notes.length}`;
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
registerDevtoolsPlugin(contextPlugin);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import './directives.js';
|
|
2
|
+
import './context.js';
|
|
3
|
+
export { directivesPlugin, NAME as DIRECTIVES } from './directives.js';
|
|
4
|
+
export type { DirectiveNote } from './directives.js';
|
|
5
|
+
export { contextPlugin, NAME as CONTEXT } from './context.js';
|
|
6
|
+
export type { ContextNote } from './context.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAKA,OAAO,iBAAiB,CAAC;AACzB,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// The plugins that ship with devtools.
|
|
2
|
+
//
|
|
3
|
+
// Importing this registers them. Both halves of a plugin live in one module, so an agent in
|
|
4
|
+
// the page and a panel elsewhere import the same thing and each uses the half it can run.
|
|
5
|
+
// A host that wants none of them imports `../plugin.js` directly and registers its own.
|
|
6
|
+
import './directives.js';
|
|
7
|
+
import './context.js';
|
|
8
|
+
export { directivesPlugin, NAME as DIRECTIVES } from './directives.js';
|
|
9
|
+
export { contextPlugin, NAME as CONTEXT } from './context.js';
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/*! @fluixi/devtools v0.2.0-alpha.4 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
|
|
3
|
+
// src/plugin.ts
|
|
4
|
+
var plugins = [];
|
|
5
|
+
function registerDevtoolsPlugin(plugin) {
|
|
6
|
+
const at = plugins.findIndex((p) => p.name === plugin.name);
|
|
7
|
+
if (at === -1) plugins.push(plugin);
|
|
8
|
+
else plugins[at] = plugin;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/plugins/directives.ts
|
|
12
|
+
var NAME = "directives";
|
|
13
|
+
function directivesOn(extra) {
|
|
14
|
+
return extra?.[NAME] ?? [];
|
|
15
|
+
}
|
|
16
|
+
function directiveBadge(notes) {
|
|
17
|
+
if (!notes.length) return void 0;
|
|
18
|
+
const first = notes[0];
|
|
19
|
+
const short = first.kind === "ref" ? "ref" : label(first);
|
|
20
|
+
return notes.length > 1 ? `${short} +${notes.length - 1}` : short;
|
|
21
|
+
}
|
|
22
|
+
function directiveRows(notes) {
|
|
23
|
+
return notes.map((note) => ({
|
|
24
|
+
label: label(note),
|
|
25
|
+
value: note.element,
|
|
26
|
+
...note.at ? { at: note.at } : {}
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
var label = (note) => note.kind === "ref" ? `ref ${note.name}` : `${note.kind}:${note.name}`;
|
|
30
|
+
var directivesPlugin = {
|
|
31
|
+
name: NAME,
|
|
32
|
+
collect(ctx) {
|
|
33
|
+
ctx.onDirective((report) => {
|
|
34
|
+
if (!report.target) return;
|
|
35
|
+
const held = ctx.elementAnnotation(report.target) ?? [];
|
|
36
|
+
const already = held.some((n) => n.kind === report.kind && n.name === report.name);
|
|
37
|
+
if (already) return;
|
|
38
|
+
held.push({
|
|
39
|
+
kind: report.kind,
|
|
40
|
+
name: report.name,
|
|
41
|
+
element: report.element,
|
|
42
|
+
...report.at ? { at: report.at } : {}
|
|
43
|
+
});
|
|
44
|
+
ctx.annotateElement(report.target, held);
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
rows(node) {
|
|
48
|
+
const notes = node.extra?.[NAME];
|
|
49
|
+
if (!notes?.length) return [];
|
|
50
|
+
return notes.map((note) => ({
|
|
51
|
+
label: label(note),
|
|
52
|
+
value: note.element,
|
|
53
|
+
...note.at ? { at: note.at } : {}
|
|
54
|
+
}));
|
|
55
|
+
},
|
|
56
|
+
elementRows(extra) {
|
|
57
|
+
return directiveRows(directivesOn(extra));
|
|
58
|
+
},
|
|
59
|
+
elementBadge(extra) {
|
|
60
|
+
return directiveBadge(directivesOn(extra));
|
|
61
|
+
},
|
|
62
|
+
badge(node) {
|
|
63
|
+
const notes = node.extra?.[NAME];
|
|
64
|
+
if (!notes?.length) return void 0;
|
|
65
|
+
const first = notes[0];
|
|
66
|
+
const short = first.kind === "ref" ? "ref" : label(first);
|
|
67
|
+
return notes.length > 1 ? `${short} +${notes.length - 1}` : short;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
registerDevtoolsPlugin(directivesPlugin);
|
|
71
|
+
|
|
72
|
+
// src/format.ts
|
|
73
|
+
function shorten(text, limit = 18) {
|
|
74
|
+
return text.length > limit ? `${text.slice(0, limit - 1)}…` : text;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// src/plugins/context.ts
|
|
78
|
+
var NAME2 = "context";
|
|
79
|
+
var contextPlugin = {
|
|
80
|
+
name: NAME2,
|
|
81
|
+
collect(ctx) {
|
|
82
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
83
|
+
ctx.onContext((report) => {
|
|
84
|
+
if (report.owner === void 0) return;
|
|
85
|
+
let node = nodes.get(report.id);
|
|
86
|
+
if (node === void 0) {
|
|
87
|
+
const label2 = report.name === "context" && report.ownerLabel ? `${report.ownerLabel} context` : report.name;
|
|
88
|
+
node = ctx.add({
|
|
89
|
+
label: label2,
|
|
90
|
+
kind: "context",
|
|
91
|
+
// A context is created at module scope with nothing running, so the only line it
|
|
92
|
+
// can carry is the one that provided or read it.
|
|
93
|
+
...report.at ? { source: report.at } : {},
|
|
94
|
+
// The router's own contexts are the framework's, and belong in its card rather
|
|
95
|
+
// than beside the ones the application wrote.
|
|
96
|
+
authored: report.at?.external !== true,
|
|
97
|
+
// Under whoever provided it. A context read with no provider above it belongs to
|
|
98
|
+
// the reader, which is the honest place for a default value.
|
|
99
|
+
createdIn: report.owner,
|
|
100
|
+
// Short on the card, whole in the inspector, the way every other node works.
|
|
101
|
+
...report.value !== void 0 ? { value: shorten(report.value), detail: report.value } : {}
|
|
102
|
+
});
|
|
103
|
+
nodes.set(report.id, node);
|
|
104
|
+
}
|
|
105
|
+
if (report.kind === "provide") ctx.retype(report.owner, "provider");
|
|
106
|
+
const held = ctx.annotation(report.owner) ?? [];
|
|
107
|
+
const already = held.some((n) => n.name === report.name && n.kind === report.kind);
|
|
108
|
+
if (already) return;
|
|
109
|
+
held.push({
|
|
110
|
+
name: report.name,
|
|
111
|
+
kind: report.kind,
|
|
112
|
+
...report.value !== void 0 ? { value: report.value } : {}
|
|
113
|
+
});
|
|
114
|
+
ctx.annotate(report.owner, held);
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
rows(node) {
|
|
118
|
+
const notes = node.extra?.[NAME2];
|
|
119
|
+
if (!notes?.length) return [];
|
|
120
|
+
return notes.map((note) => ({
|
|
121
|
+
label: note.kind === "provide" ? `provides ${note.name}` : `reads ${note.name}`,
|
|
122
|
+
...note.value !== void 0 ? { value: note.value } : {}
|
|
123
|
+
}));
|
|
124
|
+
},
|
|
125
|
+
badge(node) {
|
|
126
|
+
const notes = node.extra?.[NAME2];
|
|
127
|
+
if (!notes?.length) return void 0;
|
|
128
|
+
const given = notes.filter((n) => n.kind === "provide");
|
|
129
|
+
if (given.length === 1) return `provides ${given[0].name}`;
|
|
130
|
+
if (given.length > 1) return `provides ${given.length}`;
|
|
131
|
+
return notes.length === 1 ? `reads ${notes[0].name}` : `reads ${notes.length}`;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
registerDevtoolsPlugin(contextPlugin);
|
|
135
|
+
export {
|
|
136
|
+
NAME2 as CONTEXT,
|
|
137
|
+
NAME as DIRECTIVES,
|
|
138
|
+
contextPlugin,
|
|
139
|
+
directivesPlugin
|
|
140
|
+
};
|
package/dist/source.cjs
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/source.ts
|
|
21
|
+
var source_exports = {};
|
|
22
|
+
__export(source_exports, {
|
|
23
|
+
componentSource: () => componentSource,
|
|
24
|
+
holeLocation: () => holeLocation,
|
|
25
|
+
installSourceMarker: () => installSourceMarker,
|
|
26
|
+
markComponentSource: () => markComponentSource,
|
|
27
|
+
markReactiveSource: () => markReactiveSource,
|
|
28
|
+
propsLocations: () => propsLocations,
|
|
29
|
+
takeReactiveSource: () => takeReactiveSource
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(source_exports);
|
|
32
|
+
var MARKER = "__fx_source";
|
|
33
|
+
var COMPONENT_MARKER = "__fx_component";
|
|
34
|
+
var HOLE_MARKER = "__fx_hole";
|
|
35
|
+
var PROPS_MARKER = "__fx_props";
|
|
36
|
+
var MARKS = "__FLUIXI_DEVTOOLS_MARKS__";
|
|
37
|
+
var host = globalThis;
|
|
38
|
+
var shared = host[MARKS] ?? {
|
|
39
|
+
pending: null,
|
|
40
|
+
expiring: false,
|
|
41
|
+
components: /* @__PURE__ */ new Map()
|
|
42
|
+
};
|
|
43
|
+
host[MARKS] = shared;
|
|
44
|
+
function markReactiveSource(file, line, column, name) {
|
|
45
|
+
const location = locate(file, line, column);
|
|
46
|
+
if (shared.pending && location.external && !shared.pending.location?.external) return;
|
|
47
|
+
shared.pending = { name, location };
|
|
48
|
+
shared.expiring = false;
|
|
49
|
+
}
|
|
50
|
+
function locate(file, line, column) {
|
|
51
|
+
const external = !!file && (/^([a-zA-Z]:)?[\\/]/.test(file) || file.includes("node_modules/"));
|
|
52
|
+
return external ? { file, line, column, external } : { file, line, column };
|
|
53
|
+
}
|
|
54
|
+
function markComponentSource(name, file, line, column) {
|
|
55
|
+
const seen = shared.components.get(name);
|
|
56
|
+
const next = locate(file, line, column);
|
|
57
|
+
if (seen === void 0) {
|
|
58
|
+
shared.components.set(name, next);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (!seen || seen.file !== file || seen.line !== line) shared.components.set(name, null);
|
|
62
|
+
}
|
|
63
|
+
function componentSource(name) {
|
|
64
|
+
return shared.components.get(name) ?? void 0;
|
|
65
|
+
}
|
|
66
|
+
function takeReactiveSource() {
|
|
67
|
+
const mark = shared.pending;
|
|
68
|
+
if (mark) {
|
|
69
|
+
if (mark.name !== void 0) shared.pending = { location: mark.location };
|
|
70
|
+
if (!shared.expiring) {
|
|
71
|
+
shared.expiring = true;
|
|
72
|
+
queueMicrotask(() => {
|
|
73
|
+
shared.expiring = false;
|
|
74
|
+
shared.pending = null;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return mark;
|
|
79
|
+
}
|
|
80
|
+
var HOLES = /* @__PURE__ */ new WeakMap();
|
|
81
|
+
var HOLE_TAG = "__fx_at";
|
|
82
|
+
function markHole(accessor, line, column, name) {
|
|
83
|
+
if (accessor && (typeof accessor === "object" || typeof accessor === "function")) {
|
|
84
|
+
const at = name === void 0 ? { line, column } : { line, column, name };
|
|
85
|
+
HOLES.set(accessor, at);
|
|
86
|
+
try {
|
|
87
|
+
Object.defineProperty(accessor, HOLE_TAG, { value: at, configurable: true });
|
|
88
|
+
} catch {
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
shared.pending = null;
|
|
92
|
+
return accessor;
|
|
93
|
+
}
|
|
94
|
+
var PROPS = /* @__PURE__ */ new WeakMap();
|
|
95
|
+
function markProps(props, at) {
|
|
96
|
+
if (props && typeof props === "object") PROPS.set(props, at);
|
|
97
|
+
return props;
|
|
98
|
+
}
|
|
99
|
+
function propsLocations(props) {
|
|
100
|
+
return props && typeof props === "object" ? PROPS.get(props) : void 0;
|
|
101
|
+
}
|
|
102
|
+
function holeLocation(accessor) {
|
|
103
|
+
if (!accessor || typeof accessor !== "object" && typeof accessor !== "function") return void 0;
|
|
104
|
+
return HOLES.get(accessor) ?? accessor[HOLE_TAG];
|
|
105
|
+
}
|
|
106
|
+
function installSourceMarker() {
|
|
107
|
+
if (typeof host[MARKER] !== "function") host[MARKER] = markReactiveSource;
|
|
108
|
+
if (typeof host[COMPONENT_MARKER] !== "function") host[COMPONENT_MARKER] = markComponentSource;
|
|
109
|
+
if (typeof host[HOLE_MARKER] !== "function") host[HOLE_MARKER] = markHole;
|
|
110
|
+
if (typeof host[PROPS_MARKER] !== "function") host[PROPS_MARKER] = markProps;
|
|
111
|
+
}
|
package/dist/source.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a reactive node was created.
|
|
3
|
+
*
|
|
4
|
+
* The compiler marks each creation site in development (`sourceLocations`) by calling the
|
|
5
|
+
* global installed here, just before the statement that makes the node. The instrumented
|
|
6
|
+
* primitive takes the mark and keeps it on the graph node.
|
|
7
|
+
*
|
|
8
|
+
* A single slot, not a stack: in `signal(compute(signal(1)))` the inner call takes the mark
|
|
9
|
+
* and the outer gets none, rather than claiming a location that is not its own.
|
|
10
|
+
*/
|
|
11
|
+
/** Where in the author's source a node was created. Every field is optional. */
|
|
12
|
+
export interface ReactiveSourceLocation {
|
|
13
|
+
file?: string;
|
|
14
|
+
line?: number;
|
|
15
|
+
column?: number;
|
|
16
|
+
/** The source text this came from, when the compiler recorded it. Refs carry it. */
|
|
17
|
+
name?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The node came from a dependency rather than from the project. Only ever set when the
|
|
20
|
+
* compiler was told to mark dependencies too; otherwise they carry no location at all.
|
|
21
|
+
*/
|
|
22
|
+
external?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Where this is in the compiled output, when the location above came from a source map.
|
|
25
|
+
*
|
|
26
|
+
* Both are worth having. The original says which component and which file; the compiled one
|
|
27
|
+
* says which of that component's bindings, because a template's holes all map back to the
|
|
28
|
+
* position the template opens at — one entry per emitted root is all the map has. Until
|
|
29
|
+
* that changes, the compiled line is the only thing that tells two bindings apart.
|
|
30
|
+
*/
|
|
31
|
+
compiled?: {
|
|
32
|
+
line?: number;
|
|
33
|
+
column?: number;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** A location, plus the variable name the source gave it when there was one. */
|
|
37
|
+
export interface ReactiveSourceMetadata {
|
|
38
|
+
name?: string;
|
|
39
|
+
location?: ReactiveSourceLocation;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Where each component was declared, by name.
|
|
43
|
+
*
|
|
44
|
+
* The graph sees the memo the compiler wraps a component in, and all that memo carries back
|
|
45
|
+
* is the name stamped on what the component returned — so name is the only key available.
|
|
46
|
+
* Two components sharing a name are recorded as ambiguous and reported as unknown, since a
|
|
47
|
+
* location pointing at the wrong file is worse than none.
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Record where the next node is about to be created. The compiler calls this; call it
|
|
51
|
+
* yourself only for a node the compiler cannot see, immediately before the primitive.
|
|
52
|
+
*/
|
|
53
|
+
export declare function markReactiveSource(file?: string, line?: number, column?: number, name?: string): void;
|
|
54
|
+
/** Record where a component was declared. The compiler calls this. */
|
|
55
|
+
export declare function markComponentSource(name: string, file?: string, line?: number, column?: number): void;
|
|
56
|
+
/** Where a component of this name was declared, when exactly one was. */
|
|
57
|
+
export declare function componentSource(name: string): ReactiveSourceLocation | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Reading keeps it for the rest of the turn.
|
|
60
|
+
*
|
|
61
|
+
* One statement can make several nodes: `createStore({ a, b })` builds a signal per key
|
|
62
|
+
* inside the framework, and all of them belong to the line that asked for the store. So the
|
|
63
|
+
* mark survives the read and is dropped on the next microtask, which is the end of the
|
|
64
|
+
* statement that left it as far as anything synchronous is concerned.
|
|
65
|
+
*/
|
|
66
|
+
export declare function takeReactiveSource(): ReactiveSourceMetadata | null;
|
|
67
|
+
/** Where the props of this object were written, when the compiler recorded them. */
|
|
68
|
+
export declare function propsLocations(props: unknown): Record<string, [number, number]> | undefined;
|
|
69
|
+
/** The hole an accessor came from, when the compiler marked it. */
|
|
70
|
+
export declare function holeLocation(accessor: unknown): ReactiveSourceLocation | undefined;
|
|
71
|
+
export declare function installSourceMarker(): void;
|
|
72
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gFAAgF;AAChF,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C;AAED,gFAAgF;AAChF,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CACnC;AAgCD;;;;;;;GAOG;AAGH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAQrG;AAYD,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAQrG;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS,CAEhF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,sBAAsB,GAAG,IAAI,CAelE;AA4CD,oFAAoF;AACpF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,GACb,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAE9C;AAED,mEAAmE;AACnE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,sBAAsB,GAAG,SAAS,CAGlF;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAK1C"}
|
package/dist/source.js
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a reactive node was created.
|
|
3
|
+
*
|
|
4
|
+
* The compiler marks each creation site in development (`sourceLocations`) by calling the
|
|
5
|
+
* global installed here, just before the statement that makes the node. The instrumented
|
|
6
|
+
* primitive takes the mark and keeps it on the graph node.
|
|
7
|
+
*
|
|
8
|
+
* A single slot, not a stack: in `signal(compute(signal(1)))` the inner call takes the mark
|
|
9
|
+
* and the outer gets none, rather than claiming a location that is not its own.
|
|
10
|
+
*/
|
|
11
|
+
/** Kept in step with SOURCE_MARKER and COMPONENT_MARKER in the compiler. */
|
|
12
|
+
const MARKER = '__fx_source';
|
|
13
|
+
const COMPONENT_MARKER = '__fx_component';
|
|
14
|
+
const HOLE_MARKER = '__fx_hole';
|
|
15
|
+
const PROPS_MARKER = '__fx_props';
|
|
16
|
+
const MARKS = '__FLUIXI_DEVTOOLS_MARKS__';
|
|
17
|
+
const host = globalThis;
|
|
18
|
+
const shared = host[MARKS] ?? {
|
|
19
|
+
pending: null,
|
|
20
|
+
expiring: false,
|
|
21
|
+
components: new Map(),
|
|
22
|
+
};
|
|
23
|
+
host[MARKS] = shared;
|
|
24
|
+
/**
|
|
25
|
+
* Where each component was declared, by name.
|
|
26
|
+
*
|
|
27
|
+
* The graph sees the memo the compiler wraps a component in, and all that memo carries back
|
|
28
|
+
* is the name stamped on what the component returned — so name is the only key available.
|
|
29
|
+
* Two components sharing a name are recorded as ambiguous and reported as unknown, since a
|
|
30
|
+
* location pointing at the wrong file is worse than none.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Record where the next node is about to be created. The compiler calls this; call it
|
|
34
|
+
* yourself only for a node the compiler cannot see, immediately before the primitive.
|
|
35
|
+
*/
|
|
36
|
+
export function markReactiveSource(file, line, column, name) {
|
|
37
|
+
const location = locate(file, line, column);
|
|
38
|
+
// With dependencies marked, `signal()` in the framework marks its own `createSignal` line
|
|
39
|
+
// in between the application's mark and the node it asked for. The call site is the useful
|
|
40
|
+
// location, so a dependency never takes a mark the project has already left unclaimed.
|
|
41
|
+
if (shared.pending && location.external && !shared.pending.location?.external)
|
|
42
|
+
return;
|
|
43
|
+
shared.pending = { name, location };
|
|
44
|
+
shared.expiring = false;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A project file is named relative to the project root, so anything absolute or under
|
|
48
|
+
* node_modules came from a dependency. Derived here rather than sent, so the mark the
|
|
49
|
+
* compiler emits stays the four arguments it has always been.
|
|
50
|
+
*/
|
|
51
|
+
function locate(file, line, column) {
|
|
52
|
+
const external = !!file && (/^([a-zA-Z]:)?[\\/]/.test(file) || file.includes('node_modules/'));
|
|
53
|
+
return external ? { file, line, column, external } : { file, line, column };
|
|
54
|
+
}
|
|
55
|
+
/** Record where a component was declared. The compiler calls this. */
|
|
56
|
+
export function markComponentSource(name, file, line, column) {
|
|
57
|
+
const seen = shared.components.get(name);
|
|
58
|
+
const next = locate(file, line, column);
|
|
59
|
+
if (seen === undefined) {
|
|
60
|
+
shared.components.set(name, next);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (!seen || seen.file !== file || seen.line !== line)
|
|
64
|
+
shared.components.set(name, null);
|
|
65
|
+
}
|
|
66
|
+
/** Where a component of this name was declared, when exactly one was. */
|
|
67
|
+
export function componentSource(name) {
|
|
68
|
+
return shared.components.get(name) ?? undefined;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Reading keeps it for the rest of the turn.
|
|
72
|
+
*
|
|
73
|
+
* One statement can make several nodes: `createStore({ a, b })` builds a signal per key
|
|
74
|
+
* inside the framework, and all of them belong to the line that asked for the store. So the
|
|
75
|
+
* mark survives the read and is dropped on the next microtask, which is the end of the
|
|
76
|
+
* statement that left it as far as anything synchronous is concerned.
|
|
77
|
+
*/
|
|
78
|
+
export function takeReactiveSource() {
|
|
79
|
+
const mark = shared.pending;
|
|
80
|
+
if (mark) {
|
|
81
|
+
// The variable name belongs to the node the author was declaring, not to the ones the
|
|
82
|
+
// framework built underneath it — `cart`, then two unnamed signals at the same line.
|
|
83
|
+
if (mark.name !== undefined)
|
|
84
|
+
shared.pending = { location: mark.location };
|
|
85
|
+
if (!shared.expiring) {
|
|
86
|
+
shared.expiring = true;
|
|
87
|
+
queueMicrotask(() => {
|
|
88
|
+
shared.expiring = false;
|
|
89
|
+
shared.pending = null;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return mark;
|
|
94
|
+
}
|
|
95
|
+
/** Never replaces an existing marker: two copies of devtools would each hold half the marks. */
|
|
96
|
+
/**
|
|
97
|
+
* Where each hole was written, by the accessor the compiler stamped. Keyed by the function,
|
|
98
|
+
* not a slot: it is built and read at different moments.
|
|
99
|
+
*/
|
|
100
|
+
const HOLES = new WeakMap();
|
|
101
|
+
/**
|
|
102
|
+
* Also written onto the accessor itself, because the runtime does not always hand the same
|
|
103
|
+
* object on to `insert`: hydration wraps an accessor so the cursor can be replaced when it
|
|
104
|
+
* is finally read. The wrapper copies this across, and the WeakMap alone would miss it.
|
|
105
|
+
*/
|
|
106
|
+
const HOLE_TAG = '__fx_at';
|
|
107
|
+
/** Returns the accessor, not a wrapper: it is the binding's value. */
|
|
108
|
+
function markHole(accessor, line, column, name) {
|
|
109
|
+
if (accessor && (typeof accessor === 'object' || typeof accessor === 'function')) {
|
|
110
|
+
const at = name === undefined ? { line, column } : { line, column, name };
|
|
111
|
+
HOLES.set(accessor, at);
|
|
112
|
+
try {
|
|
113
|
+
Object.defineProperty(accessor, HOLE_TAG, { value: at, configurable: true });
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// Frozen or a proxy that refuses writes; the WeakMap still covers the unwrapped case.
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// The template is being built, so whatever declaration left a mark is finished with. A
|
|
120
|
+
// mark outlives the statement that set it on purpose — a store's key signals are made
|
|
121
|
+
// inside the call and belong to its line — but a component body is one long synchronous
|
|
122
|
+
// run, and without this every node the template makes claimed the last signal's position.
|
|
123
|
+
shared.pending = null;
|
|
124
|
+
return accessor;
|
|
125
|
+
}
|
|
126
|
+
/** Where each prop of a component tag was written, by the props object it was passed in. */
|
|
127
|
+
const PROPS = new WeakMap();
|
|
128
|
+
/** Returns the props object untouched: it is what the component is about to be handed. */
|
|
129
|
+
function markProps(props, at) {
|
|
130
|
+
if (props && typeof props === 'object')
|
|
131
|
+
PROPS.set(props, at);
|
|
132
|
+
return props;
|
|
133
|
+
}
|
|
134
|
+
/** Where the props of this object were written, when the compiler recorded them. */
|
|
135
|
+
export function propsLocations(props) {
|
|
136
|
+
return props && typeof props === 'object' ? PROPS.get(props) : undefined;
|
|
137
|
+
}
|
|
138
|
+
/** The hole an accessor came from, when the compiler marked it. */
|
|
139
|
+
export function holeLocation(accessor) {
|
|
140
|
+
if (!accessor || (typeof accessor !== 'object' && typeof accessor !== 'function'))
|
|
141
|
+
return undefined;
|
|
142
|
+
return HOLES.get(accessor) ?? accessor[HOLE_TAG];
|
|
143
|
+
}
|
|
144
|
+
export function installSourceMarker() {
|
|
145
|
+
if (typeof host[MARKER] !== 'function')
|
|
146
|
+
host[MARKER] = markReactiveSource;
|
|
147
|
+
if (typeof host[COMPONENT_MARKER] !== 'function')
|
|
148
|
+
host[COMPONENT_MARKER] = markComponentSource;
|
|
149
|
+
if (typeof host[HOLE_MARKER] !== 'function')
|
|
150
|
+
host[HOLE_MARKER] = markHole;
|
|
151
|
+
if (typeof host[PROPS_MARKER] !== 'function')
|
|
152
|
+
host[PROPS_MARKER] = markProps;
|
|
153
|
+
}
|