@component-compass/reference-graph 0.1.24 → 0.1.25
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/engine/component-shape.d.ts +26 -2
- package/dist/engine/component-shape.js +73 -10
- package/dist/engine/component-shape.js.map +1 -1
- package/dist/engine/denotation.d.ts +7 -0
- package/dist/engine/denotation.js +15 -0
- package/dist/engine/denotation.js.map +1 -1
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.js +353 -261
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/member-identity.d.ts +8 -0
- package/dist/engine/member-identity.js +15 -0
- package/dist/engine/member-identity.js.map +1 -1
- package/dist/engine/registry.d.ts +57 -13
- package/dist/engine/registry.js +105 -57
- package/dist/engine/registry.js.map +1 -1
- package/dist/engine/wrapper-folding.d.ts +10 -3
- package/dist/engine/wrapper-folding.js +133 -76
- package/dist/engine/wrapper-folding.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/engine/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AA2D5D,4EAA4E;AAC5E,MAAM,UAAU,QAAQ,CAAC,QAAgB,EAAE,IAAY;IACrD,OAAO,GAAG,QAAQ,KAAK,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,QAAQ,CAAC,QAA2B,EAAE,OAAiC;IAC9E,MAAM,cAAc,GAAG,IAAI,GAAG,EA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EAAE,CAAC,CAAC;IACtE,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IACxC,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;QAC5C,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;IAC5C,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;QAC5C,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;IACxC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;4DAI4D;AAC5D,SAAS,kBAAkB,CAAC,GAAc,EAAE,IAAY,EAAE,EAAa,EAAE,KAAY;IACnF,MAAM,KAAK,GAAG,oBAAoB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5C,IAAI,KAAK;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;IACjD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACxD,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACjF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Graph, FileGraph, InferredType } from "../index.js";
|
|
1
|
+
import type { BindingDecl, Graph, FileGraph, InferredType } from "../index.js";
|
|
2
2
|
import type { OccurrenceVia } from "@component-compass/plugin-core";
|
|
3
3
|
import type { ArgumentMap } from "./argument-map.js";
|
|
4
4
|
import { type CycleGuard } from "./cycle-detection.js";
|
|
@@ -11,7 +11,9 @@ import { type Evaluation, type Terminal } from "./denotation.js";
|
|
|
11
11
|
* in-graph file reached through an import record). Engine builds componentId
|
|
12
12
|
* from { specifier, imported, resolvedFile? }.
|
|
13
13
|
* - `local`: leaf binding is a same-file declaration. Engine builds componentId
|
|
14
|
-
* from { filePath, export }.
|
|
14
|
+
* from { filePath, export }. `declaration` is the declaration a tag-position
|
|
15
|
+
* self-stamp's reference resolved to in its own scope; the registry's
|
|
16
|
+
* tagged membership and its component judge read it.
|
|
15
17
|
* - `null`: terminal didn't come from an identifiable binding (literal, anonymous
|
|
16
18
|
* expression, etc.). Engine falls back to the JsxUsage's own ref as the identity
|
|
17
19
|
* source — preserves today's behaviour for non-folded paths.
|
|
@@ -25,6 +27,7 @@ export type TerminalIdentity = {
|
|
|
25
27
|
kind: "local";
|
|
26
28
|
filePath: string;
|
|
27
29
|
export: string;
|
|
30
|
+
declaration?: BindingDecl;
|
|
28
31
|
} | null;
|
|
29
32
|
/**
|
|
30
33
|
* Provenance of ONE argument of a wrapper call: the wrapper's `callee` name
|
|
@@ -68,7 +71,11 @@ export declare function foldedArgument(graph: Graph, fileGraph: FileGraph, call:
|
|
|
68
71
|
* (pure algebra) and computes identity from the input type's leaf TypeOf
|
|
69
72
|
* when one can be confidently identified.
|
|
70
73
|
*/
|
|
71
|
-
export declare function walkWithFolding(graph: Graph, fileGraph: FileGraph, type: InferredType, argMap: ArgumentMap, guard?: CycleGuard, identityFallback?: InferredType): Evaluation;
|
|
74
|
+
export declare function walkWithFolding(graph: Graph, fileGraph: FileGraph, type: InferredType, argMap: ArgumentMap, guard?: CycleGuard, identityFallback?: InferredType, position?: WalkPosition): Evaluation;
|
|
75
|
+
/** Where the walked value sits. At a `tag` it is what JSX renders, so a
|
|
76
|
+
* function is the component and the walk stops there; anywhere else it is a
|
|
77
|
+
* `value`, and a function is judged by what it returns. */
|
|
78
|
+
export type WalkPosition = "tag" | "value";
|
|
72
79
|
/**
|
|
73
80
|
* The file a DynamicImport's specifier resolves against: the file that
|
|
74
81
|
* contains the `import()`, whichever file the walk is standing in.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findLocalDeclaration } from "./helper-callers.js";
|
|
1
2
|
import { resolveType, resolveToFunctions, resolveDynamicImportTarget, DYNAMIC_MEMBER_KEY } from "./resolve-type.js";
|
|
2
3
|
import { argumentRefKey, boundArgument } from "./argument-map.js";
|
|
3
4
|
import { createCycleGuard } from "./cycle-detection.js";
|
|
@@ -5,11 +6,10 @@ import { fileGraphForRef, resolveReference } from "./resolve-reference.js";
|
|
|
5
6
|
import { packageNameFromSpecifier } from "./specifier.js";
|
|
6
7
|
import { followReExportChain } from "./re-export-chain.js";
|
|
7
8
|
import { unparsedMemberDefinition, effectiveExportName, residualMemberChain, compoundExportName } from "./member-identity.js";
|
|
8
|
-
import { evalKind, isImportBackedLeaf } from "./component-shape.js";
|
|
9
|
+
import { containsDynamicImport, evalKind, isImportBackedLeaf, nonComponentProduct } from "./component-shape.js";
|
|
9
10
|
import { HOOK_NAME } from "./host-element.js";
|
|
10
11
|
import { assertNever } from "./assert-never.js";
|
|
11
|
-
import { creditedTerminals, matchDenotation } from "./denotation.js";
|
|
12
|
-
import { libraryExportFor } from "./library-stubs.js";
|
|
12
|
+
import { creditedTerminals, isCallable, matchDenotation } from "./denotation.js";
|
|
13
13
|
/** True when a `ReturnTypeOf`'s callee is a data-method render
|
|
14
14
|
* call (`items.map(render)`) rather than a wrapper taking a component as a
|
|
15
15
|
* prop — the exact structural condition `component-shape.ts`'s rule (ii)
|
|
@@ -19,6 +19,49 @@ import { libraryExportFor } from "./library-stubs.js";
|
|
|
19
19
|
function isDataMethodRenderCall(type, graph, fileGraph, guard) {
|
|
20
20
|
return type.callee.kind === "MemberOf" && !isImportBackedLeaf(type.callee, graph, fileGraph, guard);
|
|
21
21
|
}
|
|
22
|
+
/** True when a value is a loader: a function whose body holds an `import()`,
|
|
23
|
+
* inline, or reached from a reference through a chain of aliases, or held by
|
|
24
|
+
* a static member of an object literal (by every member, for a dynamic one)
|
|
25
|
+
* that the value names directly or through such a chain. Each reference
|
|
26
|
+
* resolves in its own file. Anything else, a `lazy()` holder or a wrapper
|
|
27
|
+
* product included, is not. */
|
|
28
|
+
function isLoader(value, graph, fileGraph, guard) {
|
|
29
|
+
if (value.kind === "Function")
|
|
30
|
+
return containsDynamicImport(value, { graph, fileGraph });
|
|
31
|
+
if (value.kind !== "TypeOf" && value.kind !== "MemberOf")
|
|
32
|
+
return false;
|
|
33
|
+
if (guard.pushNode(value) === "cycle")
|
|
34
|
+
return false;
|
|
35
|
+
try {
|
|
36
|
+
if (value.kind === "TypeOf")
|
|
37
|
+
return isLoader(resolveReference(graph, fileGraph, value.ref, guard), graph, fileGraph, guard);
|
|
38
|
+
const holder = objectLiteralOf(value.obj, graph, fileGraph, guard);
|
|
39
|
+
if (holder === null)
|
|
40
|
+
return false;
|
|
41
|
+
if (value.member !== DYNAMIC_MEMBER_KEY) {
|
|
42
|
+
const held = holder.props[value.member];
|
|
43
|
+
return held !== undefined && isLoader(held, graph, fileGraph, guard);
|
|
44
|
+
}
|
|
45
|
+
const all = Object.values(holder.props);
|
|
46
|
+
return all.length > 0 && all.every((v) => isLoader(v, graph, fileGraph, guard));
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
guard.popNode(value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** The object literal a value is, directly or through a chain of aliases. */
|
|
53
|
+
function objectLiteralOf(value, graph, fileGraph, guard) {
|
|
54
|
+
if (value.kind === "Object")
|
|
55
|
+
return value;
|
|
56
|
+
if (value.kind !== "TypeOf" || guard.pushNode(value) === "cycle")
|
|
57
|
+
return null;
|
|
58
|
+
try {
|
|
59
|
+
return objectLiteralOf(resolveReference(graph, fileGraph, value.ref, guard), graph, fileGraph, guard);
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
guard.popNode(value);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
22
65
|
/** The denotation of a branch the walk learned nothing about. */
|
|
23
66
|
const INDETERMINATE = { kind: "indeterminate" };
|
|
24
67
|
function withSemantics(t, semantics) {
|
|
@@ -47,6 +90,7 @@ const CAME_TO_NOTHING = {
|
|
|
47
90
|
"late-bound": () => true,
|
|
48
91
|
data: () => false,
|
|
49
92
|
indeterminate: () => true,
|
|
93
|
+
callable: () => false,
|
|
50
94
|
};
|
|
51
95
|
function cameToNothing(t) {
|
|
52
96
|
return matchDenotation(t, CAME_TO_NOTHING);
|
|
@@ -59,6 +103,7 @@ const IS_LATE_BOUND = {
|
|
|
59
103
|
"late-bound": () => true,
|
|
60
104
|
data: () => false,
|
|
61
105
|
indeterminate: () => false,
|
|
106
|
+
callable: () => false,
|
|
62
107
|
};
|
|
63
108
|
/**
|
|
64
109
|
* Rename a branch that came to nothing, keeping its identity and viaTrail
|
|
@@ -95,6 +140,7 @@ const AS_RETURNED_VALUE = {
|
|
|
95
140
|
"late-bound": () => INDETERMINATE,
|
|
96
141
|
data: (d) => d,
|
|
97
142
|
indeterminate: (d) => d,
|
|
143
|
+
callable: (d) => d,
|
|
98
144
|
};
|
|
99
145
|
function returnedValue(t) {
|
|
100
146
|
const denotation = matchDenotation(t, AS_RETURNED_VALUE);
|
|
@@ -304,14 +350,21 @@ function isPassThroughWrapper(algResult, inner) {
|
|
|
304
350
|
* (pure algebra) and computes identity from the input type's leaf TypeOf
|
|
305
351
|
* when one can be confidently identified.
|
|
306
352
|
*/
|
|
307
|
-
export function walkWithFolding(graph, fileGraph, type, argMap, guard = createCycleGuard(), identityFallback) {
|
|
308
|
-
return atLeastOne(walkInner(graph, fileGraph, type, argMap, guard, identityFallback).map(published));
|
|
353
|
+
export function walkWithFolding(graph, fileGraph, type, argMap, guard = createCycleGuard(), identityFallback, position = "value") {
|
|
354
|
+
return atLeastOne(walkInner(graph, fileGraph, type, argMap, guard, identityFallback, position).map(published));
|
|
309
355
|
}
|
|
310
356
|
/**
|
|
311
357
|
* The walk itself. Returns exactly what each arm produced, empty included:
|
|
312
358
|
* inside the walk an empty result means "this branch contributed nothing",
|
|
313
359
|
* which `walkTypeOf`'s vacuous `every` and `foldToWrappedArg`'s rescue both
|
|
314
360
|
* read. Only the exported boundary above may substitute a terminal for it.
|
|
361
|
+
*
|
|
362
|
+
* `position` says whether `type` is what a tag renders. At a `tag`, a
|
|
363
|
+
* function is one `callable` terminal and its body is not walked; the
|
|
364
|
+
* position carries through the value hops (a reference, a union branch, a
|
|
365
|
+
* static or dynamic member, a call's folded argument, a lazy target, a
|
|
366
|
+
* dispatcher's returns) and nowhere else. In `value` position a function is
|
|
367
|
+
* walked into its returns.
|
|
315
368
|
*/
|
|
316
369
|
function walkInner(graph, fileGraph, type, argMap, guard,
|
|
317
370
|
// The identity `foldTerminals` falls back to when a terminal
|
|
@@ -325,39 +378,44 @@ function walkInner(graph, fileGraph, type, argMap, guard,
|
|
|
325
378
|
// that happens to sit in `foldTerminals`' fallback slot. Per-branch
|
|
326
379
|
// identity from a fanout `source` (Union([TypeOf A, TypeOf B])) is
|
|
327
380
|
// untouched: `source` is checked BEFORE this fallback in `foldTerminals`.
|
|
328
|
-
identityFallback) {
|
|
381
|
+
identityFallback, position) {
|
|
329
382
|
const fallback = identityFallback ?? type;
|
|
330
383
|
switch (type.kind) {
|
|
331
384
|
case "ReturnTypeOf":
|
|
332
|
-
return walkReturnTypeOf(graph, fileGraph, type, argMap, guard);
|
|
385
|
+
return walkReturnTypeOf(graph, fileGraph, type, argMap, guard, position);
|
|
333
386
|
case "MemberOf":
|
|
334
387
|
if (type.member === DYNAMIC_MEMBER_KEY) {
|
|
335
|
-
return walkDynamicMember(graph, fileGraph, type, argMap, guard);
|
|
388
|
+
return walkDynamicMember(graph, fileGraph, type, argMap, guard, position);
|
|
336
389
|
}
|
|
337
|
-
return walkStaticMember(graph, fileGraph, type, argMap, guard, fallback);
|
|
390
|
+
return walkStaticMember(graph, fileGraph, type, argMap, guard, fallback, position);
|
|
338
391
|
case "Function":
|
|
339
|
-
//
|
|
392
|
+
// At a tag the function is what JSX renders: one `callable` terminal
|
|
393
|
+
// with no identity of its own, and the body is not walked.
|
|
394
|
+
//
|
|
395
|
+
// In value position a component's own returns can contain a nested
|
|
340
396
|
// ReturnTypeOf/MemberOf (`List = ({items}) => items.map(render)`) that
|
|
341
397
|
// needs wrapper-folding's steps (the opaque-callee / dynamic-map
|
|
342
398
|
// handling below), not `resolveType`'s plain algebra — `resolveType`'s
|
|
343
399
|
// own "Function" case recurses via plain `resolveType`, which never
|
|
344
|
-
// re-enters this walk, so a
|
|
345
|
-
//
|
|
400
|
+
// re-enters this walk, so a value resolving to such a Function would
|
|
401
|
+
// silently produce zero terminals.
|
|
346
402
|
// Mirrors `resolveType`'s "Function" case, one level up. Pass THIS
|
|
347
403
|
// Function as the identity fallback for every return — a
|
|
348
404
|
// Function is never TypeOf/DynamicImport, so `deriveIdentity` on it
|
|
349
405
|
// is always null.
|
|
406
|
+
if (position === "tag")
|
|
407
|
+
return [{ denotation: { kind: "callable" }, identity: null, viaTrail: [] }];
|
|
350
408
|
return type.returns
|
|
351
|
-
.flatMap((r) => walkInner(graph, fileGraph, r, argMap, guard, type))
|
|
409
|
+
.flatMap((r) => walkInner(graph, fileGraph, r, argMap, guard, type, "value"))
|
|
352
410
|
.map(returnedValue);
|
|
353
411
|
case "TypeOf":
|
|
354
|
-
return walkTypeOf(graph, fileGraph, type, argMap, guard, fallback);
|
|
412
|
+
return walkTypeOf(graph, fileGraph, type, argMap, guard, fallback, position);
|
|
355
413
|
case "Union":
|
|
356
414
|
// Structural re-entry: each branch walks through the walker so
|
|
357
415
|
// a TypeOf branch reaches `walkTypeOf` and decides its own identity
|
|
358
416
|
// (per-branch attribution) while a bare JSX branch — a lowered
|
|
359
417
|
// ternary/logical render body — derives from the outer fallback.
|
|
360
|
-
return type.types.flatMap((branch) => walkInner(graph, fileGraph, branch, argMap, guard, fallback));
|
|
418
|
+
return type.types.flatMap((branch) => walkInner(graph, fileGraph, branch, argMap, guard, fallback, position));
|
|
361
419
|
case "ParameterOf":
|
|
362
420
|
return walkParameter(graph, fileGraph, type, argMap, guard, fallback);
|
|
363
421
|
case "DynamicImport":
|
|
@@ -454,9 +512,14 @@ export function dynamicImportIdentity(graph, fileGraph, di) {
|
|
|
454
512
|
* Identity: a terminal that comes back with no identity of its own is
|
|
455
513
|
* stamped with THIS reference's identity only when the reference names a
|
|
456
514
|
* component-shaped value — `evalKind === "component"`, the one component-
|
|
457
|
-
* shape seam, called not re-derived
|
|
458
|
-
*
|
|
459
|
-
*
|
|
515
|
+
* shape seam, called not re-derived — or, at a tag, when the walk came back
|
|
516
|
+
* with an identity-less `callable`: a reference to a function, or to a
|
|
517
|
+
* wrapper call over an anonymous one, names what the tag renders, whatever
|
|
518
|
+
* it returns. A reference to a JSX value (`return priceElement`) or to a
|
|
519
|
+
* parameter binding stays null so the outer fallback wins, by construction
|
|
520
|
+
* rather than by special case. At a tag, a self-stamp of a same-file reference
|
|
521
|
+
* also carries the declaration that reference resolves to
|
|
522
|
+
* (`withOwnDeclaration`).
|
|
460
523
|
*
|
|
461
524
|
* An import the graph cannot see (`resolved` is Unknown) is NOT re-entered:
|
|
462
525
|
* it is the identity-bearing leaf `foldLeaf` synthesises from, and
|
|
@@ -470,7 +533,7 @@ export function dynamicImportIdentity(graph, fileGraph, di) {
|
|
|
470
533
|
* Cycle guard: mirrors `resolveType`'s node guard. `const A = B; const B = A`
|
|
471
534
|
* is legal JS and would otherwise re-enter forever.
|
|
472
535
|
*/
|
|
473
|
-
function walkTypeOf(graph, fileGraph, type, argMap, guard, fallback) {
|
|
536
|
+
function walkTypeOf(graph, fileGraph, type, argMap, guard, fallback, position) {
|
|
474
537
|
if (guard.pushNode(type) === "cycle") {
|
|
475
538
|
return [indeterminateTerminal()];
|
|
476
539
|
}
|
|
@@ -486,12 +549,14 @@ function walkTypeOf(graph, fileGraph, type, argMap, guard, fallback) {
|
|
|
486
549
|
return foldLeaf(graph, fileGraph, type, argMap, guard, fallback);
|
|
487
550
|
}
|
|
488
551
|
const innerGraph = resolved.kind === "Function" ? fileGraphForFunction(graph, fileGraph, resolved) : fileGraph;
|
|
489
|
-
const inner = walkInner(graph, innerGraph, resolved, argMap, guard, fallback);
|
|
552
|
+
const inner = walkInner(graph, innerGraph, resolved, argMap, guard, fallback, position);
|
|
490
553
|
if (inner.every((t) => t.identity !== null))
|
|
491
554
|
return inner;
|
|
492
|
-
const
|
|
555
|
+
const derived = (position === "tag" && inner.some((t) => t.identity === null && isCallable(t))) ||
|
|
556
|
+
(resolved.kind !== "ParameterOf" && evalKind(resolved, graph, innerGraph, argMap) === "component")
|
|
493
557
|
? deriveIdentity(type, fileGraph, graph)
|
|
494
558
|
: null;
|
|
559
|
+
const self = position === "tag" ? withOwnDeclaration(derived, graph, fileGraph, type.ref) : derived;
|
|
495
560
|
const stamp = self ?? deriveIdentity(fallback, fileGraph, graph);
|
|
496
561
|
// Carries the product mark: a reference to a context IS that context.
|
|
497
562
|
return inner.map((t) => t.identity === null ? { denotation: t.denotation, viaTrail: t.viaTrail, identity: stamp, semantics: t.semantics } : t);
|
|
@@ -500,6 +565,20 @@ function walkTypeOf(graph, fileGraph, type, argMap, guard, fallback) {
|
|
|
500
565
|
guard.popNode(type);
|
|
501
566
|
}
|
|
502
567
|
}
|
|
568
|
+
/**
|
|
569
|
+
* A local identity stamped from a same-file reference with no member chain,
|
|
570
|
+
* given the declaration that reference resolves to in its own scope
|
|
571
|
+
* (`findLocalDeclaration`). Any other identity is returned unchanged.
|
|
572
|
+
*/
|
|
573
|
+
function withOwnDeclaration(identity, graph, fileGraph, ref) {
|
|
574
|
+
if (identity === null || identity.kind !== "local" || ref.memberChain.length > 0)
|
|
575
|
+
return identity;
|
|
576
|
+
const lookup = fileGraphForRef(graph, ref, fileGraph);
|
|
577
|
+
if (identity.filePath !== lookup.filePath || lookup.importsByLocal.has(ref.symbol))
|
|
578
|
+
return identity;
|
|
579
|
+
const declaration = findLocalDeclaration(lookup, ref);
|
|
580
|
+
return declaration === null ? identity : { ...identity, declaration };
|
|
581
|
+
}
|
|
503
582
|
/**
|
|
504
583
|
* Static member access. Mirrors `walkDynamicMember` for one
|
|
505
584
|
* named prop and without the `dynamic-map` hop: resolve the object, take the
|
|
@@ -514,7 +593,7 @@ function walkTypeOf(graph, fileGraph, type, argMap, guard, fallback) {
|
|
|
514
593
|
* re-enters this arm forever without it — `resolveType` pops every node it
|
|
515
594
|
* pushes, so nothing on such a cycle stays on the guard's path otherwise.
|
|
516
595
|
*/
|
|
517
|
-
function walkStaticMember(graph, fileGraph, type, argMap, guard, fallback) {
|
|
596
|
+
function walkStaticMember(graph, fileGraph, type, argMap, guard, fallback, position) {
|
|
518
597
|
if (guard.pushNode(type) === "cycle") {
|
|
519
598
|
return [indeterminateTerminal()];
|
|
520
599
|
}
|
|
@@ -537,7 +616,7 @@ function walkStaticMember(graph, fileGraph, type, argMap, guard, fallback) {
|
|
|
537
616
|
// and any member of a non-component product is that product. ONE walk
|
|
538
617
|
// answers both, and only once the member came to nothing, so a member
|
|
539
618
|
// that resolved is never re-walked.
|
|
540
|
-
const object = walkInner(graph, fileGraph, type.obj, argMap, guard);
|
|
619
|
+
const object = walkInner(graph, fileGraph, type.obj, argMap, guard, undefined, "value");
|
|
541
620
|
const semantics = markedProduct(object);
|
|
542
621
|
if (semantics !== null)
|
|
543
622
|
return leaf.map((t) => withSemantics(t, semantics));
|
|
@@ -548,7 +627,7 @@ function walkStaticMember(graph, fileGraph, type, argMap, guard, fallback) {
|
|
|
548
627
|
const value = obj.props[type.member];
|
|
549
628
|
if (value === undefined)
|
|
550
629
|
continue;
|
|
551
|
-
out.push(...walkInner(graph, fileGraph, value, argMap, guard, fallback));
|
|
630
|
+
out.push(...walkInner(graph, fileGraph, value, argMap, guard, fallback, position));
|
|
552
631
|
}
|
|
553
632
|
return out.length > 0 ? out : [indeterminateTerminal()];
|
|
554
633
|
}
|
|
@@ -557,59 +636,33 @@ function walkStaticMember(graph, fileGraph, type, argMap, guard, fallback) {
|
|
|
557
636
|
}
|
|
558
637
|
}
|
|
559
638
|
/**
|
|
560
|
-
* A call.
|
|
561
|
-
*
|
|
562
|
-
*
|
|
639
|
+
* A call. A call of an export the stub table names a non-component product
|
|
640
|
+
* IS that product, before any fold runs: its arguments are values the product
|
|
641
|
+
* holds (a context's default), never a wrapped component, so none of them is
|
|
642
|
+
* walked or credited.
|
|
643
|
+
*
|
|
644
|
+
* Every other call runs the folding rules first (`foldCall`). The call's own
|
|
645
|
+
* shape gets a name only when all of them declined: no argument credited and no
|
|
646
|
+
* algebra result. A call of a hook the graph cannot see returns a value
|
|
563
647
|
* bound at render time by the hook's own implementation, so it is late-bound
|
|
564
648
|
* rather than unknown. The predicate is React's `HOOK_NAME` over a callee
|
|
565
649
|
* `isImportBackedLeaf` says the graph cannot resolve; it runs after the folds,
|
|
566
650
|
* so `const X = useStyled(Base)` keeps the credit its fold gave it.
|
|
567
651
|
*
|
|
568
|
-
* A call of an export the stub table names a non-component product carries
|
|
569
|
-
* that product's mark on the terminals the folds produced, and only when the
|
|
570
|
-
* folds credited nothing.
|
|
571
|
-
*
|
|
572
652
|
* ORDER IS LOAD-BEARING: `returnedValue` runs on the fold's results before
|
|
573
653
|
* `late-bound{hook-result}` is minted for the call itself.
|
|
574
654
|
*/
|
|
575
|
-
function walkReturnTypeOf(graph, fileGraph, type, argMap, guard) {
|
|
576
|
-
const
|
|
577
|
-
if (
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
return returns.map((t) => withSemantics(t, semantics));
|
|
581
|
-
}
|
|
655
|
+
function walkReturnTypeOf(graph, fileGraph, type, argMap, guard, position) {
|
|
656
|
+
const semantics = nonComponentProduct(graph, fileGraph, type.callee, guard);
|
|
657
|
+
if (semantics !== null)
|
|
658
|
+
return [withSemantics(indeterminateTerminal(), semantics)];
|
|
659
|
+
const returns = foldCall(graph, fileGraph, type, argMap, guard, position).map(returnedValue);
|
|
582
660
|
if (!(returns.length > 0 && returns.every(cameToNothing)))
|
|
583
661
|
return returns;
|
|
584
662
|
const unseenHook = HOOK_NAME.test(deriveHocCallee(type.callee)) && isImportBackedLeaf(type.callee, graph, fileGraph, guard);
|
|
585
663
|
return unseenHook ? returns.map(asLateBound("hook-result")) : returns;
|
|
586
664
|
}
|
|
587
|
-
|
|
588
|
-
* The semantics of the non-component value a call produces: the stub table's
|
|
589
|
-
* entry for the callee's export, when the callee is an import the graph cannot
|
|
590
|
-
* see (`isImportBackedLeaf`, the same predicate the unseen-hook rule uses).
|
|
591
|
-
* Null for every other call.
|
|
592
|
-
*
|
|
593
|
-
* The callee's spelling is read through `libraryExportFor`, the one table
|
|
594
|
-
* `libraryStubFor` reads: a reference (a named import, or a default /
|
|
595
|
-
* namespace import carrying the member on the ref) or a member access on one
|
|
596
|
-
* (`React.createContext`).
|
|
597
|
-
*/
|
|
598
|
-
function nonComponentProduct(graph, fileGraph, callee, guard) {
|
|
599
|
-
const ref = callee.kind === "TypeOf"
|
|
600
|
-
? callee.ref
|
|
601
|
-
: callee.kind === "MemberOf" && callee.obj.kind === "TypeOf"
|
|
602
|
-
? { ...callee.obj.ref, memberChain: [callee.member] }
|
|
603
|
-
: null;
|
|
604
|
-
if (ref === null)
|
|
605
|
-
return null;
|
|
606
|
-
const imp = fileGraphForRef(graph, ref, fileGraph).importsByLocal.get(ref.symbol);
|
|
607
|
-
const entry = imp === undefined ? null : libraryExportFor(imp, ref);
|
|
608
|
-
if (entry === null || entry.kind !== "non-component-product")
|
|
609
|
-
return null;
|
|
610
|
-
return isImportBackedLeaf(callee, graph, fileGraph, guard) ? entry.semantics : null;
|
|
611
|
-
}
|
|
612
|
-
function foldCall(graph, fileGraph, type, argMap, guard) {
|
|
665
|
+
function foldCall(graph, fileGraph, type, argMap, guard, position) {
|
|
613
666
|
// (1) lazy-import shape: any arg's subtree contains a DynamicImport
|
|
614
667
|
// (with one-ref-deep peek into local-file bindings to catch the async-await form).
|
|
615
668
|
const lazyShape = findLazyImportArg(type.args, fileGraph);
|
|
@@ -630,8 +683,8 @@ function foldCall(graph, fileGraph, type, argMap, guard) {
|
|
|
630
683
|
try {
|
|
631
684
|
const target = resolveDynamicImportTarget(graph, fileGraph, syntheticDI, guard);
|
|
632
685
|
inner = target
|
|
633
|
-
? walkInner(graph, target.targetFileGraph, target.value, argMap, guard)
|
|
634
|
-
: walkInner(graph, fileGraph, syntheticDI, argMap, guard);
|
|
686
|
+
? walkInner(graph, target.targetFileGraph, target.value, argMap, guard, undefined, position)
|
|
687
|
+
: walkInner(graph, fileGraph, syntheticDI, argMap, guard, undefined, position);
|
|
635
688
|
}
|
|
636
689
|
finally {
|
|
637
690
|
guard.pop(syntheticDI.originFile, guardKey);
|
|
@@ -670,7 +723,7 @@ function foldCall(graph, fileGraph, type, argMap, guard) {
|
|
|
670
723
|
// walkDynamicMember rule fire and surfaces the dynamic-map via in the chain
|
|
671
724
|
// — without it, cross-module dispatcher patterns would lose the via even
|
|
672
725
|
// though identity attribution worked.
|
|
673
|
-
const dispatcherResult = walkDispatcherReturns(graph, fileGraph, type, argMap, guard);
|
|
726
|
+
const dispatcherResult = walkDispatcherReturns(graph, fileGraph, type, argMap, guard, position);
|
|
674
727
|
if (dispatcherResult)
|
|
675
728
|
return dispatcherResult;
|
|
676
729
|
// (2b) Structural pass-through. When every Function
|
|
@@ -686,7 +739,7 @@ function foldCall(graph, fileGraph, type, argMap, guard) {
|
|
|
686
739
|
if (passThroughIndex !== null) {
|
|
687
740
|
const wrapped = type.args[passThroughIndex];
|
|
688
741
|
if (wrapped !== undefined) {
|
|
689
|
-
const inner = walkInner(graph, fileGraph, wrapped, argMap, guard);
|
|
742
|
+
const inner = walkInner(graph, fileGraph, wrapped, argMap, guard, undefined, position);
|
|
690
743
|
return foldToWrappedArg(inner, buildHocVia(type, wrapped, fileGraph));
|
|
691
744
|
}
|
|
692
745
|
}
|
|
@@ -711,7 +764,7 @@ function foldCall(graph, fileGraph, type, argMap, guard) {
|
|
|
711
764
|
// stands with no via.
|
|
712
765
|
const lastArg = type.args.at(-1);
|
|
713
766
|
if (lastArg !== undefined) {
|
|
714
|
-
const inner = walkInner(graph, fileGraph, lastArg, argMap, guard);
|
|
767
|
+
const inner = walkInner(graph, fileGraph, lastArg, argMap, guard, undefined, position);
|
|
715
768
|
if (isPassThroughWrapper(algResult, inner)) {
|
|
716
769
|
const via = buildHocVia(type, lastArg, fileGraph);
|
|
717
770
|
return inner
|
|
@@ -726,7 +779,11 @@ function foldCall(graph, fileGraph, type, argMap, guard) {
|
|
|
726
779
|
if (lastArg === undefined) {
|
|
727
780
|
return [indeterminateTerminal()];
|
|
728
781
|
}
|
|
729
|
-
|
|
782
|
+
// A data-method callback and a loader holding an `import()` the lazy arm
|
|
783
|
+
// declined are called, not rendered, so they walk in value position.
|
|
784
|
+
const dataMethod = isDataMethodRenderCall(type, graph, fileGraph, guard);
|
|
785
|
+
const called = dataMethod || isLoader(lastArg, graph, fileGraph, guard);
|
|
786
|
+
const inner = walkInner(graph, fileGraph, lastArg, argMap, guard, undefined, called ? "value" : position);
|
|
730
787
|
// A data-method render call (`items.map(render)`) is not a
|
|
731
788
|
// wrapper — its result IS the callback's rendered JSX, not a component
|
|
732
789
|
// received as a prop. Return the callback's terminals AS-IS: no
|
|
@@ -734,7 +791,7 @@ function foldCall(graph, fileGraph, type, argMap, guard) {
|
|
|
734
791
|
// (the declaration being walked, e.g. `List`) wins rather than whatever
|
|
735
792
|
// the callback itself happened to resolve to. Import-backed MemberOf
|
|
736
793
|
// callees (`Sentry.withProfiler`) fall through to the fold+hop below.
|
|
737
|
-
if (
|
|
794
|
+
if (dataMethod) {
|
|
738
795
|
const nonUnknown = inner.filter((t) => !cameToNothing(t));
|
|
739
796
|
if (nonUnknown.length > 0) {
|
|
740
797
|
return nonUnknown.map((t) => ({ denotation: t.denotation, viaTrail: t.viaTrail, identity: null }));
|
|
@@ -792,7 +849,7 @@ function passThroughParameterIndex(graph, fileGraph, type, argMap, guard) {
|
|
|
792
849
|
* `enclosingBinding.file`). Returns null when no callee matches the shape so
|
|
793
850
|
* the caller falls through to the pure algebra path.
|
|
794
851
|
*/
|
|
795
|
-
function walkDispatcherReturns(graph, fileGraph, type, argMap, guard) {
|
|
852
|
+
function walkDispatcherReturns(graph, fileGraph, type, argMap, guard, position) {
|
|
796
853
|
const calleeFns = resolveToFunctions(graph, fileGraph, type.callee, argMap, guard);
|
|
797
854
|
const hasDispatcher = calleeFns.some(({ fn }) => fn.kind === "Function" && fn.returns.some(isDynamicMemberReturn));
|
|
798
855
|
if (!hasDispatcher)
|
|
@@ -806,7 +863,7 @@ function walkDispatcherReturns(graph, fileGraph, type, argMap, guard) {
|
|
|
806
863
|
argMap.bind(bindingRef, type.args);
|
|
807
864
|
try {
|
|
808
865
|
for (const ret of fn.returns) {
|
|
809
|
-
folded.push(...walkInner(graph, fnFileGraph, ret, argMap, guard));
|
|
866
|
+
folded.push(...walkInner(graph, fnFileGraph, ret, argMap, guard, undefined, position));
|
|
810
867
|
}
|
|
811
868
|
}
|
|
812
869
|
finally {
|
|
@@ -886,7 +943,7 @@ function findFirstDynamicImport(t, fileGraph, depthBudget) {
|
|
|
886
943
|
* reached through `MAP[k]` re-enters this arm forever without it. No
|
|
887
944
|
* `foldLeaf` path here, so no early pop is needed.
|
|
888
945
|
*/
|
|
889
|
-
function walkDynamicMember(graph, fileGraph, type, argMap, guard) {
|
|
946
|
+
function walkDynamicMember(graph, fileGraph, type, argMap, guard, position) {
|
|
890
947
|
if (guard.pushNode(type) === "cycle") {
|
|
891
948
|
return [indeterminateTerminal()];
|
|
892
949
|
}
|
|
@@ -906,7 +963,7 @@ function walkDynamicMember(graph, fileGraph, type, argMap, guard) {
|
|
|
906
963
|
for (const propValue of Object.values(obj.props)) {
|
|
907
964
|
// Recurse via walkInner so identity is derived from each branch's
|
|
908
965
|
// leaf TypeOf (Foo/Bar resolve to their respective bindings).
|
|
909
|
-
const inner = walkInner(graph, fileGraph, propValue, argMap, guard);
|
|
966
|
+
const inner = walkInner(graph, fileGraph, propValue, argMap, guard, undefined, position);
|
|
910
967
|
const via = { kind: "dynamic-map", mapName, mapLoc };
|
|
911
968
|
for (const t of inner) {
|
|
912
969
|
if (cameToNothing(t))
|
|
@@ -1198,7 +1255,7 @@ export function deriveIdentity(type, fileGraph, graph) {
|
|
|
1198
1255
|
}
|
|
1199
1256
|
// Check local declarations. A same-file symbol is never a namespace
|
|
1200
1257
|
// import, so the whole member chain is residual (mirror of
|
|
1201
|
-
// `
|
|
1258
|
+
// `evaluateJsxUsage`'s same-file fallback) — an empty chain is a no-op.
|
|
1202
1259
|
for (const [, decl] of lookup.declarations) {
|
|
1203
1260
|
if (decl && decl.symbol === symbol) {
|
|
1204
1261
|
return withResidual({
|