@descryy/runtime-identity-grounding 0.2.0 → 0.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.
Files changed (49) hide show
  1. package/dist/element-identity.d.ts +41 -78
  2. package/dist/element-identity.d.ts.map +1 -1
  3. package/dist/element-identity.js +69 -64
  4. package/dist/element-identity.js.map +1 -1
  5. package/dist/fiber-probe.d.ts +25 -45
  6. package/dist/fiber-probe.d.ts.map +1 -1
  7. package/dist/fiber-probe.js +45 -84
  8. package/dist/fiber-probe.js.map +1 -1
  9. package/dist/framework-aware-grounder.d.ts +35 -0
  10. package/dist/framework-aware-grounder.d.ts.map +1 -0
  11. package/dist/framework-aware-grounder.js +58 -0
  12. package/dist/framework-aware-grounder.js.map +1 -0
  13. package/dist/framework-detector.d.ts +46 -0
  14. package/dist/framework-detector.d.ts.map +1 -0
  15. package/dist/framework-detector.js +89 -0
  16. package/dist/framework-detector.js.map +1 -0
  17. package/dist/graph-join.d.ts +18 -49
  18. package/dist/graph-join.d.ts.map +1 -1
  19. package/dist/graph-join.js +17 -42
  20. package/dist/graph-join.js.map +1 -1
  21. package/dist/identity-grounder.d.ts +12 -31
  22. package/dist/identity-grounder.d.ts.map +1 -1
  23. package/dist/identity-grounder.js +13 -26
  24. package/dist/identity-grounder.js.map +1 -1
  25. package/dist/identity-grounding.d.ts +20 -39
  26. package/dist/identity-grounding.d.ts.map +1 -1
  27. package/dist/identity-grounding.js +27 -44
  28. package/dist/identity-grounding.js.map +1 -1
  29. package/dist/index.d.ts +11 -6
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +7 -6
  32. package/dist/index.js.map +1 -1
  33. package/dist/owner-stack.d.ts +36 -65
  34. package/dist/owner-stack.d.ts.map +1 -1
  35. package/dist/owner-stack.js +33 -62
  36. package/dist/owner-stack.js.map +1 -1
  37. package/dist/vue-identity-grounder.d.ts +23 -0
  38. package/dist/vue-identity-grounder.d.ts.map +1 -0
  39. package/dist/vue-identity-grounder.js +28 -0
  40. package/dist/vue-identity-grounder.js.map +1 -0
  41. package/dist/vue-identity-grounding.d.ts +16 -0
  42. package/dist/vue-identity-grounding.d.ts.map +1 -0
  43. package/dist/vue-identity-grounding.js +110 -0
  44. package/dist/vue-identity-grounding.js.map +1 -0
  45. package/dist/vue-probe.d.ts +49 -0
  46. package/dist/vue-probe.d.ts.map +1 -0
  47. package/dist/vue-probe.js +95 -0
  48. package/dist/vue-probe.js.map +1 -0
  49. package/package.json +5 -5
@@ -1,9 +1,7 @@
1
1
  /**
2
2
  * The composed, page-driving surface — install once, then ask about a
3
- * selector.
4
- *
5
- * Everything hard here is a composition of parts this repo already owns,
6
- * deliberately:
3
+ * selector. Everything hard here is a composition of parts this repo
4
+ * already owns:
7
5
  *
8
6
  * | step | owner |
9
7
  * | --- | --- |
@@ -14,22 +12,15 @@
14
12
  * | source map, staleness, `reliability` | `createNodeSourceLocationResolver` (same) |
15
13
  * | decide what may be claimed | `identity-grounding.ts` (this package) |
16
14
  *
17
- * The only genuinely new machinery in this package is the fiber read and
18
- * the decision table. A second source-map resolver, a second stack parser
19
- * or a second URL-rewriting rule here would each be a copy that holds in
20
- * one place — this repo has measured that drift and says so in
21
- * `graph-correlator/src/symbol.ts` and `fixture-apps/roots.ts` alike.
22
- *
23
- * ## `resolveSourceRoot` is what makes the React 19 path work at all
15
+ * Only the fiber read and the decision table are genuinely new here — a
16
+ * second copy of any of the rest would be a copy that drifts.
24
17
  *
25
- * A React 19 owner stack names the bundle by its **browser URL**
26
- * (`http://127.0.0.1:41369/dev.js:21714:62`). `createNodeSourceLocation-
27
- * Resolver` resolves source maps from **disk**. `resolveSourceRoot` is the
28
- * existing bridge between those two coordinate systems
29
- * (`CollectorContext.resolveSourceRoot`, RT-023/RT-029), and without one
30
- * the React 19 path degrades honestly: the stack still parses, the frame
31
- * still names a position, and the answer comes back with
32
- * `authoredSource: false` and a `degraded` capability rather than a
18
+ * `resolveSourceRoot` is what makes the React 19 path work: a React 19
19
+ * owner stack names the bundle by browser URL
20
+ * (`http://127.0.0.1:41369/dev.js:21714:62`), but source maps resolve from
21
+ * disk. Without a resolver (`CollectorContext.resolveSourceRoot`,
22
+ * RT-023/RT-029), the path degrades honestly — the stack still parses, but
23
+ * the answer comes back `authoredSource: false` and `degraded`, never a
33
24
  * fabricated authored file. React 18 needs none of this — its location is
34
25
  * already authored, on the fiber.
35
26
  */
@@ -37,21 +28,11 @@ import type { SourceRootResolver } from "@descryy/runtime-contracts";
37
28
  import type { Page } from "playwright-core";
38
29
  import type { ElementIdentity } from "./element-identity.ts";
39
30
  export interface IdentityGrounderOptions {
40
- /**
41
- * Joins a browser origin to the on-disk directory it is served from, so a
42
- * React 19 owner stack's compiled frames can be mapped back to authored
43
- * source. Absent is a supported configuration, not a misconfiguration —
44
- * see this module's header.
45
- */
31
+ /** Joins a browser origin to the on-disk directory it's served from, so React 19's compiled frames map back to authored source. Absent is supported, not a misconfiguration. */
46
32
  readonly resolveSourceRoot?: SourceRootResolver;
47
33
  }
48
34
  export interface IdentityGrounder {
49
- /**
50
- * Installs the page-side reader into every document this page loads from
51
- * this point forward. **Call before navigating** — `page.addInitScript`
52
- * does not reach a document that is already loaded, and a page navigated
53
- * first reports `probe-not-installed` by name.
54
- */
35
+ /** Installs the page-side reader into every document this page loads from now on. Call before navigating — a page navigated first reports `probe-not-installed`. */
55
36
  install(page: Page): Promise<void>;
56
37
  /** Resolves one on-screen element to the component that produced it, and to that component's file and line where those can be established. Never throws for a routine unavailability; refuses by name instead. */
57
38
  ground(page: Page, selector: string): Promise<ElementIdentity>;
@@ -1 +1 @@
1
- {"version":3,"file":"identity-grounder.d.ts","sourceRoot":"","sources":["../src/identity-grounder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM,4BAA4B,CAAC;AAGjF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;CACjD;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,kNAAkN;IAClN,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAChE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,uBAA4B,GAAG,gBAAgB,CAyB9F"}
1
+ {"version":3,"file":"identity-grounder.d.ts","sourceRoot":"","sources":["../src/identity-grounder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM,4BAA4B,CAAC;AAGjF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,MAAM,WAAW,uBAAuB;IACtC,gLAAgL;IAChL,QAAQ,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;CACjD;AAED,MAAM,WAAW,gBAAgB;IAC/B,oKAAoK;IACpK,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,kNAAkN;IAClN,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAChE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,uBAA4B,GAAG,gBAAgB,CAqB9F"}
@@ -1,9 +1,7 @@
1
1
  /**
2
2
  * The composed, page-driving surface — install once, then ask about a
3
- * selector.
4
- *
5
- * Everything hard here is a composition of parts this repo already owns,
6
- * deliberately:
3
+ * selector. Everything hard here is a composition of parts this repo
4
+ * already owns:
7
5
  *
8
6
  * | step | owner |
9
7
  * | --- | --- |
@@ -14,22 +12,15 @@
14
12
  * | source map, staleness, `reliability` | `createNodeSourceLocationResolver` (same) |
15
13
  * | decide what may be claimed | `identity-grounding.ts` (this package) |
16
14
  *
17
- * The only genuinely new machinery in this package is the fiber read and
18
- * the decision table. A second source-map resolver, a second stack parser
19
- * or a second URL-rewriting rule here would each be a copy that holds in
20
- * one place — this repo has measured that drift and says so in
21
- * `graph-correlator/src/symbol.ts` and `fixture-apps/roots.ts` alike.
22
- *
23
- * ## `resolveSourceRoot` is what makes the React 19 path work at all
15
+ * Only the fiber read and the decision table are genuinely new here — a
16
+ * second copy of any of the rest would be a copy that drifts.
24
17
  *
25
- * A React 19 owner stack names the bundle by its **browser URL**
26
- * (`http://127.0.0.1:41369/dev.js:21714:62`). `createNodeSourceLocation-
27
- * Resolver` resolves source maps from **disk**. `resolveSourceRoot` is the
28
- * existing bridge between those two coordinate systems
29
- * (`CollectorContext.resolveSourceRoot`, RT-023/RT-029), and without one
30
- * the React 19 path degrades honestly: the stack still parses, the frame
31
- * still names a position, and the answer comes back with
32
- * `authoredSource: false` and a `degraded` capability rather than a
18
+ * `resolveSourceRoot` is what makes the React 19 path work: a React 19
19
+ * owner stack names the bundle by browser URL
20
+ * (`http://127.0.0.1:41369/dev.js:21714:62`), but source maps resolve from
21
+ * disk. Without a resolver (`CollectorContext.resolveSourceRoot`,
22
+ * RT-023/RT-029), the path degrades honestly — the stack still parses, but
23
+ * the answer comes back `authoredSource: false` and `degraded`, never a
33
24
  * fabricated authored file. React 18 needs none of this — its location is
34
25
  * already authored, on the fiber.
35
26
  */
@@ -41,13 +32,9 @@ export function createIdentityGrounder(options = {}) {
41
32
  const probe = createIdentityGroundingProbe();
42
33
  const parser = createV8StackTraceParser(createNodeSourceLocationResolver());
43
34
  const resolveOwnerStack = (rawStackText) => {
44
- // Rewritten before parsing, not after -- `script-url-mapping.ts`'s own
45
- // reasoning, reused rather than re-argued: the parser and its resolver
46
- // already know how to turn `at f (/abs/path.js:12:5)` into a resolved
47
- // location, and rewriting the text first lets all of that apply
48
- // unchanged. An unmapped URL is left exactly as the browser reported
49
- // it, which then resolves as a compiled location rather than a
50
- // fabricated file.
35
+ // Rewritten before parsing, not after, so the parser/resolver's
36
+ // existing path handling applies unchanged. An unmapped URL is left as
37
+ // the browser reported it, resolving as compiled rather than fabricated.
51
38
  const rewritten = rewriteScriptUrls(rawStackText, options.resolveSourceRoot);
52
39
  return parser.parse(rewritten.text);
53
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"identity-grounder.js","sourceRoot":"","sources":["../src/identity-grounder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAIjH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,eAAe,EAA2B,MAAM,yBAAyB,CAAC;AAwBnF,MAAM,UAAU,sBAAsB,CAAC,UAAmC,EAAE;IAC1E,MAAM,KAAK,GAAG,4BAA4B,EAAE,CAAC;IAC7C,MAAM,MAAM,GAAG,wBAAwB,CAAC,gCAAgC,EAAE,CAAC,CAAC;IAE5E,MAAM,iBAAiB,GAAuB,CAAC,YAAoB,EAA8B,EAAE;QACjG,uEAAuE;QACvE,uEAAuE;QACvE,sEAAsE;QACtE,gEAAgE;QAChE,qEAAqE;QACrE,+DAA+D;QAC/D,mBAAmB;QACnB,MAAM,SAAS,GAAG,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAC7E,OAAO,MAAM,CAAC,KAAK,C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CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,IAAU,EAAE,QAAgB;YACvC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC9C,OAAO,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC3D,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,53 +1,34 @@
1
1
  /**
2
2
  * The decision layer: raw fiber facts in, one `ElementIdentity` out.
3
3
  *
4
- * Pure with respect to the browser — it never touches a `Page`. Everything
5
- * it needs from the page arrives as a `RawFiberProbe`, and the one piece of
6
- * machinery it cannot own (turning a React 19 owner stack into a resolved
7
- * `StackTrace`, which needs source-map resolution and filesystem access) is
8
- * injected as `OwnerStackResolver`. That split is what lets every refusal
9
- * branch below be exercised as a plain unit test, with no Chromium and no
10
- * fixture app, while the fixture apps prove the two mechanisms end to end.
4
+ * Pure with respect to the browser — never touches a `Page`. The one piece
5
+ * of machinery it can't own (turning a React 19 owner stack into a resolved
6
+ * `StackTrace`) is injected as `OwnerStackResolver`, so every refusal
7
+ * branch below is a plain unit test, no Chromium needed.
11
8
  *
12
- * ## What this cannot do, stated once, in the place that decides it
9
+ * What this cannot do, decided here: a production React build (no
10
+ * `_debug*` survives, refused as `react-debug-fields-absent`); anything
11
+ * that isn't React (no fiber key — a scope boundary, not a gap, refused as
12
+ * "not React" rather than "unknown"); a React 19 bundle with no source map
13
+ * (reported with `authoredSource: false` and `degraded`, never dressed up);
14
+ * an anonymous component (refused — no symbol to look up, no name to act on).
13
15
  *
14
- * - **A production React build.** No `_debug*` field survives, and the
15
- * component name on the fiber is minified. Refused by name
16
- * (`react-debug-fields-absent`); see that value's own documentation.
17
- * - **Anything that is not React.** No fiber key, no answer. There is no
18
- * Vue/Svelte/Angular/Solid path here — not a gap in this module, a scope
19
- * boundary, and the refusal says "not React" rather than "unknown".
20
- * - **A React 19 bundle with no source map.** The owner stack still names a
21
- * real position, in compiled output. Reported with
22
- * `authoredSource: false` and a `degraded` capability, never dressed up
23
- * as the file a developer wrote.
24
- * - **An anonymous component.** Refused: there is no symbol for
25
- * `resolveSymbolNode` to look up and no name for a reader to act on.
26
- *
27
- * ## Owner versus renderer
28
- *
29
- * `component` is read from `_debugOwner` — the component whose render
30
- * *created* this element — because that is the component the source
31
- * location belongs to. `renderedBy` is the nearest component in the fiber
32
- * `return` chain, which is where the element ended up. They differ whenever
33
- * an element is created in one component and passed to another as
34
- * `children`; the fixture app renders that case deliberately. Both are
35
- * reported and neither is reconciled into the other.
16
+ * `component` is read from `_debugOwner` — whose render *created* the
17
+ * element, matching the source location. `renderedBy` is the nearest
18
+ * component in the `return` chain — where it ended up. They differ when an
19
+ * element is created in one component and passed to another as `children`
20
+ * (the fixture app renders this on purpose); both are reported, neither
21
+ * reconciled.
36
22
  */
37
23
  import { type StackTrace } from "@descryy/runtime-contracts";
38
24
  import { type ElementIdentity } from "./element-identity.ts";
39
25
  import type { RawFiberProbe } from "./fiber-probe.ts";
40
26
  /**
41
27
  * Turns React 19's raw `_debugStack` text into a resolved `StackTrace`, or
42
- * `null` when the text is not a V8 stack at all.
43
- *
44
- * Injected rather than constructed here because the real implementation is
45
- * a composition of three things this repo already owns and this package
46
- * must not re-own: `@descryy/runtime-browser`'s `rewriteScriptUrls` (browser
47
- * URL to on-disk path), and `@descryy/runtime-adapter-typescript`'s
48
- * `createV8StackTraceParser` plus `createNodeSourceLocationResolver`
49
- * (parsing, source-map resolution and the `reliability` classification —
50
- * including staleness detection). `identity-grounder.ts` wires them.
28
+ * `null` when it's not a V8 stack at all. Injected rather than constructed
29
+ * here, since the real implementation composes three things this package
30
+ * must not re-own: `rewriteScriptUrls`, `createV8StackTraceParser`, and
31
+ * `createNodeSourceLocationResolver`. `identity-grounder.ts` wires them.
51
32
  */
52
33
  export type OwnerStackResolver = (rawStackText: string) => Promise<StackTrace | null>;
53
34
  export declare function groundFromProbe(probe: RawFiberProbe, selector: string, resolveOwnerStack: OwnerStackResolver | null): Promise<ElementIdentity>;
@@ -1 +1 @@
1
- {"version":3,"file":"identity-grounding.d.ts","sourceRoot":"","sources":["../src/identity-grounding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExG,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAA0B,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG9E;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;AAOtF,wBAAsB,eAAe,CACnC,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,kBAAkB,GAAG,IAAI,GAC3C,OAAO,CAAC,eAAe,CAAC,CA4N1B"}
1
+ {"version":3,"file":"identity-grounding.d.ts","sourceRoot":"","sources":["../src/identity-grounding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExG,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAA0B,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG9E;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;AAOtF,wBAAsB,eAAe,CACnC,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,kBAAkB,GAAG,IAAI,GAC3C,OAAO,CAAC,eAAe,CAAC,CAyN1B"}
@@ -1,38 +1,24 @@
1
1
  /**
2
2
  * The decision layer: raw fiber facts in, one `ElementIdentity` out.
3
3
  *
4
- * Pure with respect to the browser — it never touches a `Page`. Everything
5
- * it needs from the page arrives as a `RawFiberProbe`, and the one piece of
6
- * machinery it cannot own (turning a React 19 owner stack into a resolved
7
- * `StackTrace`, which needs source-map resolution and filesystem access) is
8
- * injected as `OwnerStackResolver`. That split is what lets every refusal
9
- * branch below be exercised as a plain unit test, with no Chromium and no
10
- * fixture app, while the fixture apps prove the two mechanisms end to end.
4
+ * Pure with respect to the browser — never touches a `Page`. The one piece
5
+ * of machinery it can't own (turning a React 19 owner stack into a resolved
6
+ * `StackTrace`) is injected as `OwnerStackResolver`, so every refusal
7
+ * branch below is a plain unit test, no Chromium needed.
11
8
  *
12
- * ## What this cannot do, stated once, in the place that decides it
9
+ * What this cannot do, decided here: a production React build (no
10
+ * `_debug*` survives, refused as `react-debug-fields-absent`); anything
11
+ * that isn't React (no fiber key — a scope boundary, not a gap, refused as
12
+ * "not React" rather than "unknown"); a React 19 bundle with no source map
13
+ * (reported with `authoredSource: false` and `degraded`, never dressed up);
14
+ * an anonymous component (refused — no symbol to look up, no name to act on).
13
15
  *
14
- * - **A production React build.** No `_debug*` field survives, and the
15
- * component name on the fiber is minified. Refused by name
16
- * (`react-debug-fields-absent`); see that value's own documentation.
17
- * - **Anything that is not React.** No fiber key, no answer. There is no
18
- * Vue/Svelte/Angular/Solid path here — not a gap in this module, a scope
19
- * boundary, and the refusal says "not React" rather than "unknown".
20
- * - **A React 19 bundle with no source map.** The owner stack still names a
21
- * real position, in compiled output. Reported with
22
- * `authoredSource: false` and a `degraded` capability, never dressed up
23
- * as the file a developer wrote.
24
- * - **An anonymous component.** Refused: there is no symbol for
25
- * `resolveSymbolNode` to look up and no name for a reader to act on.
26
- *
27
- * ## Owner versus renderer
28
- *
29
- * `component` is read from `_debugOwner` — the component whose render
30
- * *created* this element — because that is the component the source
31
- * location belongs to. `renderedBy` is the nearest component in the fiber
32
- * `return` chain, which is where the element ended up. They differ whenever
33
- * an element is created in one component and passed to another as
34
- * `children`; the fixture app renders that case deliberately. Both are
35
- * reported and neither is reconciled into the other.
16
+ * `component` is read from `_debugOwner` — whose render *created* the
17
+ * element, matching the source location. `renderedBy` is the nearest
18
+ * component in the `return` chain — where it ended up. They differ when an
19
+ * element is created in one component and passed to another as `children`
20
+ * (the fixture app renders this on purpose); both are reported, neither
21
+ * reconciled.
36
22
  */
37
23
  import { locationNamesNothing } from "@descryy/runtime-contracts";
38
24
  import { capabilityFor, } from "./element-identity.js";
@@ -77,19 +63,18 @@ export async function groundFromProbe(probe, selector, resolveOwnerStack) {
77
63
  observedTypeName: null,
78
64
  reason: `neither the element matched by "${selector}" nor any of its ancestors carries a React fiber key ` +
79
65
  `(${probe.ownKeys.length === 0 ? "the element has no own enumerable keys at all" : `own keys: ${probe.ownKeys.join(", ")}`}). ` +
80
- "This page's DOM was not produced by React, or not by a React that tags host nodes. Identity grounding is " +
81
- "React-only; there is no Vue, Svelte, Angular or Solid equivalent in this package, which is a scope " +
82
- "boundary and not a temporary gap.",
66
+ "This page's DOM was not produced by React, or not by a React that tags host nodes. This resolver " +
67
+ "(`groundFromProbe`) is React-only — `groundFromVueProbe` (`vue-identity-grounding.ts`) is this " +
68
+ "package's Vue reader, on the same `ElementIdentity` vocabulary; Svelte, Angular and Solid remain a scope " +
69
+ "boundary, not a temporary gap (RG-15: one framework extension at a time).",
83
70
  capability: capabilityFor("unavailable", "no React fiber on the element or any ancestor — not a React tree."),
84
71
  };
85
72
  }
86
73
  const { fiberDistance } = probe;
87
74
  if (probe.debugFields.length === 0) {
88
- // The queried node is usually a *host* fiber whose `type` is the tag
89
- // name string ("button"), so the minified identifier a reader wants to
90
- // see lives on the nearest component above it, not here. Both are
91
- // consulted, in that order, and the result is still not a component
92
- // name -- see `ElementIdentityRefused.observedTypeName`.
75
+ // The queried node is usually a host fiber whose `type` is a tag name
76
+ // string, so the minified identifier lives on the nearest component
77
+ // above it. Consulted in that order — still not a component name.
93
78
  const observedTypeName = probe.observedTypeName ?? probe.returnChainComponent?.name ?? probe.owner?.name ?? null;
94
79
  return {
95
80
  outcome: "refused",
@@ -132,7 +117,7 @@ export async function groundFromProbe(probe, selector, resolveOwnerStack) {
132
117
  };
133
118
  }
134
119
  const renderedBy = returnChain;
135
- // ---- React 18 and earlier: the authored location is on the fiber. ----
120
+ // React 18 and earlier: the authored location is on the fiber.
136
121
  const debugSource = probe.debugSource;
137
122
  if (debugSource !== null && debugSource.fileName !== null) {
138
123
  const sourceLocation = {
@@ -140,10 +125,8 @@ export async function groundFromProbe(probe, selector, resolveOwnerStack) {
140
125
  line: debugSource.lineNumber,
141
126
  column: debugSource.columnNumber,
142
127
  functionName: component.name,
143
- // The application's own recorded creation site, not a translation
144
- // through a side artifact -- the same class `node-source-location-
145
- // resolver.ts` gives a frame with no `sourceMappingURL`: nothing was
146
- // lost, this IS the accurate answer.
128
+ // The app's own recorded creation site, not a translation through a
129
+ // side artifact — nothing was lost, this IS the accurate answer.
147
130
  reliability: "self-contained",
148
131
  resolvedVia: null,
149
132
  };
@@ -163,7 +146,7 @@ export async function groundFromProbe(probe, selector, resolveOwnerStack) {
163
146
  : capabilityFor("available"),
164
147
  };
165
148
  }
166
- // ---- React 19: an owner stack in compiled coordinates. ----
149
+ // React 19: an owner stack in compiled coordinates.
167
150
  const stackText = probe.debugStackText;
168
151
  if (stackText !== null) {
169
152
  if (resolveOwnerStack === null) {
@@ -1 +1 @@
1
- {"version":3,"file":"identity-grounding.js","sourceRoot":"","sources":["../src/identity-grounding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,oBAAoB,EAAwC,MAAM,4BAA4B,CAAC;AAExG,OAAO,EACL,aAAa,GAId,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAgBpD,SAAS,i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AAwB;IACpD,IAAI,QAAQ,CAAC,WAAW,KAAK,qBAAqB,EAAE,CAAC;QACnD,OAAO,aAAa,CAClB,UAAU,EACV,mCAAmC,QAAQ,CAAC,WAAW,IAAI,cAAc,6BAA6B;YACpG,yGAAyG;YACzG,wBAAwB,CAC3B,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,CAAC,WAAW,KAAK,wBAAwB,EAAE,CAAC;QACtD,OAAO,aAAa,CAClB,UAAU,EACV,sGAAsG;YACpG,wBAAwB,QAAQ,CAAC,WAAW,6DAA6D;YACzG,oGAAoG;YACpG,wDAAwD,CAC3D,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC3B,OAAO,aAAa,CAClB,UAAU,EACV,mGAAmG;YACjG,aAAa,CAChB,CAAC;IACJ,CAAC;IACD,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,aAAa,CACpB,QAAgB,EAChB,aAAqB,EACrB,SAA4B,EAC5B,eAAgC,EAChC,UAAoC,EACpC,MAAc;IAEd,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,QAAQ;QACR,aAAa;QACb,SAAS;QACT,eAAe;QACf,UAAU;QACV,MAAM;QACN,UAAU,EAAE,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC;KAC9C,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,7 @@
1
1
  /**
2
2
  * Identity grounding: an on-screen DOM element to the React component that
3
- * produced it, and to that component's authored file and line.
4
- *
5
- * Start at `createIdentityGrounder` (`identity-grounder.ts`). Read
6
- * `element-identity.ts` for what an answer is allowed to say, and
7
- * `owner-stack.ts` for the measured difference between React 18's and React
8
- * 19's fiber internals — they are not two implementations of one mechanism.
3
+ * produced it, and to its authored file and line. Start at
4
+ * `createIdentityGrounder` (`identity-grounder.ts`).
9
5
  */
10
6
  export type { IdentityRefusal, GroundingMechanism, ComponentKind, ComponentNameSource, ComponentSource, ResolvedComponent, ElementIdentity, ElementIdentityGrounded, ElementIdentityComponentOnly, ElementIdentityRefused, } from "./element-identity.ts";
11
7
  export { IDENTITY_REFUSALS, GROUNDING_MECHANISMS, COMPONENT_KINDS, COMPONENT_NAME_SOURCES, COMPONENT_SOURCES, capabilityFor, } from "./element-identity.ts";
@@ -17,6 +13,15 @@ export type { OwnerStackResolver } from "./identity-grounding.ts";
17
13
  export { groundFromProbe } from "./identity-grounding.ts";
18
14
  export type { IdentityGrounder, IdentityGrounderOptions } from "./identity-grounder.ts";
19
15
  export { createIdentityGrounder } from "./identity-grounder.ts";
16
+ export type { RawVueProbe, RawVueComponentDescriptor, VueIdentityGroundingProbe } from "./vue-probe.ts";
17
+ export { createVueIdentityGroundingProbe, VUE_IDENTITY_GROUNDING_BINDING } from "./vue-probe.ts";
18
+ export { groundFromVueProbe } from "./vue-identity-grounding.ts";
19
+ export type { VueIdentityGrounder } from "./vue-identity-grounder.ts";
20
+ export { createVueIdentityGrounder } from "./vue-identity-grounder.ts";
20
21
  export type { GraphSymbolLocation } from "./graph-join.ts";
21
22
  export { symbolLocationForGraph } from "./graph-join.ts";
23
+ export type { DetectableFramework, FrameworkDetectionResult, FrameworkDetector } from "./framework-detector.ts";
24
+ export { DETECTABLE_FRAMEWORKS, FRAMEWORK_DETECTION_BINDING, createFrameworkDetector } from "./framework-detector.ts";
25
+ export type { FrameworkAwareGrounder } from "./framework-aware-grounder.ts";
26
+ export { createFrameworkAwareGrounder } from "./framework-aware-grounder.ts";
22
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,4BAA4B,EAC5B,sBAAsB,GACvB,MA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it, and to that component's authored file and line.
4
- *
5
- * Start at `createIdentityGrounder` (`identity-grounder.ts`). Read
6
- * `element-identity.ts` for what an answer is allowed to say, and
7
- * `owner-stack.ts` for the measured difference between React 18's and React
8
- * 19's fiber internals — they are not two implementations of one mechanism.
3
+ * produced it, and to its authored file and line. Start at
4
+ * `createIdentityGrounder` (`identity-grounder.ts`).
9
5
  */
10
6
  export { IDENTITY_REFUSALS, GROUNDING_MECHANISMS, COMPONENT_KINDS, COMPONENT_NAME_SOURCES, COMPONENT_SOURCES, capabilityFor, } from "./element-identity.js";
11
7
  export { createIdentityGroundingProbe, IDENTITY_GROUNDING_BINDING, FIBER_KEY_PREFIXES } from "./fiber-probe.js";
12
8
  export { selectOwnerFrame, REACT_ELEMENT_CREATION_FRAMES } from "./owner-stack.js";
13
9
  export { groundFromProbe } from "./identity-grounding.js";
14
10
  export { createIdentityGrounder } from "./identity-grounder.js";
11
+ export { createVueIdentityGroundingProbe, VUE_IDENTITY_GROUNDING_BINDING } from "./vue-probe.js";
12
+ export { groundFromVueProbe } from "./vue-identity-grounding.js";
13
+ export { createVueIdentityGrounder } from "./vue-identity-grounder.js";
15
14
  export { symbolLocationForGraph } from "./graph-join.js";
15
+ export { DETECTABLE_FRAMEWORKS, FRAMEWORK_DETECTION_BINDING, createFrameworkDetector } from "./framework-detector.js";
16
+ export { createFrameworkAwareGrounder } from "./framework-aware-grounder.js";
16
17
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGhH,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAGnF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGhH,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAGnF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EAAE,+BAA+B,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAEjG,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAGtH,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC"}
@@ -1,12 +1,9 @@
1
1
  /**
2
- * React 19's replacement for `_debugSource`, and the one rule this package
3
- * needs in order to read it.
2
+ * React 19's replacement for `_debugSource`, and the rule this package
3
+ * needs to read it.
4
4
  *
5
- * ## What actually changed between the majors
6
- *
7
- * Measured directly, in a real Chromium, against React 18.3.1 and 19.2.8
8
- * development bundles of the same authored source
9
- * (`fixture-apps/react-identity`):
5
+ * Measured in a real Chromium, React 18.3.1 vs 19.2.8 dev bundles of the
6
+ * same source (`fixture-apps/react-identity`):
10
7
  *
11
8
  * | fiber field | React 18.3.1 dev | React 19.2.8 dev | either, production |
12
9
  * | --- | --- | --- | --- |
@@ -15,64 +12,41 @@
15
12
  * | `_debugOwner` | present | present | absent |
16
13
  * | `type.name` | authored | authored | minified |
17
14
  *
18
- * So React 19 did not move the source location, it **deleted** it and left
19
- * a captured stack in its place. The stack's frames point into *compiled*
20
- * output — the bundle the browser actually ran — which is why this path
21
- * costs a source-map resolution that React 18's does not, and why the two
22
- * mechanisms report different `SourceLocation.reliability` values
23
- * (`self-contained` versus `side-artifact-resolved`). That difference is
24
- * not cosmetic: one is the application telling us where it came from, the
25
- * other is us translating through a file that can be missing or stale.
26
- *
27
- * ## The rule: drop React's own element-creation frame, and only that
28
- *
29
- * The captured stack's innermost frame is React's own JSX entry point:
30
- *
31
- * ```text
32
- * Error: react-stack-top-frame
33
- * at exports.jsxDEV (http://…/dev.js:21690:32)
34
- * at PayButton (http://…/dev.js:21714:62) <- the site we want
35
- * at Object.react_stack_bottom_frame (…)
36
- * ```
37
- *
38
- * The second frame is the JSX call site inside the owning component, which
39
- * is exactly the fact React 18's `_debugSource` carries. Verified against
40
- * the fixture: React 18 reports `src/app.jsx:20`, and mapping React 19's
41
- * second frame through the bundle's source map lands on `src/app.jsx:20`
42
- * as well. `react-fixtures.test.ts` asserts that equality rather than
43
- * asserting each major separately, because two independently-written
44
- * expectations can both be wrong in the same direction.
45
- *
46
- * ## Why not `stripInitiatorWrapperFrame`'s positional rule
47
- *
48
- * `@descryy/runtime-browser`'s initiator capture drops its first frame *by
49
- * position*, and argues correctly that its own wrapper is deterministically
50
- * innermost because it captured the stack itself. Nothing here captured
51
- * this stack — React did — so the same reasoning is not available. Worse,
52
- * `createV8StackTraceParser` **omits** frames it cannot parse a
53
- * `line:column` from, so "the first frame of the parsed trace" is not
54
- * reliably "the first frame of the raw text" either.
55
- *
56
- * The rule used instead is by name, against a closed list of React's own
57
- * element-creation entry points, and it **refuses** when the innermost
58
- * frame is not one of them. A refusal here costs a source location; a
59
- * positional guess that is off by one costs a confident wrong file and
60
- * line, attributed to a component that did not create the element. Rule 2.
15
+ * React 19 didn't move the source location, it **deleted** it and left a
16
+ * captured stack whose frames point into *compiled* output — costing a
17
+ * source-map resolution React 18 doesn't need, and reporting a different
18
+ * `SourceLocation.reliability` (`self-contained` vs `side-artifact-resolved`):
19
+ * one is the app telling us where it came from, the other is us
20
+ * translating through a file that can be missing or stale.
21
+ *
22
+ * The rule: drop React's own element-creation frame (the stack's innermost
23
+ * frame, e.g. `exports.jsxDEV`), and only that — the second frame is the
24
+ * JSX call site inside the owning component, the same fact React 18's
25
+ * `_debugSource` carries. Verified against the fixture: both majors land on
26
+ * `src/app.jsx:20` (`react-fixtures.test.ts` asserts the equality, not each
27
+ * major separately, since two independent expectations can be wrong the
28
+ * same way).
29
+ *
30
+ * Not `stripInitiatorWrapperFrame`'s positional rule: nothing here captured
31
+ * this stack, React did, so "deterministically innermost" doesn't apply —
32
+ * and `createV8StackTraceParser` omits unparseable frames, so "first frame
33
+ * of the parsed trace" isn't reliably "first frame of the raw text" either.
34
+ * Instead: match by name against a closed list of React's element-creation
35
+ * entry points, and **refuse** when the innermost frame isn't one of them.
36
+ * A refusal costs a source location; an off-by-one positional guess costs a
37
+ * confident wrong file/line attributed to the wrong component (rule 2).
61
38
  */
62
39
  import type { StackTrace } from "@descryy/runtime-contracts";
63
40
  /**
64
41
  * React's own element-creation entry points, matched against the **last
65
- * dotted segment** of a frame's function name so that V8's `exports.jsxDEV`
66
- * and a bare `jsxDEV` are the same frame.
67
- *
68
- * `jsxDEV` / `jsxDEVImpl` are the automatic runtime's development entry;
69
- * `jsx` / `jsxs` its production ones (listed for completeness — a
70
- * production build has no `_debugStack` to reach this code with);
71
- * `createElement` / `createElementWithValidation` the classic runtime's.
72
- *
73
- * Deliberately a closed list rather than a "does this frame live inside
74
- * react-dom" heuristic: the latter needs a resolved path for the frame,
75
- * which is exactly the thing that may not resolve.
42
+ * dotted segment** of a frame's function name so `exports.jsxDEV` and bare
43
+ * `jsxDEV` are the same frame. `jsxDEV`/`jsxDEVImpl` are the automatic
44
+ * runtime's dev entry; `jsx`/`jsxs` its production ones (listed for
45
+ * completeness — production has no `_debugStack` to reach this code with);
46
+ * `createElement`/`createElementWithValidation` the classic runtime's.
47
+ *
48
+ * A closed list, not a "lives inside react-dom" heuristic — that needs a
49
+ * resolved path, exactly the thing that may not resolve.
76
50
  */
77
51
  export declare const REACT_ELEMENT_CREATION_FRAMES: readonly ["jsxDEV", "jsxDEVImpl", "jsxWithValidation", "jsx", "jsxs", "createElement", "createElementWithValidation"];
78
52
  export type OwnerFrameSelection = {
@@ -82,9 +56,6 @@ export type OwnerFrameSelection = {
82
56
  readonly ok: false;
83
57
  readonly reason: string;
84
58
  };
85
- /**
86
- * Index of the frame that is the JSX call site inside the owning component,
87
- * or a refusal naming why the stack could not be read that way.
88
- */
59
+ /** Index of the frame that is the JSX call site inside the owning component, or a refusal naming why the stack couldn't be read that way. */
89
60
  export declare function selectOwnerFrame(stack: StackTrace): OwnerFrameSelection;
90
61
  //# sourceMappingURL=owner-stack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"owner-stack.d.ts","sourceRoot":"","sources":["../src/owner-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,6BAA6B,uHAQhC,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAOpD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAsCvE"}
1
+ {"version":3,"file":"owner-stack.d.ts","sourceRoot":"","sources":["../src/owner-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,uHAQhC,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAOpD,6IAA6I;AAC7I,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAsCvE"}