@barefootjs/jsx 0.41.1 → 0.41.3

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 (105) hide show
  1. package/dist/adapters/attr-plan.d.ts +8 -0
  2. package/dist/adapters/attr-plan.d.ts.map +1 -1
  3. package/dist/adapters/component-props.d.ts.map +1 -1
  4. package/dist/adapters/computed-const.d.ts +19 -0
  5. package/dist/adapters/computed-const.d.ts.map +1 -1
  6. package/dist/adapters/dsl-template-adapter.d.ts +2 -1
  7. package/dist/adapters/dsl-template-adapter.d.ts.map +1 -1
  8. package/dist/adapters/inherited-const-server-read.d.ts +37 -0
  9. package/dist/adapters/inherited-const-server-read.d.ts.map +1 -0
  10. package/dist/adapters/loop-row-type.d.ts +18 -0
  11. package/dist/adapters/loop-row-type.d.ts.map +1 -1
  12. package/dist/adapters/non-primitive-equality.d.ts +8 -2
  13. package/dist/adapters/non-primitive-equality.d.ts.map +1 -1
  14. package/dist/adapters/unapplied-prop-default.d.ts +34 -0
  15. package/dist/adapters/unapplied-prop-default.d.ts.map +1 -0
  16. package/dist/adapters/uninlinable-seed-call.d.ts +29 -0
  17. package/dist/adapters/uninlinable-seed-call.d.ts.map +1 -0
  18. package/dist/analyzer.d.ts.map +1 -1
  19. package/dist/augment-inherited-props.d.ts +4 -22
  20. package/dist/augment-inherited-props.d.ts.map +1 -1
  21. package/dist/caller-value-reach.d.ts +57 -0
  22. package/dist/caller-value-reach.d.ts.map +1 -0
  23. package/dist/const-identity.d.ts +38 -0
  24. package/dist/const-identity.d.ts.map +1 -0
  25. package/dist/index.d.ts +10 -5
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +2685 -1381
  28. package/dist/ir-to-client-js/child-props-object.d.ts +39 -41
  29. package/dist/ir-to-client-js/child-props-object.d.ts.map +1 -1
  30. package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
  31. package/dist/ir-to-client-js/component-scope.d.ts +13 -2
  32. package/dist/ir-to-client-js/component-scope.d.ts.map +1 -1
  33. package/dist/ir-to-client-js/control-flow/plan/build-inner-loop.d.ts.map +1 -1
  34. package/dist/ir-to-client-js/control-flow/plan/build-loop-child-arm.d.ts.map +1 -1
  35. package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
  36. package/dist/ir-to-client-js/prop-handling.d.ts.map +1 -1
  37. package/dist/jsx-to-ir.d.ts.map +1 -1
  38. package/dist/local-call-body.d.ts +112 -0
  39. package/dist/local-call-body.d.ts.map +1 -0
  40. package/dist/nullable-signal-attr.d.ts +10 -0
  41. package/dist/nullable-signal-attr.d.ts.map +1 -1
  42. package/dist/prop-default-resolution.d.ts +52 -0
  43. package/dist/prop-default-resolution.d.ts.map +1 -0
  44. package/dist/props-binding.d.ts +15 -0
  45. package/dist/props-binding.d.ts.map +1 -1
  46. package/dist/server-read-walk.d.ts +66 -0
  47. package/dist/server-read-walk.d.ts.map +1 -0
  48. package/dist/ssr-defaults.d.ts.map +1 -1
  49. package/dist/ssr-seed-plan.d.ts +24 -1
  50. package/dist/ssr-seed-plan.d.ts.map +1 -1
  51. package/dist/static-const-member.d.ts +92 -0
  52. package/dist/static-const-member.d.ts.map +1 -0
  53. package/dist/static-literal.d.ts +21 -1
  54. package/dist/static-literal.d.ts.map +1 -1
  55. package/dist/types.d.ts +63 -0
  56. package/dist/types.d.ts.map +1 -1
  57. package/package.json +2 -2
  58. package/src/__tests__/computed-const.test.ts +7 -1
  59. package/src/__tests__/const-identity-child-prop.test.ts +127 -0
  60. package/src/__tests__/inherited-const-server-read.test.ts +116 -0
  61. package/src/__tests__/issue-3688-props-spread-child-csr.test.ts +8 -3
  62. package/src/__tests__/issue-3714-open-rest-spread-child.test.ts +188 -0
  63. package/src/__tests__/local-call-body.test.ts +101 -0
  64. package/src/__tests__/loop-branch-bare-expression-reactive-text.test.ts +212 -56
  65. package/src/__tests__/nested-loop-conditional.test.ts +16 -16
  66. package/src/__tests__/prop-default-resolution.test.ts +185 -0
  67. package/src/__tests__/props-spread-shadowed.test.ts +113 -0
  68. package/src/__tests__/server-read-walk.test.ts +125 -0
  69. package/src/__tests__/ssr-defaults.test.ts +67 -7
  70. package/src/__tests__/static-literal.test.ts +47 -2
  71. package/src/__tests__/static-record-literal-array.test.ts +82 -11
  72. package/src/adapters/attr-plan.ts +12 -1
  73. package/src/adapters/component-props.ts +2 -1
  74. package/src/adapters/computed-const.ts +108 -12
  75. package/src/adapters/dsl-template-adapter.ts +17 -4
  76. package/src/adapters/inherited-const-server-read.ts +174 -0
  77. package/src/adapters/loop-row-type.ts +69 -2
  78. package/src/adapters/non-primitive-equality.ts +17 -2
  79. package/src/adapters/unapplied-prop-default.ts +83 -0
  80. package/src/adapters/uninlinable-seed-call.ts +62 -0
  81. package/src/analyzer.ts +43 -3
  82. package/src/augment-inherited-props.ts +4 -49
  83. package/src/caller-value-reach.ts +436 -0
  84. package/src/compiler.ts +4 -4
  85. package/src/const-identity.ts +189 -0
  86. package/src/index.ts +10 -5
  87. package/src/ir-to-client-js/child-props-object.ts +94 -62
  88. package/src/ir-to-client-js/collect-elements.ts +53 -68
  89. package/src/ir-to-client-js/component-scope.ts +16 -2
  90. package/src/ir-to-client-js/control-flow/plan/build-inner-loop.ts +1 -0
  91. package/src/ir-to-client-js/control-flow/plan/build-loop-child-arm.ts +1 -0
  92. package/src/ir-to-client-js/html-template.ts +24 -4
  93. package/src/ir-to-client-js/index.ts +2 -2
  94. package/src/ir-to-client-js/prop-handling.ts +4 -0
  95. package/src/jsx-to-ir.ts +40 -2
  96. package/src/local-call-body.ts +191 -0
  97. package/src/nullable-signal-attr.ts +39 -17
  98. package/src/prop-default-resolution.ts +195 -0
  99. package/src/props-binding.ts +16 -0
  100. package/src/server-read-walk.ts +174 -0
  101. package/src/ssr-defaults.ts +93 -10
  102. package/src/ssr-seed-plan.ts +104 -18
  103. package/src/static-const-member.ts +243 -0
  104. package/src/static-literal.ts +55 -1
  105. package/src/types.ts +63 -1
@@ -118,6 +118,14 @@ export interface SpreadPlanContext {
118
118
  /** A binding at the spread site shadows `name`. */
119
119
  isBound(name: string): boolean;
120
120
  }
121
+ /**
122
+ * Whether `value` spreads the component's own props object whole. The one
123
+ * answer every adapter uses: the spread names `propsObjectName` and Phase 1
124
+ * did not find a binding of that name in scope at the spread
125
+ * (`SpreadAttr.shadowsPropsObject`, #3727), so `rows.map((props) => <li
126
+ * {...props} />)` spreads the row.
127
+ */
128
+ export declare function spreadsPropsObject(value: SpreadAttr, propsObjectName: string | null): boolean;
121
129
  /** Plan a `{...spread}` attribute. */
122
130
  export declare function planSpreadAttr(value: SpreadAttr, ctx: SpreadPlanContext): SpreadAttrPlan;
123
131
  //# sourceMappingURL=attr-plan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"attr-plan.d.ts","sourceRoot":"","sources":["../../src/adapters/attr-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAiC,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACxF,OAAO,EAAmD,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACrH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAK3E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,OAAO,EAAE,yBAAyB,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO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AI,CAAA;IAC/B,gFAAgF;IAChF,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,GAAG,qBAAqB,EAAE,GAAG,IAAI,CAuBlH;AAED,qDAAqD;AACrD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,SAAS,2BAA2B,EAAE,GAAG,OAAO,CAE/F;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAM3G"}
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { type ParsedExpr } from '../expression-parser.ts';
18
18
  import type { ExpressionAttr, IRMetadata, ParamInfo } from '../types.ts';
19
+ import { type LocalCallBody } from '../local-call-body.ts';
19
20
  export interface ComputedConstContext {
20
21
  constants: IRMetadata['localConstants'] | undefined;
21
22
  /** Signal getters and memo names: the zero-arg calls a template reads as values. */
@@ -33,6 +34,24 @@ export interface ComputedConstContext {
33
34
  propReads: ReadonlyMap<string, string>;
34
35
  /** Component-scope local functions, which shadow a module const of the same name. */
35
36
  localFunctions: ReadonlySet<string>;
37
+ /**
38
+ * The functions whose zero-argument call a template reads as the
39
+ * expression they return (`localCallBodies`, #3721).
40
+ */
41
+ calls: ReadonlyMap<string, LocalCallBody>;
42
+ /**
43
+ * Typed props a template holds under their name although no component
44
+ * binding of that name is the prop: a `(props)`-arg component's prop the
45
+ * body never binds (`templatePropReadParams`). A const of such a name,
46
+ * read by its name, would read the prop, so it is always inlined.
47
+ */
48
+ propNamed: ReadonlySet<string>;
49
+ /**
50
+ * The functions whose zero-argument call a template cannot inline
51
+ * (`uninlinableLocalCalls`): read as a getter, the call would render an
52
+ * unbound name or a prop of that name, so it is refused.
53
+ */
54
+ uninlinableCalls: ReadonlySet<string>;
36
55
  /**
37
56
  * Names the component scope lexically binds (the props object, destructured
38
57
  * and rest props, its consts, local functions, signals, memos), which
@@ -1 +1 @@
1
- {"version":3,"file":"computed-const.d.ts","sourceRoot":"","sources":["../../src/adapters/computed-const.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAuF,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC9I,OAAO,KAAK,EAAgB,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAItF,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,UAAU,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAA;IACnD,oFAAoF;IACpF,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC5B,oGAAoG;IACpG,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACrC,iFAAiF;IACjF,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAClC;;;;;OAKG;IACH,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,qFAAqF;IACrF,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACnC;;;;;;OAMG;IACH,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACnC,mGAAmG;IACnG,KAAK,EAAE;QAAE,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;IAClE,gFAAgF;IAChF,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACjC,2FAA2F;IAC3F,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACrC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAChC;AAED,uFAAuF;AACvF,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAA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AG,EAAE,oBAAoB,GAAG,IAAI,GAAG,cAAc,CAQ/G"}
@@ -11,6 +11,7 @@ import { BindingScope } from '../scope/binding-scope.ts';
11
11
  import { type DeclaredValueTypes } from './loop-row-type.ts';
12
12
  import { type OperandTyping, type ScopedOperandTyping } from './operand-typing.ts';
13
13
  import type { CompilerError, ComponentIR, ConstantInfo, IRIfStatement, IRLoop, IRMetadata, PreambleValueDeclaration } from '../types.ts';
14
+ import { type NonPrimitiveEqualitySink } from './non-primitive-equality.ts';
14
15
  import { type ComputedConstContext } from './computed-const.ts';
15
16
  import { BaseAdapter, type AdapterGenerateOptions, type AdapterOutput } from './interface.ts';
16
17
  import { type LoopPlan, type LoopPlanContext } from './loop-plan.ts';
@@ -210,7 +211,7 @@ export declare abstract class DslTemplateAdapter extends BaseAdapter {
210
211
  * at the emission site.
211
212
  */
212
213
  protected arithmeticCoercion(op: string, operand: ParsedExpr, other: ParsedExpr | undefined, isShadowed: (name: string) => boolean): ArithmeticCoercion;
213
- private errorSink;
214
+ protected errorSink(): NonPrimitiveEqualitySink;
214
215
  /** {@link planLoop} against the current scope and the component's constants. */
215
216
  protected loopPlanFor<Spelled>(loop: IRLoop, spelling: LoopPlanSpelling<Spelled>): LoopPlan<Spelled>;
216
217
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"dsl-template-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/dsl-template-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAsD,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAChH,OAAO,EAA2D,KAA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zB,OAAO,CAAC,oBAAoB;CAwB7B"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * BF101 for an inherited literal-const read (`R.toString`, see
3
+ * `spellStaticConstMember`) in a value the server render computes (#3813).
4
+ *
5
+ * An emitter refuses the read where it spells it, but not every read the
6
+ * server render performs is spelled by an emitter whose refusal survives. A
7
+ * signal's seed, a memo's body, a const's initializer and the expression a
8
+ * called function returns are computed apart from the position that reads
9
+ * them: by the SSR seed plan (whose lowering failures fall back silently, on
10
+ * purpose, to the static SSR defaults), by the static evaluator, or on the
11
+ * backend. A position's own value can be dropped the same way (a child prop
12
+ * the Go constructor cannot compute is left out). The value then renders as
13
+ * if the key were missing.
14
+ *
15
+ * This pass refuses the read in each server-rendered position
16
+ * (`walkTemplatePositions`, read in the position's own scope) and in each
17
+ * declaration the server render reads (`walkServerReads`, the one walk of
18
+ * that relation). Both skip `/* @client *\/` positions and resolve each name
19
+ * lexically, so a loop row or a callback param named like a declaration is
20
+ * not that declaration. Within an expression only the reads its evaluation
21
+ * performs are refused: a function is entered where it is called or handed
22
+ * to a call (a callback, an IIFE, a local function or a method of a literal
23
+ * const called by name), not where it is stored
24
+ * (`{ get: () => R.toString }` read for another key, an event handler). A
25
+ * const that only names another (`const A = R`) is read as that one.
26
+ *
27
+ * A block-bodied memo no single expression stands for has no server value
28
+ * computed from its statements: it renders its static default. The browser
29
+ * still evaluates them for the same slot, so an inherited read in one of
30
+ * them (as far as the parse represents the block) is refused all the same;
31
+ * the block's own `const` / `let` names shadow the component's there.
32
+ */
33
+ import { type StaticConstMemberSink } from '../static-const-member.ts';
34
+ import type { ComponentIR } from '../types.ts';
35
+ /** Record BF101 for each inherited literal-const read the server render of `ir` performs. */
36
+ export declare function refuseInheritedConstServerReads(ir: ComponentIR, sink: StaticConstMemberSink): void;
37
+ //# sourceMappingURL=inherited-const-server-read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inherited-const-server-read.d.ts","sourceRoot":"","sources":["../../src/adapters/inherited-const-server-read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AASH,OAAO,EAAqF,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAEzJ,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAI9C,6FAA6F;AAC7F,wBAAgB,+BAA+B,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,qBAAqB,GAAG,IAAI,CA6BlG"}
@@ -27,6 +27,16 @@ export interface DeclaredValueTypes {
27
27
  readonly name: string;
28
28
  readonly type: TypeInfo;
29
29
  }[];
30
+ /**
31
+ * The component's module- and function-scope consts with their declared
32
+ * types (`const ROWS: Row[] = […]`), read when no prop or loop binding
33
+ * holds the name (#3728). Optional: a view without them types no const.
34
+ */
35
+ readonly constants?: readonly {
36
+ readonly name: string;
37
+ readonly type: TypeInfo | null;
38
+ readonly parsed?: ParsedExpr;
39
+ }[];
30
40
  /** The identifier the component reads its props object as (`props`); null for a destructured signature. */
31
41
  readonly propsObjectName: string | null;
32
42
  readonly namedFields: NamedTypeFields;
@@ -46,6 +56,14 @@ export declare function loopRowType(types: DeclaredValueTypes, loop: {
46
56
  * `undefined` (`loopValueTypeAt`).
47
57
  */
48
58
  export declare function declaredValueType(types: DeclaredValueTypes, expr: ParsedExpr, scope: BindingScope): LoopValueType | null;
59
+ /**
60
+ * Whether the value `expr` reads in `scope` is declared to admit `undefined`
61
+ * or `null` (#3728): a loop row's optional field (`r.tone` with
62
+ * `tone?: string`), a destructured one, or a nullable union. The one answer
63
+ * every template adapter's nullish-attribute guard reads
64
+ * (`NullishAttrContext.declaredNil`). An undeclared value answers false.
65
+ */
66
+ export declare function declaredValueMayBeNil(types: DeclaredValueTypes, expr: ParsedExpr, scope: BindingScope): boolean;
49
67
  /**
50
68
  * The type of `receiver.concat(...args)`: an array whose element type is the
51
69
  * union of the receiver's element type and each argument's (an array
@@ -1 +1 @@
1
- {"version":3,"file":"lo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AI,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI,CAO7G"}
@@ -15,7 +15,12 @@
15
15
  * The primitive plan names the refusal per node (`mode: 'refuse'`), and
16
16
  * every emitter spells the runtime's `strict_eq` for it; the error itself
17
17
  * is recorded here, once per component, over every template position, each
18
- * read in its own scope, and over the memo bodies the adapters seed at SSR.
18
+ * read in its own scope, over the memo bodies the adapters seed at SSR, and
19
+ * over the computed destructure defaults a backend applies
20
+ * (`appliedPropDefaults`) for a prop the server render reads. A default is
21
+ * checked as the expression it stands
22
+ * for: a const it reads twice (`DEF === DEF`) is spelled there as two
23
+ * separate literals, which no runtime compares as one reference.
19
24
  */
20
25
  import type { ComponentIR, CompilerError } from '../types.ts';
21
26
  import type { OperandTyping } from './operand-typing.ts';
@@ -26,7 +31,8 @@ export interface NonPrimitiveEqualitySink {
26
31
  }
27
32
  /**
28
33
  * Record BF101 for every `===` / `!==` over an operand that may be an
29
- * object in `ir`'s template positions and memo bodies. One error per
34
+ * object in `ir`'s template positions, memo bodies and applied prop
35
+ * defaults. One error per
30
36
  * comparison text per compile.
31
37
  */
32
38
  export declare function refuseNonPrimitiveStrictEquality(ir: ComponentIR, typing: OperandTyping, sink: NonPrimitiveEqualitySink): void;
@@ -1 +1 @@
1
- {"version":3,"file":"non-primitive-equality.d.ts","sourceRoot":"","sources":["../../src/adapters/non-primitive-equality.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAA;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,qBAAqB,CAAA;AAG7E,oDAAoD;AACpD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,CAAA;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AAoBD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,wBAAwB,GAAG,IAAI,CAe7H"}
1
+ {"version":3,"file":"non-primitive-equality.d.ts","sourceRoot":"","sources":["../../src/adapters/non-primitive-equality.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAA;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,qBAAqB,CAAA;AAI7E,oDAAoD;AACpD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,CAAA;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AAoBD;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,wBAAwB,GAAG,IAAI,CAsB7H"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * BF101 for a computed destructure default no template can apply (#3725).
3
+ *
4
+ * A backend applies a computed default when it renders, from the expression
5
+ * the default stands for once the consts and functions it reads are
6
+ * resolved (`appliedPropDefaults`). A default reading a component
7
+ * declaration with no such value (a signal, a memo, a `let`, a reassigned
8
+ * const, a function with parameters or statements, a const declared after
9
+ * the destructure) leaves nothing to apply, so an omitted prop would render
10
+ * empty where JS renders the default.
11
+ *
12
+ * Only a prop the server render reads is refused (`walkServerReads`): in a
13
+ * position, through a signal seed, a memo body or a const, or through
14
+ * another prop's default. A prop only an event handler reads (`{ onDone =
15
+ * handleDone }`) never renders its default on the server.
16
+ */
17
+ import { type ServerReadWalkOptions } from '../server-read-walk.ts';
18
+ import { type PropDefaultApplication } from '../ssr-seed-plan.ts';
19
+ import type { CompilerError, ComponentIR } from '../types.ts';
20
+ /** Where {@link refuseUnappliedPropDefaults} records its errors. */
21
+ export interface UnappliedPropDefaultSink {
22
+ readonly errors: CompilerError[];
23
+ readonly componentName: string;
24
+ }
25
+ /** Record BF101 for each prop the server render reads whose computed default no template can apply. */
26
+ export declare function refuseUnappliedPropDefaults(ir: ComponentIR, sink: UnappliedPropDefaultSink): void;
27
+ /**
28
+ * The props with a computed default that the server render reads, starting
29
+ * from the positions `startsAt` keeps (every position when unset): in a
30
+ * position, through a declaration it reads, or through another such prop's
31
+ * default.
32
+ */
33
+ export declare function propsReadFrom(ir: ComponentIR, defaults: PropDefaultApplication['defaults'], startsAt?: ServerReadWalkOptions['startsAt']): ReadonlySet<string>;
34
+ //# sourceMappingURL=unapplied-prop-default.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unapplied-prop-default.d.ts","sourceRoot":"","sources":["../../src/adapters/unapplied-prop-default.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAmB,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACpF,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE7D,oEAAoE;AACpE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,CAAA;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AAED,uGAAuG;AACvG,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,wBAAwB,GAAG,IAAI,CA4BjG;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,WAAW,EACf,QAAQ,EAAE,sBAAsB,CAAC,UAAU,CAAC,EAC5C,QAAQ,CAAC,EAAE,qBAAqB,CAAC,UAAU,CAAC,GAC3C,WAAW,CAAC,MAAM,CAAC,CAarB"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * BF101 for a value the server render reads that calls a function a
3
+ * template cannot inline (#3721).
4
+ *
5
+ * A template computes a signal's or memo's SSR value from its seed or body
6
+ * (the SSR seed plan, the static SSR defaults, Go's constructor), and a
7
+ * const's from its initializer. A zero-argument call of a local function is
8
+ * read there as the expression the function returns (`localCall`'s
9
+ * `inline`); a call of any other local function (`refuse`: parameters, a
10
+ * body other than a single `return`) has no value a template can compute,
11
+ * so the value would render as its empty static default where JS renders
12
+ * the call's result. The same call written in markup is refused by the
13
+ * shared inlining (`inlineComputedConsts`); this is the refusal for the
14
+ * value positions that inlining never sees.
15
+ *
16
+ * Only a value the server render reads is refused, however it is reached
17
+ * (`walkServerReads`): through a signal, a memo, a const initializer or an
18
+ * inlined function, each name resolved lexically. A `/* @client *\/` read
19
+ * and a loop row named like a component value read none.
20
+ */
21
+ import type { CompilerError, ComponentIR } from '../types.ts';
22
+ /** Where {@link refuseUninlinableSeedCalls} records its errors. */
23
+ export interface UninlinableSeedCallSink {
24
+ readonly errors: CompilerError[];
25
+ readonly componentName: string;
26
+ }
27
+ /** Record BF101 for each declaration the server render reads that calls an uninlinable local function. */
28
+ export declare function refuseUninlinableSeedCalls(ir: ComponentIR, sink: UninlinableSeedCallSink): void;
29
+ //# sourceMappingURL=uninlinable-seed-call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uninlinable-seed-call.d.ts","sourceRoot":"","sources":["../../src/adapters/uninlinable-seed-call.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAA;AAE7E,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,CAAA;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AAED,0GAA0G;AAC1G,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,uBAAuB,GAAG,IAAI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AI,CA+J/B;AAsGD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,GAAG,OAAO,CA6BpE;AA8ND;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAuCzE;AAuDD;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAelE;AAo5DD;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA6B3F;AAmZD,eAAO,MAAM,wBAAwB,aAMnC,CAAA;AAqBF;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,MAAM,EAAE,CAUV;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,2DAA2D;IAC3D,oBAAoB,EAAE,MAAM,EAAE,CAAA;CAC/B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAarF;AAkED,eAAO,MAAM,mBAAmB,aAG9B,CAAA;AAi5CF;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CA+EvE;AAybD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
@@ -11,7 +11,6 @@
11
11
  */
12
12
  import ts from 'typescript';
13
13
  import type { ComponentIR, IRMetadata } from './types.ts';
14
- import type { ParsedExpr } from './expression-parser.ts';
15
14
  /**
16
15
  * A `const x = useContext(SomeContext)` consumer in a component body. SSR
17
16
  * template adapters have no JS runtime context stack, so a consumer's value is
@@ -126,7 +125,7 @@ type StaticConstants = IRMetadata['localConstants'] | undefined;
126
125
  * The const declaration a read of `name` reaches, when its declared value
127
126
  * is what the read sees — the ONE decision behind every compile-time lookup
128
127
  * of a literal const's member (`lookupStaticRecordLiteral`,
129
- * `lookupStaticArrayElement`, the Go adapter's record lookup). Returns
128
+ * `lookupStaticConstMember`, the Go adapter's record lookup). Returns
130
129
  * `null` when the read must fall back to the generic lowering:
131
130
  *
132
131
  * - `isShadowed(name)`: an enclosing loop callback's param, index,
@@ -150,8 +149,9 @@ export declare function resolveStaticConstBinding(name: string, constants: Stati
150
149
  * compile-time lookup (the icon registry's `strokePaths['chevron-down']`,
151
150
  * pagination's `variantClasses.ghost`; #1896 / #1897). Returns the
152
151
  * looked-up scalar, or `null` for any other shape so callers fall back
153
- * to their generic lowering. A module array-literal const read with a
154
- * literal index (`QS[0]`) goes through `lookupStaticArrayElement` instead.
152
+ * to their generic lowering. A read the literal const answers structurally
153
+ * (an array element, a key the literal lacks) goes through
154
+ * `lookupStaticConstMember` (`static-const-member.ts`) first.
155
155
  * Shared by all seven template-string adapters;
156
156
  * the prop-KEYED variant of the pattern lives in `parseRecordIndexAccess`.
157
157
  *
@@ -169,24 +169,6 @@ export declare function lookupStaticRecordLiteral(objectName: string, key: strin
169
169
  kind: 'string' | 'number';
170
170
  text: string;
171
171
  } | null;
172
- /**
173
- * The element at `key` of a module or component-local array-literal const
174
- * (`QS[0]`, `QS['1']`)
175
- * or its `length`, as the element's own typed `ParsedExpr`: a string or
176
- * number `literal`, or a unary `-` over a number literal. The caller emits
177
- * it through its own expression emitter, exactly as if the source had
178
- * written the element in place, so a value such as `-0` keeps its sign in
179
- * arithmetic and a comparison (`1 / QS[0] < 0`) and is spelled `0` only
180
- * where JS stringifies it. An index key must be canonical (`'01'` names no
181
- * element). A hole or spread at or before the element (either also makes
182
- * `length` unknown), an out-of-range index or any other element shape is
183
- * `null`, so the caller falls back to its generic lowering.
184
- *
185
- * `isShadowed` is REQUIRED for the same reason as in
186
- * `lookupStaticRecordLiteral`; which declaration the name reaches is
187
- * `resolveStaticConstBinding`'s decision.
188
- */
189
- export declare function lookupStaticArrayElement(objectName: string, key: string, constants: StaticConstants, isShadowed: (name: string) => boolean): ParsedExpr | null;
190
172
  /**
191
173
  * A literal-initialized const's value. A number carries its `value` (a
192
174
  * `const NZ = -0` is negative zero, which `text` cannot say), which each
@@ -1 +1 @@
1
- {"version":3,"file":"augment-inherited-props.d.ts","sourceRoot":"","sources":["../src/augment-inherited-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAA+C,MAAM,YAAY,CAAA;AACtG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAA;IACjB,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;IAC9C;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAA;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,UAAU,GAAG,eAAe,EAAE,CA6B/E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,MAAM,GAAG,MAAM,CAI7G;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CA+MlE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG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MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8BjE;AAED,mFAAmF;AACnF,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE;QAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CACnD;AAED,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,aAAa,EAAE,MAAM,CAAA;IACrB,oFAAoF;IACpF,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,EAAE,CAAC,UAAU,EAClB,cAAc,EAAE,SAAS,UAAU,EAAE,EACrC,WAAW,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5C;;;;;GAKG;AACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAClF,iBAAiB,GAAG,IAAI,CA2D1B"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Whether an expression can reach a value the component's caller supplied
3
+ * that may be, or may build, a live element.
4
+ *
5
+ * A caller can hand a component an element factory: a callback prop
6
+ * (`renderNode={(n) => <Pill id={n.id} />}`), or an object holding one. The
7
+ * element such a callback returns owns its own state, so a branch that may
8
+ * hold one must not be evaluated again while it is mounted
9
+ * (`IRExpression.readsCallerValue`). The compiler cannot see what a caller
10
+ * passes, so the answer is built from the safe side: a name is safe only when
11
+ * the caller's props cannot reach it, and everything else is not.
12
+ *
13
+ * A name read inside the component is safe when it is
14
+ *
15
+ * - declared outside the component (a module const or function, an
16
+ * import, a global): it can see a prop only through an argument, and
17
+ * the arguments are read by the same walk;
18
+ * - a prop whose declared type holds data only (`isDataOnlyType`): a
19
+ * string, number, boolean, `null` or `undefined`, an array or object of
20
+ * those, or a function returning one;
21
+ * - a component `const` or `function` declaration whose initializer or
22
+ * body reads only safe names, through any number of hops.
23
+ *
24
+ * It is not safe when it is the props object used whole, a rest bag, a prop
25
+ * with any other or no declared type (`children` included), a `let`, a const
26
+ * the component mutates, a binding of a nested destructuring pattern, or a
27
+ * component declaration that reads any of these. How the value is then used
28
+ * does not matter: `props.render(row)`, `props['render'](row)`,
29
+ * `props.render.call(null, row)`, `apply(props.render, row)`, a wrapper
30
+ * `const draw = row => props.render(row)`, an object `{ draw: props.render }`
31
+ * and a memo or signal seeded from one all read an unsafe name.
32
+ *
33
+ * The declarations are read from the component function's own AST rather than
34
+ * from the analyzer's `localConstants` / `localFunctions` records: those hold
35
+ * free identifier NAMES, which cannot tell `props.count` from `props.render`,
36
+ * and they have no entry for an array pattern or a nested object pattern, so
37
+ * a name bound by one would read as a global.
38
+ */
39
+ import ts from 'typescript';
40
+ import type { AnalyzerContext } from './analyzer-context.ts';
41
+ import type { TypeInfo } from './types.ts';
42
+ /**
43
+ * Whether a value of `type` is data all the way down: it is not an element
44
+ * and calling anything it holds cannot produce one. A named type resolves
45
+ * through the file's own type definitions; one declared elsewhere is unknown.
46
+ */
47
+ export declare function isDataOnlyType(type: TypeInfo | undefined | null, analyzer: Pick<AnalyzerContext, 'typeDefinitions'>, seen?: ReadonlySet<string>): boolean;
48
+ /**
49
+ * Whether `node`, an expression of the component's JSX, reads a value the
50
+ * caller supplied that may be or build a live element. `rowName` answers for
51
+ * the names the enclosing loop rows bind: `true` for a row's item, index or
52
+ * destructured name (the row's own data), `false` for any other name a row
53
+ * or callback binds (a `.map()` preamble local, whose initializer this walk
54
+ * does not see), `undefined` for a name they do not bind.
55
+ */
56
+ export declare function readsCallerValue(node: ts.Node, analyzer: AnalyzerContext, rowName: (name: string) => boolean | undefined): boolean;
57
+ //# sourceMappingURL=caller-value-reach.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caller-value-reach.d.ts","sourceRoot":"","sources":["../src/caller-value-reach.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,YAAY,CAAA;AA8BrD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,EACjC,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,iBAAiB,CAAC,EAClD,IAAI,GAAE,WAAW,CAAC,MAAM,CAAa,GACpC,OAAO,CA8BT;AA4SD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,GAC7C,OAAO,CAYT"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Which consts a read site must reference as the binding itself rather than
3
+ * re-evaluate from the initializer (#3868).
4
+ *
5
+ * The client emitter passes a child component's props as getters, and for a
6
+ * prop whose value is a bare const it used to splice the const's initializer
7
+ * text into the getter (`get token() { return { n: 1 } }`). Each read then
8
+ * evaluated the initializer again. For a value that is a primitive this is
9
+ * invisible, and for one that reads a signal, a memo or a prop it is what
10
+ * keeps the prop live. For an initializer that allocates (an object or array
11
+ * literal, `new X()`, a call, a function expression) and reads nothing
12
+ * reactive it only breaks identity: two reads of the prop see two objects,
13
+ * where the source and the SSR render pass the one object the declaration
14
+ * created.
15
+ *
16
+ * The decision is made here, in Phase 1, from the initializer's AST and the
17
+ * component's bindings, and carried as `ConstantInfo.identityBound`. The
18
+ * emitter only reads the flag.
19
+ */
20
+ import ts from 'typescript';
21
+ import type { AnalyzerContext } from './analyzer-context.ts';
22
+ import type { ConstantInfo } from './types.ts';
23
+ /**
24
+ * Can evaluating `initializer` a second time yield a different object than
25
+ * the first evaluation did? True when the value it produces may be one it
26
+ * creates: an allocating expression itself, or a ternary / `??` / `||` /
27
+ * `&&` / comma whose result may be such an operand.
28
+ */
29
+ export declare function initializerAllocates(initializer: ts.Expression): boolean;
30
+ export declare function recordIdentityCandidate(constant: ConstantInfo, initializer: ts.Expression | undefined, checker: ts.TypeChecker | null): void;
31
+ /**
32
+ * Set `identityBound` on every const whose initializer allocates and reads
33
+ * nothing reactive (see the module comment). A const written after its
34
+ * declaration is left alone: `mutatedAfterDeclaration` already keeps it a
35
+ * reference.
36
+ */
37
+ export declare function markIdentityBoundConstants(ctx: AnalyzerContext): void;
38
+ //# sourceMappingURL=const-identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"const-identity.d.ts","sourceRoot":"","sources":["../src/const-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAuC9C;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,EAAE,CAAC,UAAU,GAAG,OAAO,CAUxE;AAuBD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,EAAE,CAAC,UAAU,GAAG,SAAS,EACtC,OAAO,EAAE,EAAE,CAAC,WAAW,GAAG,IAAI,GAC7B,IAAI,CAUN;AAkDD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAUrE"}
package/dist/index.d.ts CHANGED
@@ -13,7 +13,8 @@ export { propsDestructureBinding, buildPropAliasMap, isIdentifierName, resolveBo
13
13
  export type { SsrDefault } from './ssr-defaults.ts';
14
14
  export { resolveGetterAliases, collectAliasableGetterNames } from './ir-to-client-js/csr-substitute.ts';
15
15
  export { buildImportAliasMap } from './ir-to-client-js/component-scope.ts';
16
- export { computeSsrSeedPlan, hasComputedDefault, inDefaultReadOrder } from './ssr-seed-plan.ts';
16
+ export { appliedPropDefaults, computeSsrSeedPlan, hasComputedDefault, inDefaultReadOrder, type PropDefaultApplication } from './ssr-seed-plan.ts';
17
+ export type { ResolvedPropDefault } from './prop-default-resolution.ts';
17
18
  export type { SsrSeedPlan, SsrSeedStep } from './ssr-seed-plan.ts';
18
19
  export type { JsSourceText, ComponentIR, IRNode, IRElement, IRText, IRExpression, IRConditional, IRLoop, IRLoopChildComponent, LoopParamBinding, LoopBindingPathSegment, RestExcludeKey, IRComponent, IRFragment, IRSlot, IRIfStatement, IRProvider, IRAsync, IRMetadata, AttrValue, LiteralAttr, ExpressionAttr, TypedExprSource, BooleanAttr, BooleanShorthandAttr, TemplateAttr, SpreadAttr, JsxChildrenAttr, IRTemplatePart, IRProp, ParamInfo, PropDefaultPart, PropDefaultRead, PropertyInfo, MemoInfo, ConstantInfo, TypeInfo, TypeDefinition, SourceLocation, CompilerError, ErrorSuggestion, EscapeKind, EscapeSsrCost, ConformancePin, ConformancePins, RenderDivergences, ImportInfo, } from './types.ts';
19
20
  export { isElidedFactoryGetter, isChildrenPropParam } from './types.ts';
@@ -32,10 +33,13 @@ export type { JsxAdapterConfig } from './adapters/jsx-adapter.ts';
32
33
  export { rewriteImportsForTemplate, rewriteDynamicImportsInSource } from './adapters/template-imports.ts';
33
34
  export { emitParsedExpr, emitParsedValue, primitivePlanFor, arithmeticHelper, groupBinaryOperand, groupUnaryOperand, groupObjectLiteralSegments, isStringTypedOperand, isStringConcatBinary, isNumericArithmeticResult } from './adapters/parsed-expr-emitter.ts';
34
35
  export type { StringNameTest } from './adapters/parsed-expr-emitter.ts';
35
- export { concatType, declaredValueTypes, loopRowType, type DeclaredValueTypes } from './adapters/loop-row-type.ts';
36
+ export { concatType, declaredValueMayBeNil, declaredValueTypes, loopRowType, type DeclaredValueTypes } from './adapters/loop-row-type.ts';
36
37
  export { collectNumberValueNames, isNumberValuedExpr, numberValuedSeedNames } from './adapters/number-value.ts';
37
38
  export { operandFacts, planPrimitive, planTest, spellTest, primitivesAt, isNativePlan, relationalHelper, isNativeToNumber, booleanValueSites, planTextDisplay, foldNegatedNumberLiteral, numberLiteralSpelling, isRuntimeNumberLiteral, plusSpelling, planToString, needsToString, strictEqSpelling, mayHoldObject, isNullishTest, isNilLiteralOperand, nilTestOperand, refuseUnspelledNilTest, NON_PRIMITIVE_EQUALITY_REASON } from './adapters/primitive-plan.ts';
38
39
  export { refuseNonPrimitiveStrictEquality, type NonPrimitiveEqualitySink } from './adapters/non-primitive-equality.ts';
40
+ export { refuseInheritedConstServerReads } from './adapters/inherited-const-server-read.ts';
41
+ export { refuseUninlinableSeedCalls, type UninlinableSeedCallSink } from './adapters/uninlinable-seed-call.ts';
42
+ export { refuseUnappliedPropDefaults, type UnappliedPropDefaultSink } from './adapters/unapplied-prop-default.ts';
39
43
  export { rewriteNilReadings, rewriteNilReadingsDeep, isNilReadingFallback, NAN_LITERAL } from './adapters/nil-reading.ts';
40
44
  export type { PrimitiveOp, Proof, NativeSafeClaims, NativeSafeTable, PrimitiveHelper, NilTestHelper, PrimitivePlan, PrimitiveInputs, TextDisplay, NumberLiteralSpelling, PlusSpelling, StrictEqSpelling } from './adapters/primitive-plan.ts';
41
45
  export { collectOperandTyping, EMPTY_OPERAND_TYPING, UNKNOWN_FACTS, factsOf, factsOfType, isExactly, isNeverNil, provenPrimitive, typingFromNameTest, unionFacts, } from './adapters/operand-typing.ts';
@@ -58,13 +62,13 @@ export type { ArrayMethodArg, ArrayMethodDefault, ArrayMethodEntry, ArrayMethodH
58
62
  export { derivesScopeFromSlot } from './adapters/child-scope.ts';
59
63
  export { childTemplateName, componentPropKey, isEmptyComponentProps, planComponentProps, propsSpreadParam, resolveComponentPropKeys, spellComponentProps, templatePropValue } from './adapters/component-props.ts';
60
64
  export type { ComponentPropEntry, ComponentPropSegment, ComponentPropSpelling, ComponentPropsOptions, ComponentPropsParam, EarlierComponentProps, ResolvedComponentProp, SpelledComponentPropSegment } from './adapters/component-props.ts';
61
- export { parseUndefinedAlternateTernary, planAttrExpression, planSpreadAttr, } from './adapters/attr-plan.ts';
65
+ export { parseUndefinedAlternateTernary, planAttrExpression, planSpreadAttr, spreadsPropsObject, } from './adapters/attr-plan.ts';
62
66
  export type { AttrExpressionPlan, AttrPlanContext, SpreadAttrPlan, SpreadPlanContext, UndefinedAlternateTernary } from './adapters/attr-plan.ts';
63
67
  export { loopHeaderTargets, planLoop, savedLoopBindings, spellDestructureLocals, spellFilteredRow, spellSortedSource } from './adapters/loop-plan.ts';
64
68
  export { computedConstContext, inlineComputedConstAttr, inlineComputedConsts } from './adapters/computed-const.ts';
65
69
  export type { ComputedConstContext } from './adapters/computed-const.ts';
66
70
  export type { DestructureSpelling, DestructureValue, LoopFilterPlan, LoopFilterPredicate, LoopFilterSpelling, LoopPlan, LoopPlanContext, LoopRowScopes, LoopSortSpelling, SavedLoopBinding, } from './adapters/loop-plan.ts';
67
- export { evaluateStaticLiteral, isFullyStaticLiteral, resolveStaticLoopSource } from './static-literal.ts';
71
+ export { evaluateStaticLiteral, foldStaticBindings, isFullyStaticLiteral, resolveStaticLoopSource } from './static-literal.ts';
68
72
  export { arithmeticOperandIsNull, arithmeticOperandIsUndefined, arithmeticOperandCoercion, bareGetterCallName, attrValueMayBeNullish, collectAbsentPropSeedReads, collectNullableSignalGetters, collectNullishAttrContext, nullablePropsYieldedBy, isNeverNullishOperand, isNullableSignal, isNullishLiteral, NULL_COERCING_ARITHMETIC_OPS, nullableSignalAttrGetter, type NullishAttrContext, type ArithmeticCoercion, } from './nullable-signal-attr.ts';
69
73
  export { importsSearchParams, searchParamsLocalNames, envSignalLocalNames, envSignalReaderFor, ENV_SIGNAL_READERS, queryHrefLocalNames, matchSearchParamsMethodCall } from './adapters/env-signal.ts';
70
74
  export type { EnvSignalReader } from './adapters/env-signal.ts';
@@ -153,7 +157,8 @@ export { buildReactiveProfile, buildProfileFromGraph, diffProfiles, formatSingle
153
157
  export type { ComponentProfile, ComponentProfileMetrics, ProfileFinding, ProfileDiff, ProfileDiffEntry, } from './debug-profile.ts';
154
158
  export { BOOLEAN_ATTRS, isBooleanAttr } from './html-constants.ts';
155
159
  export { USE_CLIENT_DIRECTIVE, CLIENT_EXPRESSION_DIRECTIVE } from './directives.ts';
156
- export { augmentInheritedPropAccesses, parseRecordIndexAccess, evalStringArrayJoin, collectModuleStringConsts, lookupStaticRecordLiteral, lookupStaticArrayElement, resolveStaticConstBinding, lookupLiteralConst, collectContextConsumers, contextConsumerSeed, type LiteralConst } from './augment-inherited-props.ts';
160
+ export { augmentInheritedPropAccesses, parseRecordIndexAccess, evalStringArrayJoin, collectModuleStringConsts, lookupStaticRecordLiteral, resolveStaticConstBinding, lookupLiteralConst, collectContextConsumers, contextConsumerSeed, type LiteralConst } from './augment-inherited-props.ts';
157
161
  export type { RecordIndexAccess, RecordIndexEntry, ContextConsumer } from './augment-inherited-props.ts';
162
+ export { lookupStaticConstMember, readStaticConstMember, spellStaticConstMember, staticIndexKey, type StaticConstMemberRead, type StaticConstMemberSink } from './static-const-member.ts';
158
163
  export type { TargetedEvent, TargetedInputEvent, TargetedFocusEvent, TargetedKeyboardEvent, TargetedMouseEvent, InputEventHandler, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, ChangeEventHandler, BaseEventAttributes, HTMLBaseAttributes, HTMLAttributeFormEnctype, HTMLAttributeFormMethod, HTMLAttributeAnchorTarget, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes, FormHTMLAttributes, AnchorHTMLAttributes, ImgHTMLAttributes, LabelHTMLAttributes, OptionHTMLAttributes, SVGSVGAttributes, } from './html-types.ts';
159
164
  //# sourceMappingURL=index.d.ts.map