@barefootjs/jsx 0.39.6 → 0.39.8

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 (192) hide show
  1. package/dist/adapters/attr-plan.d.ts +8 -1
  2. package/dist/adapters/attr-plan.d.ts.map +1 -1
  3. package/dist/adapters/callback-method.d.ts +44 -0
  4. package/dist/adapters/callback-method.d.ts.map +1 -1
  5. package/dist/adapters/component-props.d.ts +80 -13
  6. package/dist/adapters/component-props.d.ts.map +1 -1
  7. package/dist/adapters/computed-const.d.ts +52 -0
  8. package/dist/adapters/computed-const.d.ts.map +1 -0
  9. package/dist/adapters/dangerous-inner-html.d.ts +10 -0
  10. package/dist/adapters/dangerous-inner-html.d.ts.map +1 -1
  11. package/dist/adapters/dsl-template-adapter.d.ts +151 -0
  12. package/dist/adapters/dsl-template-adapter.d.ts.map +1 -0
  13. package/dist/adapters/element-shell.d.ts +44 -0
  14. package/dist/adapters/element-shell.d.ts.map +1 -0
  15. package/dist/adapters/interface.d.ts +2 -0
  16. package/dist/adapters/interface.d.ts.map +1 -1
  17. package/dist/adapters/jsx-adapter.d.ts +4 -0
  18. package/dist/adapters/jsx-adapter.d.ts.map +1 -1
  19. package/dist/adapters/literal-value.d.ts +2 -2
  20. package/dist/adapters/literal-value.d.ts.map +1 -1
  21. package/dist/adapters/parsed-expr-emitter.d.ts +27 -0
  22. package/dist/adapters/parsed-expr-emitter.d.ts.map +1 -1
  23. package/dist/adapters/style-object.d.ts +33 -0
  24. package/dist/adapters/style-object.d.ts.map +1 -0
  25. package/dist/analyzer.d.ts.map +1 -1
  26. package/dist/augment-inherited-props.d.ts +7 -0
  27. package/dist/augment-inherited-props.d.ts.map +1 -1
  28. package/dist/children-nullish.d.ts +22 -0
  29. package/dist/children-nullish.d.ts.map +1 -0
  30. package/dist/errors.d.ts +1 -0
  31. package/dist/errors.d.ts.map +1 -1
  32. package/dist/expression-parser.d.ts +9 -19
  33. package/dist/expression-parser.d.ts.map +1 -1
  34. package/dist/fold-render-reassignments.d.ts +43 -0
  35. package/dist/fold-render-reassignments.d.ts.map +1 -0
  36. package/dist/free-refs.d.ts +15 -0
  37. package/dist/free-refs.d.ts.map +1 -1
  38. package/dist/index.d.ts +21 -14
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +24620 -23233
  41. package/dist/ir-to-client-js/compute-inlinability.d.ts.map +1 -1
  42. package/dist/ir-to-client-js/control-flow/plan/event-collision.d.ts +2 -1
  43. package/dist/ir-to-client-js/control-flow/plan/event-collision.d.ts.map +1 -1
  44. package/dist/ir-to-client-js/control-flow/plan/insert.d.ts +2 -2
  45. package/dist/ir-to-client-js/control-flow/plan/insert.d.ts.map +1 -1
  46. package/dist/ir-to-client-js/control-flow/stringify/event-delegation.d.ts.map +1 -1
  47. package/dist/ir-to-client-js/control-flow/stringify/event-listener.d.ts +10 -9
  48. package/dist/ir-to-client-js/control-flow/stringify/event-listener.d.ts.map +1 -1
  49. package/dist/ir-to-client-js/csr-substitute.d.ts +0 -13
  50. package/dist/ir-to-client-js/csr-substitute.d.ts.map +1 -1
  51. package/dist/ir-to-client-js/emit-reactive.d.ts +1 -1
  52. package/dist/ir-to-client-js/emit-reactive.d.ts.map +1 -1
  53. package/dist/ir-to-client-js/emit-registration.d.ts +10 -8
  54. package/dist/ir-to-client-js/emit-registration.d.ts.map +1 -1
  55. package/dist/ir-to-client-js/generate-init.d.ts.map +1 -1
  56. package/dist/ir-to-client-js/html-template.d.ts +9 -19
  57. package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
  58. package/dist/ir-to-client-js/identifiers.d.ts +6 -8
  59. package/dist/ir-to-client-js/identifiers.d.ts.map +1 -1
  60. package/dist/ir-to-client-js/imports.d.ts +23 -2
  61. package/dist/ir-to-client-js/imports.d.ts.map +1 -1
  62. package/dist/ir-to-client-js/index.d.ts.map +1 -1
  63. package/dist/ir-to-client-js/phases/props-extraction.d.ts +3 -2
  64. package/dist/ir-to-client-js/phases/props-extraction.d.ts.map +1 -1
  65. package/dist/ir-to-client-js/plan/declaration-emit.d.ts +5 -0
  66. package/dist/ir-to-client-js/plan/declaration-emit.d.ts.map +1 -1
  67. package/dist/ir-to-client-js/prop-handling.d.ts +11 -12
  68. package/dist/ir-to-client-js/prop-handling.d.ts.map +1 -1
  69. package/dist/ir-to-client-js/prune-unused-prop-extractions.d.ts +1 -1
  70. package/dist/ir-to-client-js/prune-unused-prop-extractions.d.ts.map +1 -1
  71. package/dist/ir-to-client-js/reactivity.d.ts.map +1 -1
  72. package/dist/ir-to-client-js/rewrite-destructured-props.d.ts +1 -1
  73. package/dist/ir-to-client-js/rewrite-destructured-props.d.ts.map +1 -1
  74. package/dist/ir-to-client-js/safe-html.d.ts +20 -2
  75. package/dist/ir-to-client-js/safe-html.d.ts.map +1 -1
  76. package/dist/ir-to-client-js/types.d.ts +3 -3
  77. package/dist/ir-to-client-js/types.d.ts.map +1 -1
  78. package/dist/ir-to-client-js/utils.d.ts +15 -11
  79. package/dist/ir-to-client-js/utils.d.ts.map +1 -1
  80. package/dist/jsx-to-ir.d.ts.map +1 -1
  81. package/dist/nullable-signal-attr.d.ts +43 -12
  82. package/dist/nullable-signal-attr.d.ts.map +1 -1
  83. package/dist/prop-rewrite.d.ts +18 -0
  84. package/dist/prop-rewrite.d.ts.map +1 -1
  85. package/dist/props-binding.d.ts +43 -6
  86. package/dist/props-binding.d.ts.map +1 -1
  87. package/dist/relocate.d.ts +16 -0
  88. package/dist/relocate.d.ts.map +1 -1
  89. package/dist/scanner/js-scanner.d.ts.map +1 -1
  90. package/dist/scanner/js-scanner.js +30 -2
  91. package/dist/signal-prop-name-collision.d.ts +6 -5
  92. package/dist/signal-prop-name-collision.d.ts.map +1 -1
  93. package/dist/ssr-defaults.d.ts +28 -0
  94. package/dist/ssr-defaults.d.ts.map +1 -1
  95. package/dist/ssr-seed-plan.d.ts +37 -18
  96. package/dist/ssr-seed-plan.d.ts.map +1 -1
  97. package/dist/types.d.ts +162 -20
  98. package/dist/types.d.ts.map +1 -1
  99. package/dist/value-references.d.ts +21 -0
  100. package/dist/value-references.d.ts.map +1 -1
  101. package/package.json +2 -2
  102. package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +18 -18
  103. package/src/__tests__/adapter-output.test.ts +5 -3
  104. package/src/__tests__/analyzer.test.ts +33 -0
  105. package/src/__tests__/arithmetic-lowering.test.ts +44 -0
  106. package/src/__tests__/block-memo-type.test.ts +51 -0
  107. package/src/__tests__/callback-method.test.ts +75 -0
  108. package/src/__tests__/children-read.test.ts +226 -0
  109. package/src/__tests__/client-only-date-lowering.test.ts +2 -2
  110. package/src/__tests__/client-template-escape-soundness.test.ts +31 -1
  111. package/src/__tests__/component-props.test.ts +68 -1
  112. package/src/__tests__/computed-const.test.ts +101 -0
  113. package/src/__tests__/constant-inlining-tree.test.ts +136 -0
  114. package/src/__tests__/destructure-default-reads-earlier-param.test.ts +138 -0
  115. package/src/__tests__/dsl-template-adapter.test.ts +173 -0
  116. package/src/__tests__/element-shell.test.ts +78 -0
  117. package/src/__tests__/event-handler-verbatim.test.ts +73 -0
  118. package/src/__tests__/expression-parser.test.ts +1 -44
  119. package/src/__tests__/fold-render-reassignments.test.ts +96 -0
  120. package/src/__tests__/inlinable-local-method-call.test.ts +81 -0
  121. package/src/__tests__/memo-body-expr.test.ts +120 -0
  122. package/src/__tests__/nullable-signal-attr.test.ts +67 -3
  123. package/src/__tests__/prop-handling.test.ts +35 -16
  124. package/src/__tests__/props-alias-const.test.ts +65 -0
  125. package/src/__tests__/reference-graph-identifiers.test.ts +161 -0
  126. package/src/__tests__/runtime-import-detection.test.ts +134 -0
  127. package/src/__tests__/signal-prop-name-collision.test.ts +30 -0
  128. package/src/__tests__/signal-prop-seed.test.ts +90 -0
  129. package/src/__tests__/ssr-defaults.test.ts +19 -1
  130. package/src/__tests__/ssr-seed-plan.test.ts +173 -1
  131. package/src/__tests__/static-template-reachability.test.ts +137 -0
  132. package/src/__tests__/style-object-plan.test.ts +54 -0
  133. package/src/__tests__/zero-param-helper-inline.test.ts +57 -0
  134. package/src/adapters/attr-plan.ts +29 -1
  135. package/src/adapters/callback-method.ts +85 -0
  136. package/src/adapters/component-props.ts +130 -12
  137. package/src/adapters/computed-const.ts +185 -0
  138. package/src/adapters/dangerous-inner-html.ts +33 -0
  139. package/src/adapters/dsl-template-adapter.ts +248 -0
  140. package/src/adapters/element-shell.ts +160 -0
  141. package/src/adapters/interface.ts +8 -0
  142. package/src/adapters/jsx-adapter.ts +12 -6
  143. package/src/adapters/literal-value.ts +2 -2
  144. package/src/adapters/parsed-expr-emitter.ts +34 -0
  145. package/src/adapters/style-object.ts +61 -0
  146. package/src/analyzer.ts +382 -94
  147. package/src/augment-inherited-props.ts +12 -0
  148. package/src/children-nullish.ts +33 -0
  149. package/src/debug.ts +2 -2
  150. package/src/errors.ts +12 -0
  151. package/src/expression-parser.ts +56 -53
  152. package/src/fold-render-reassignments.ts +314 -0
  153. package/src/free-refs.ts +77 -17
  154. package/src/index.ts +27 -10
  155. package/src/ir-to-client-js/compute-inlinability.ts +122 -19
  156. package/src/ir-to-client-js/control-flow/plan/event-collision.ts +2 -1
  157. package/src/ir-to-client-js/control-flow/plan/insert.ts +2 -2
  158. package/src/ir-to-client-js/control-flow/stringify/event-delegation.ts +3 -2
  159. package/src/ir-to-client-js/control-flow/stringify/event-listener.ts +13 -12
  160. package/src/ir-to-client-js/csr-substitute.ts +25 -37
  161. package/src/ir-to-client-js/emit-reactive.ts +2 -2
  162. package/src/ir-to-client-js/emit-registration.ts +31 -59
  163. package/src/ir-to-client-js/generate-init.ts +17 -1
  164. package/src/ir-to-client-js/html-template.ts +56 -120
  165. package/src/ir-to-client-js/identifiers.ts +75 -24
  166. package/src/ir-to-client-js/imports.ts +56 -19
  167. package/src/ir-to-client-js/index.ts +5 -3
  168. package/src/ir-to-client-js/init-declarations.ts +1 -1
  169. package/src/ir-to-client-js/phases/event-handlers.ts +2 -2
  170. package/src/ir-to-client-js/phases/props-extraction.ts +16 -15
  171. package/src/ir-to-client-js/plan/build-declaration-emit.ts +26 -52
  172. package/src/ir-to-client-js/plan/declaration-emit.ts +5 -0
  173. package/src/ir-to-client-js/prop-handling.ts +13 -54
  174. package/src/ir-to-client-js/prune-unused-prop-extractions.ts +7 -4
  175. package/src/ir-to-client-js/reactivity.ts +2 -2
  176. package/src/ir-to-client-js/rewrite-destructured-props.ts +27 -9
  177. package/src/ir-to-client-js/safe-html.ts +29 -35
  178. package/src/ir-to-client-js/stringify/declaration-emit.ts +1 -1
  179. package/src/ir-to-client-js/types.ts +3 -2
  180. package/src/ir-to-client-js/utils.ts +13 -26
  181. package/src/jsx-to-ir.ts +318 -130
  182. package/src/nullable-signal-attr.ts +156 -37
  183. package/src/prop-rewrite.ts +41 -0
  184. package/src/props-binding.ts +117 -7
  185. package/src/relocate.ts +40 -8
  186. package/src/scanner/__tests__/js-scanner.test.ts +37 -0
  187. package/src/scanner/js-scanner.ts +64 -4
  188. package/src/signal-prop-name-collision.ts +50 -24
  189. package/src/ssr-defaults.ts +47 -20
  190. package/src/ssr-seed-plan.ts +121 -29
  191. package/src/types.ts +165 -21
  192. package/src/value-references.ts +132 -0
@@ -12,7 +12,7 @@
12
12
  import { type ParsedExpr } from '../expression-parser.ts';
13
13
  import type { LoweringMatcher } from '../lowering-registry.ts';
14
14
  import { type NullishAttrContext } from '../nullable-signal-attr.ts';
15
- import type { ConstantInfo, ExpressionAttr, SpreadAttr } from '../types.ts';
15
+ import type { CompilerError, ConstantInfo, ExpressionAttr, SpreadAttr } from '../types.ts';
16
16
  /**
17
17
  * Whether an attribute value is a shape no template lowers: a JS object
18
18
  * literal (`style={{…}}` aside, which the adapter lowers first) or a
@@ -24,6 +24,13 @@ import type { ConstantInfo, ExpressionAttr, SpreadAttr } from '../types.ts';
24
24
  export declare function unsupportedAttrExpression(expr: string, loweringMatchers: readonly LoweringMatcher[]): {
25
25
  reason: string | undefined;
26
26
  } | null;
27
+ /**
28
+ * The BF101 for an attribute value {@link unsupportedAttrExpression}
29
+ * refuses, worded for one adapter (`adapterLabel`, e.g. `Mojo`) and its
30
+ * template language (`languageLabel`, e.g. `Embedded Perl`); `null` when the
31
+ * value goes on to {@link planAttrExpression}.
32
+ */
33
+ export declare function unsupportedAttrExpressionError(expr: string, attrName: string, loweringMatchers: readonly LoweringMatcher[], componentName: string, adapterLabel: string, languageLabel: string): CompilerError | null;
27
34
  /**
28
35
  * The emission of an `{expr}` attribute value.
29
36
  *
@@ -1 +1 @@
1
- {"version":3,"file":"attr-plan.d.ts","sourceRoot":"","sources":["../../src/adapters/attr-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAA8C,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACrG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAmD,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACrH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAK3E;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,SAAS,eAAe,EAAE,GAC3C;IAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,IAAI,CAUvC;AAED;;;;;;;;;;;;;;;;;;;;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,C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;AACrF,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,yBAAyB,GAAG,IAAI,CAc7F;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;CAAE,CAAA;AAEhE,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,WAAW,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC5C,cAAc,EAAE,SAAS,YAAY,EAAE,CAAA;IACvC,mDAAmD;IACnD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAC/B;AAED,sCAAsC;AACtC,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,iBAAiB,GAAG,cAAc,CASxF"}
@@ -114,6 +114,50 @@ export interface CallbackEvalSpelling {
114
114
  * renders each captured name's SSR value, after the receiver.
115
115
  */
116
116
  export declare function emitCallbackEval(plan: CallbackEvalPlan, recv: string, emit: (e: ParsedExpr) => string, spelling: CallbackEvalSpelling): string;
117
+ /**
118
+ * Whether a call that reached an adapter's generic fallback has no lowering
119
+ * (#3493). A zero-arg call reads a getter (`props.value()`, a getter passed
120
+ * as a prop, a context getter `ctx.open()`), unless its receiver is rooted at
121
+ * a JavaScript global (`Date.now()`, `window.performance.now()`): `isGlobal`
122
+ * answers that from the component's bindings and the live loop scope, and a
123
+ * global has no binding in template scope (#3505). A call to a
124
+ * function-valued prop (`props.renderNode(node)`, a render prop) names a
125
+ * value a backend caller never passes, so the guard around it is never taken
126
+ * there; it keeps the callee read. Any other call with arguments
127
+ * (`s().localeCompare('m')`) would lose the call and its arguments.
128
+ * `propsObjectName` is the undestructured props parameter (`props`), `null`
129
+ * when the props are destructured: a destructured render prop is a
130
+ * bare-name call, which the adapters refuse on their own.
131
+ */
132
+ export declare function isUnloweredCall(callee: ParsedExpr, args: readonly ParsedExpr[], propsObjectName: string | null, isGlobal: (name: string) => boolean): boolean;
133
+ /**
134
+ * The BF101 for a call no template lowers: a method outside the array-method
135
+ * catalogue (`s().localeCompare('m')`), a zero-arg call on a JavaScript
136
+ * global (`Date.now()`), or any other callee that is not a getter, a template
137
+ * primitive or a lowering plugin's call. Read as its callee, the call and its
138
+ * arguments would silently disappear (#3493, #3505).
139
+ */
140
+ export declare function unloweredCallRefusal(callee: ParsedExpr, args: readonly ParsedExpr[], adapterName: string): {
141
+ message: string;
142
+ suggestion: string;
143
+ };
144
+ /**
145
+ * BF101 for a `.filter(...).map(...)` predicate shape a DSL adapter's filter
146
+ * emitter has no form for: a conditional, a template literal, an object
147
+ * literal, a standalone arrow or regex, or an unsupported node (#3534). The
148
+ * emitters used to stand a truthy constant in for these, so every row
149
+ * rendered; the same predicate outside a loop is evaluated or refused, never
150
+ * guessed.
151
+ */
152
+ export declare function filterPredicateShapeRefusal(shape: string, adapterName: string): {
153
+ message: string;
154
+ suggestion: string;
155
+ };
156
+ /** BF101 for a loop filter whose predicate never reached the IR (#3534). */
157
+ export declare function missingFilterPredicateRefusal(raw: string, adapterName: string): {
158
+ message: string;
159
+ suggestion: string;
160
+ };
117
161
  /**
118
162
  * The BF101 for a callback method nested inside a filter predicate, which a
119
163
  * predicate emitter has no scalar form for.
@@ -1 +1 @@
1
- {"version":3,"file":"callback-method.d.ts","sourceRoot":"","sources":["../../src/adapters/callback-method.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAML,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAA;AAEhC,KAAK,KAAK,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;C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;AAED,4EAA4E;AAC5E,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAKvH;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAKlH"}
@@ -5,15 +5,19 @@
5
5
  * Every DSL adapter assembles them the same way: callback props and `ref`
6
6
  * are client-only and dropped; a named JSX-valued prop is captured as
7
7
  * HTML; `{...props}` (the component's own props object, which no DSL scope
8
- * holds as one value) enumerates the props params; any other spread is
9
- * folded in at its source position, so a later entry wins on a key
10
- * conflict, as in `{...a, ...b}`; then the compiler-controlled `_bf_slot`
11
- * and `children` entries come last, so a spread can never override them.
8
+ * holds as one value) enumerates the props params, and a param that
9
+ * something earlier in the call may have set is carried only when the
10
+ * caller passed it ({@link propsSpreadParam}); any other spread is folded
11
+ * in at its source position, so a later entry wins on a key conflict, as in
12
+ * `{...a, ...b}`; then the compiler-controlled `_bf_slot` and `children`
13
+ * entries come last, so a spread can never override them.
12
14
  * {@link planComponentProps} makes those decisions once. An adapter spells
13
15
  * the entries and spreads through {@link spellComponentProps}, keeps its
14
16
  * own capture mechanism (`{% set %}…{% endset %}`, `_erbout.slice!`,
15
17
  * `begin … end`, a Kolon macro), and folds the spelled segments into its
16
- * own hash literal.
18
+ * own hash literal. An adapter that builds the child's input as a typed
19
+ * literal at compile time instead (Go's `<Child>Input{...}`) reads the same
20
+ * plan one key at a time through {@link resolveComponentPropKeys}.
17
21
  */
18
22
  import type { AttrValue, IRComponent, IRNode, SpreadAttr } from '../types.ts';
19
23
  /** One entry of the props hash. */
@@ -45,31 +49,69 @@ export type ComponentPropEntry =
45
49
  kind: 'children';
46
50
  children: IRNode[];
47
51
  };
48
- /** A run of entries, or a spread folded in at its source position. */
52
+ /**
53
+ * A run of entries, a spread folded in at its source position, or one param
54
+ * of `{...props}` that the spread carries only when the caller passed it
55
+ * ({@link propsSpreadParam}). An adapter folds a `present-param` in like a
56
+ * spread of a one-key (or empty) hash.
57
+ */
49
58
  export type ComponentPropSegment = {
50
59
  kind: 'entries';
51
60
  entries: ComponentPropEntry[];
52
61
  } | {
53
62
  kind: 'spread';
54
63
  value: SpreadAttr;
64
+ } | {
65
+ kind: 'present-param';
66
+ name: string;
55
67
  };
68
+ /** A props param as `{...props}` enumerates it. */
69
+ export interface ComponentPropsParam {
70
+ name: string;
71
+ /** `false` for a required param, which the caller always passes. Unknown counts as optional. */
72
+ optional?: boolean;
73
+ }
56
74
  export interface ComponentPropsOptions {
57
75
  /** The SolidJS-style props identifier (`function C(props: P)`), if any. */
58
76
  propsObjectName: string | null;
59
77
  /** The analyzer-extracted props params, which `{...props}` enumerates. */
60
- propsParams: ReadonlyArray<{
61
- name: string;
62
- }>;
78
+ propsParams: ReadonlyArray<ComponentPropsParam>;
63
79
  }
80
+ /** What a call has set before a `{...props}` spread, as far as the compiler can see. */
81
+ export interface EarlierComponentProps {
82
+ /** The keys an earlier entry sets. */
83
+ keys: ReadonlySet<string>;
84
+ /** Whether an earlier spread whose keys are unknown may have set any key. */
85
+ spread: boolean;
86
+ }
87
+ /**
88
+ * How `{...props}` carries one param. JS spreads only the keys the props
89
+ * object has, so a param the caller left out keeps whatever an earlier entry
90
+ * or spread set: `<Tag size="s" {...props} />` keeps `size="s"` when the
91
+ * caller passes no `size`.
92
+ *
93
+ * - `'entry'`: an ordinary entry. Either nothing earlier can set the key, so
94
+ * an absent param and a nil one read the same to the child, or the param is
95
+ * required, so the caller always passes it and it always wins.
96
+ * - `'present'`: carried only when the caller passed it, so an absent param
97
+ * leaves the earlier value alone.
98
+ *
99
+ * A template backend reads an absent prop and an explicit `undefined` or
100
+ * `null` one as the same nil, so "passed" is spelled "not nil" there: a
101
+ * caller that passes `undefined`/`null` keeps the earlier value, where JS
102
+ * would override it with the nil (limitation
103
+ * `props-spread-explicit-null-override`).
104
+ */
105
+ export declare function propsSpreadParam(param: ComponentPropsParam, earlier: EarlierComponentProps): 'entry' | 'present';
64
106
  /** The key an entry sets in the props hash. */
65
107
  export declare function componentPropKey(entry: ComponentPropEntry): string;
66
108
  /**
67
109
  * The ordered props segments for `comp`. The first segment is always an
68
- * (possibly empty) entries segment, and a spread is followed by a new one
69
- * only when an entry comes after it.
110
+ * (possibly empty) entries segment, and a spread or a `present-param` is
111
+ * followed by a new one only when an entry comes after it.
70
112
  */
71
- export declare function planComponentProps(comp: IRComponent, options: ComponentPropsOptions): ComponentPropSegment[];
72
- /** A spelled segment: the entries' hash-literal parts, or the spread's expression. */
113
+ export declare function planComponentProps(comp: Pick<IRComponent, 'props' | 'children' | 'slotId' | 'loopItemRoot'>, options: ComponentPropsOptions): ComponentPropSegment[];
114
+ /** A spelled segment: the entries' hash-literal parts, or the expression a spread folds in. */
73
115
  export type SpelledComponentPropSegment = {
74
116
  kind: 'entries';
75
117
  parts: string[];
@@ -82,12 +124,37 @@ export interface ComponentPropSpelling {
82
124
  entry(entry: ComponentPropEntry): string;
83
125
  /** The expression a spread folds in. */
84
126
  spread(value: SpreadAttr): string;
127
+ /**
128
+ * The expression a `present-param` segment folds in like a spread: a
129
+ * one-key hash `{ name: <param> }` when the param is not nil, an empty
130
+ * hash when it is.
131
+ */
132
+ presentParam(name: string): string;
85
133
  }
86
134
  /**
87
135
  * Spell a plan in source order, so the captures an entry's spelling emits
88
136
  * (named slots, then the children) keep their order and counter values.
89
137
  */
90
138
  export declare function spellComponentProps(segments: readonly ComponentPropSegment[], spelling: ComponentPropSpelling): SpelledComponentPropSegment[];
139
+ /**
140
+ * One key of the props hash, resolved at compile time: the latest of
141
+ * `presentParams` the caller passed, else `base`.
142
+ */
143
+ export interface ResolvedComponentProp {
144
+ key: string;
145
+ /** The last entry that sets the key unconditionally, or null when none does. */
146
+ base: ComponentPropEntry | null;
147
+ /** The `{...props}` params that override `base` when passed, earliest first. */
148
+ presentParams: string[];
149
+ }
150
+ /**
151
+ * A plan resolved one key at a time, in the order the keys are first set,
152
+ * for an adapter that builds the child's input as a typed literal at
153
+ * compile time rather than merging hashes at render time. Null when the
154
+ * plan folds in a spread whose keys are unknown: only a render-time merge
155
+ * can resolve that.
156
+ */
157
+ export declare function resolveComponentPropKeys(segments: readonly ComponentPropSegment[]): ResolvedComponentProp[] | null;
91
158
  /** Whether a spelled plan passes no props at all. */
92
159
  export declare function isEmptyComponentProps(segments: readonly SpelledComponentPropSegment[]): boolean;
93
160
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/adapters/component-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAG7E,mCAAmC;AACnC,MAAM,MAAM,kBAAkB;AAC5B,gFAAgF;AAC9E;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE;AACnD,wFAAwF;GACtF;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE;AAC1D,8FAA8F;GAC5F;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACvC,yEAAyE;GACvE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACrC,gGAAgG;GAC9F;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAE5C,sEAAsE;AACtE,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EA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2BAA2B,EAAE,CAW/B;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,gFAAgF;IAChF,IAAI,EAAE,kBAAkB,GAAG,IAAI,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"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * A component- or module-scope `const` computed from props, signals or other
3
+ * consts (`const cls = 'btn ' + variant`, `const twice = props.n * 2`) has no
4
+ * binding in a template: the backend receives the props, not the
5
+ * component's locals. Every template adapter read such a const as a template
6
+ * variable nothing defines, so it rendered empty, a prop of the same name, or
7
+ * failed the render (#3494).
8
+ *
9
+ * `inlineComputedConsts` substitutes each such read with the const's
10
+ * initializer tree, exactly as if the source had written the expression in
11
+ * place; the adapter then lowers it like any other expression, refusing what
12
+ * it cannot lower (`Object.keys(labels)` has no template form, BF101) instead
13
+ * of reading an unbound name. The substitution is structural
14
+ * (`inlineBinding`), so precedence, string literals and callback params that
15
+ * shadow the name are respected.
16
+ */
17
+ import { type ParsedExpr } from '../expression-parser.ts';
18
+ import type { ExpressionAttr, IRMetadata } from '../types.ts';
19
+ export interface ComputedConstContext {
20
+ constants: IRMetadata['localConstants'] | undefined;
21
+ /** Signal getters and memo names: the zero-arg calls a template reads as values. */
22
+ getters: ReadonlySet<string>;
23
+ /** Context consumers (`const theme = useContext(ThemeContext)`), which the adapter seeds itself. */
24
+ contextConsumers: ReadonlySet<string>;
25
+ /** Consts a props destructure binds, which the adapter binds as props params. */
26
+ propsBindings: ReadonlySet<string>;
27
+ /** Whether a loop row or callback binds `name` where the expression is read. */
28
+ isShadowed(name: string): boolean;
29
+ /** Whether the adapter binds the const `name` itself, so a read of it stays as written. */
30
+ isAdapterBound(name: string): boolean;
31
+ /**
32
+ * Whether `name` read where the expression is read is a JavaScript global:
33
+ * bound by neither the component nor its module (`componentBindings`), nor
34
+ * the rest props, nor an enclosing loop or callback.
35
+ */
36
+ isGlobal(name: string): boolean;
37
+ }
38
+ /** The {@link ComputedConstContext} fields that come from the component's metadata. */
39
+ export declare function computedConstContext(metadata: IRMetadata, isShadowed: (name: string) => boolean, isAdapterBound?: (name: string) => boolean): ComputedConstContext;
40
+ /**
41
+ * `expr` with each read of a computed const replaced by its initializer,
42
+ * repeated so a const read inside an initializer is replaced too.
43
+ */
44
+ export declare function inlineComputedConsts(expr: ParsedExpr, ctx: ComputedConstContext | null): ParsedExpr;
45
+ /**
46
+ * An `{expr}` attribute value read through {@link inlineComputedConsts}, so
47
+ * the attribute's own plan (a nullable prop read drops the attribute) sees
48
+ * the const's initializer, not its name: `title={label}` with
49
+ * `const label = props.label ?? 'Default'` is not a bare read of `label`.
50
+ */
51
+ export declare function inlineComputedConstAttr(value: ExpressionAttr, ctx: ComputedConstContext | null): ExpressionAttr;
52
+ //# sourceMappingURL=computed-const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computed-const.d.ts","sourceRoot":"","sources":["../../src/adapters/computed-const.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAwE,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC/H,OAAO,KAAK,EAAgB,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAG3E,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,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,KAAK,OAAO,EACrC,cAAc,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAqB,GACtD,oBAAoB,CAWtB;AA8BD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,oBAAoB,GAAG,IAAI,GAAG,UAAU,CASnG;AAcD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,oBAAoB,GAAG,IAAI,GAAG,cAAc,CAQ/G"}
@@ -102,4 +102,14 @@ export declare function dangerousInnerHtmlMetacharViolation(html: string, adapte
102
102
  * reaches here — it is lowered through the adapter's raw-output sink (#2319).
103
103
  */
104
104
  export declare function dangerousInnerHtmlDiagnostic(expr: string, loc: SourceLocation, reason?: string): CompilerError;
105
+ /**
106
+ * The children `element`'s `dangerouslySetInnerHTML` renders in place of
107
+ * its own, or `null` when it has none. A refusal is pushed onto `errors`
108
+ * and renders as `''`. `rawSink` writes a dynamic value through the
109
+ * adapter's raw-output sink; the runtime evaluates the expression, so no
110
+ * template-metachar guard applies, and the element already carries its
111
+ * hydration slot marker (#2319). A static literal is spliced as trusted
112
+ * template text after the `adapterId` metachar guard.
113
+ */
114
+ export declare function renderDangerousInnerHtml(element: IRElement, errors: CompilerError[], adapterId: string, rawSink: (valueExpr: string, valueParsed: ParsedExpr, loc: SourceLocation) => string): string | null;
105
115
  //# sourceMappingURL=dangerous-inner-html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dangerous-inner-html.d.ts","sourceRoot":"","sources":["../../src/adapters/dangerous-inner-html.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACxF,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAI/F,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAEnE;AAED,MAAM,MAAM,4BAA4B,GAIpC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAahC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,cAAc,CAAA;CAAE,GAKpF;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,cAAc,CAAA;CAAE,CAAA;AAE9D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,SAAS,GAAG,4BAA4B,GAAG,IAAI,CAyBjG;AAyED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOlG;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ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AM,EAAE,aAAa,EAAE,EACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc,KAAK,MAAM,GACnF,MAAM,GAAG,IAAI,CAiBf"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * The `generate()` the eight DSL template adapters (Blade, ERB, Jinja,
3
+ * Mojolicious, Pebble, MiniJinja, Twig, Xslate) share (#3475), with the
4
+ * per-compile state it sets up. Each adapter renders the nodes in its own
5
+ * template language; how one compile begins and ends lives here once.
6
+ */
7
+ import { type LoweringMatcher } from '../lowering-registry.ts';
8
+ import { type NullishAttrContext } from '../nullable-signal-attr.ts';
9
+ import { BindingScope } from '../scope/binding-scope.ts';
10
+ import type { CompilerError, ComponentIR, IRIfStatement, IRMetadata } from '../types.ts';
11
+ import { type ComputedConstContext } from './computed-const.ts';
12
+ import { BaseAdapter, type AdapterGenerateOptions, type AdapterOutput } from './interface.ts';
13
+ /**
14
+ * How an adapter that renames reserved names spells a source identifier as
15
+ * a template variable, and the engine name its collision diagnostic uses.
16
+ */
17
+ export interface TemplateIdentifierSpelling {
18
+ /** The adapter's mangling (`jinjaIdent`, `twigIdent`, …). */
19
+ ident(name: string): string;
20
+ /** The engine name in the diagnostic ("Jinja", "MiniJinja", …). */
21
+ label: string;
22
+ }
23
+ export declare abstract class DslTemplateAdapter extends BaseAdapter {
24
+ protected componentName: string;
25
+ /** Diagnostics collected while rendering, merged into `ir.errors` at the end. */
26
+ protected errors: CompilerError[];
27
+ /**
28
+ * SolidJS-style props identifier (`function(props: P)`). The spread
29
+ * emission builds a props-object bag from it without re-walking the IR.
30
+ */
31
+ protected propsObjectName: string | null;
32
+ /**
33
+ * Name of the destructured `...rest` binding (`function X({ ...rest })`),
34
+ * if any. A closed-type rest-expanded attribute's expression is
35
+ * `${restPropsName}.${key}` (`expandSpreadAttribute`, #3057). Stripping
36
+ * this prefix the same way `propsObjectName.` is stripped lets the
37
+ * nullable-optional-props guard recognise it as a bare optional reference
38
+ * instead of falling through to unconditional emission.
39
+ */
40
+ protected restPropsName: string | null;
41
+ protected propsParams: {
42
+ name: string;
43
+ optional: boolean;
44
+ }[];
45
+ /** Props whose declared TS type is boolean (`collectBooleanTypedProps`). */
46
+ protected booleanTypedProps: Set<string>;
47
+ /** Names (signal getters + props) whose value is a string (`stringValueNamesFor`). */
48
+ protected stringValueNames: Set<string>;
49
+ /**
50
+ * Module-scope pure-string consts (`const x = 'literal'`), keyed by name →
51
+ * unescaped value. A className template literal that references such a
52
+ * const (`className={`${x} ${className}`}`) must inline the literal: the
53
+ * const is module-scope, so it never reaches the per-render context.
54
+ */
55
+ protected moduleStringConsts: Map<string, string>;
56
+ /**
57
+ * (#1922) Local binding names the request-scoped `searchParams()` env
58
+ * signal is imported under (handles `import { searchParams as sp }`). When
59
+ * non-empty the emitter lowers a `<binding>().get(k)` call to a real method
60
+ * call on the per-request `searchParams` reader instead of the generic
61
+ * deref. Read by the top-level ParsedExpr emitter.
62
+ */
63
+ protected _searchParamsLocals: Set<string>;
64
+ /**
65
+ * Call-lowering matchers active for this component (#2057), read by the
66
+ * top-level emitter. Covers both userland plugins and the compiler's
67
+ * built-in plugins (e.g. `queryHref`, #2042): one uniform path, no per-API
68
+ * branch.
69
+ */
70
+ protected _loweringMatchers: LoweringMatcher[];
71
+ /** The component's computed consts, inlined where a template reads them (#3494). */
72
+ protected computedConsts: ComputedConstContext | null;
73
+ /**
74
+ * Local + module constants from the IR, used by the conditional-spread and
75
+ * `Record<staticKeys, scalar>[propKey]` lowering paths (#textarea /
76
+ * #checkbox): the spread emission resolves a bare local const
77
+ * (`const sizeAttrs = size ? {…} : {}`) to its initializer text.
78
+ */
79
+ protected localConstants: IRMetadata['localConstants'];
80
+ /** Each prop's collision-free root alias (#3314), decided once per component. */
81
+ protected rootPropAliases: ReadonlyMap<string, string>;
82
+ /**
83
+ * The one canonical, position-accurate "names bound by an enclosing loop
84
+ * callback" service (#2482 Stage 2). Every shadow-guard site reads this
85
+ * one threaded, immutable scope: `renderLoop` enters the row with
86
+ * `enterLoopRow` around the loop's children and restores the outer scope
87
+ * by reference afterwards, mirroring `ctx.scope` in `jsx-to-ir.ts`.
88
+ * `IRLoop` structurally satisfies `LoopBindingSource`, so `renderLoop`
89
+ * passes the loop node straight to `enterLoopRow`.
90
+ */
91
+ protected scope: BindingScope;
92
+ /**
93
+ * Optional, no-default props that are absent when the caller omits them
94
+ * (`collectNullableOptionalProps`). A bare-reference attribute of one is
95
+ * guarded with the template's presence test, so the attribute drops rather
96
+ * than rendering `attr=""` (Hono-style nullish omission, e.g. textarea's
97
+ * `rows`).
98
+ */
99
+ protected nullableOptionalProps: Set<string>;
100
+ /** Getters of nullable signals (`collectNullableSignalGetters`, #3304). */
101
+ protected nullableSignalGetters: Set<string>;
102
+ /** Signals and memos `attrValueMayBeNullish` reads (#3322). */
103
+ protected nullishAttrCtx: NullishAttrContext;
104
+ /**
105
+ * Local alias -> declared/exported name for imported components (#2822,
106
+ * the SSR-side counterpart of #2777's client-JS registry-key fix). A child
107
+ * referenced under an import alias (`import { Foo as Bar }`, `<Bar/>`)
108
+ * must build its cross-template call against the child's own declared
109
+ * name (`Foo`, what `foo.tsx` registers its template as), never the
110
+ * caller-local binding. Read by `childTemplateName`.
111
+ */
112
+ protected importAliases: Map<string, string>;
113
+ /** Numbers the children captures of a child component that has no slot id. */
114
+ protected childrenCaptureCounter: number;
115
+ /** The adapter's name in the BF103 imported-loop-child diagnostic ("The Jinja adapter emits …"). */
116
+ protected abstract readonly loopChildDiagnosticName: string;
117
+ /**
118
+ * For an adapter that renames reserved names: two source names the
119
+ * renaming turns into one template variable would read the same value, so
120
+ * `generate()` refuses them (#3404). `null` when the adapter renames none.
121
+ */
122
+ protected readonly templateIdentifierSpelling: TemplateIdentifierSpelling | null;
123
+ /** The names whose value is a string, for `stringValueNames`. */
124
+ protected abstract stringValueNamesFor(ir: ComponentIR): Set<string>;
125
+ /**
126
+ * Sets the adapter's own per-compile state. Runs after the shared state
127
+ * above and before any diagnostic or rendering.
128
+ */
129
+ protected resetAdapterState(_ir: ComponentIR): void;
130
+ /** The root `if` statement of a component with conditional returns. */
131
+ protected abstract renderIfStatement(ifStmt: IRIfStatement): string;
132
+ /** The script registrations the template starts with. */
133
+ protected abstract generateScriptRegistrations(ir: ComponentIR, scriptBaseName?: string, scriptAssets?: string[], preloadAssets?: string[]): string;
134
+ /**
135
+ * SSR context consumers (`const x = useContext(Ctx)`): seeds each local
136
+ * from the active provider value, or the `createContext` default. The
137
+ * provider side pushes the value via `emitProvider` (#1297).
138
+ */
139
+ protected abstract contextConsumerSeed(ir: ComponentIR): string;
140
+ /**
141
+ * Prop/signal-derived memos with a `null` static SSR default (e.g.
142
+ * `createMemo(() => props.value * 10)`), computed in-template from the
143
+ * already-seeded prop/signal vars, mirroring Go's generated child
144
+ * constructor (#1297).
145
+ */
146
+ protected abstract derivedMemoSeed(ir: ComponentIR): string;
147
+ generate(ir: ComponentIR, options?: AdapterGenerateOptions): AdapterOutput;
148
+ private resetCompileState;
149
+ private collectCompileErrors;
150
+ }
151
+ //# sourceMappingURL=dsl-template-adapter.d.ts.map
@@ -0,0 +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,EAGL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExF,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAErF,OAAO,EAAE,WAAW,EAAE,KAAK,sBAAsB,EAAE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,EAAE,EAAE,WAAW,GAAG,MAAM,CAAA;IAE3D,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,aAAa,CA4BzE;IAED,OAAO,CAAC,iBAAiB;IA6BzB,OAAO,CAAC,oBAAoB;CAgB7B"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The HTML element every template adapter writes the same way (#3475): its
3
+ * attributes, its hydration markers, its children, and the void-element
4
+ * form. The adapter supplies how each value is spelled in its template
5
+ * language; the order and the conditions live here once.
6
+ */
7
+ import type { IRElement, IRFragment, IRNode } from '../types.ts';
8
+ import { type AttrValueEmitter } from './attr-value-emitter.ts';
9
+ /**
10
+ * The element's own attributes, each lowered through `emitter`, as a
11
+ * leading-space list (`''` when none renders).
12
+ */
13
+ export declare function renderElementAttributes(element: IRElement, emitter: AttrValueEmitter): string;
14
+ /** How one adapter spells the parts of an element {@link renderElementShell} writes. */
15
+ export interface ElementShellSpelling {
16
+ /** Lowers each attribute value, the row key included. */
17
+ attrEmitter: AttrValueEmitter;
18
+ /** The element's `dangerouslySetInnerHTML` content, or `null` when it has none. */
19
+ renderDangerousInnerHtml(element: IRElement): string | null;
20
+ renderChildren(children: IRNode[]): string;
21
+ renderScopeMarker(instanceIdExpr: string): string;
22
+ renderSlotMarker(slotId: string): string;
23
+ /**
24
+ * The raw print of the runtime's `data-key` attribute, for a render root
25
+ * that carries whatever key its own caller supplies (the `bf` instance's
26
+ * `data_key` field).
27
+ */
28
+ dataKeyRelay: string;
29
+ /** The escaped print of this instance's scope id, the `bf-po` value. */
30
+ scopeIdValue: string;
31
+ /** Sends an SSR-portal element to the `bf.portals()` outlet instead of placing it inline. */
32
+ wrapSsrPortalElement(rendered: string): string;
33
+ }
34
+ /** The element, from its open tag to its close tag. */
35
+ export declare function renderElementShell(element: IRElement, spelling: ElementShellSpelling): string;
36
+ /**
37
+ * A fragment's children. A component-root fragment has no element of its
38
+ * own to carry the scope, so `wrapScopeComment` brackets the children with
39
+ * the comment-based scope marker pair; its end marker bounds the scope's
40
+ * sibling range, or queries from the fragment scope leak onto later
41
+ * siblings owned by the parent (#2289).
42
+ */
43
+ export declare function renderFragmentScope(fragment: IRFragment, renderChildren: (children: IRNode[]) => string, wrapScopeComment: (rendered: string) => string): string;
44
+ //# sourceMappingURL=element-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-shell.d.ts","sourceRoot":"","sources":["../../src/adapters/element-shell.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAQ9E;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,MAAM,CA+B7F;AAED,wFAAwF;AACxF,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,WAAW,EAAE,gBAAgB,CAAA;IAC7B,mFAAmF;IACnF,wBAAwB,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3D,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;IAC1C,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAAA;IACjD,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACxC;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAA;IACpB,6FAA6F;IAC7F,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAC/C;AAED,uDAAuD;AACvD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,GAAG,MAAM,CAmE7F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,UAAU,EACpB,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,MAAM,EAC9C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAC7C,MAAM,CAGR"}
@@ -341,6 +341,8 @@ export declare abstract class BaseAdapter implements TemplateAdapter {
341
341
  abstract renderSlotMarker(slotId: string): string;
342
342
  abstract renderCondMarker(condId: string): string;
343
343
  renderChildren(children: IRNode[]): string;
344
+ /** `null` for a `null` / `undefined` expression, which renders nothing; otherwise the node. */
345
+ protected renderNodeOrNull(node: IRNode): string | null;
344
346
  /** Default: render fallback + children inline (no streaming). Override for streaming support. */
345
347
  renderAsync(node: IRAsync): string;
346
348
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/adapters/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,MAAM,EACN,SAAS,EACT,YAAY,EACZ,aAAa,EACb,MAAM,EACN,WAAW,EACX,OAAO,EACR,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;;;;;;OASG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAA;CACxC;AAED,MAAM,WAAW,aAAa;IAC5B,sFAAsF;IACtF,QAAQ,EAAE,MAAM,CAAA;IAChB;0EACsE;IACtE,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,qFAAqF;IACrF,sBAAsB,CAAC,EAAE,OAAO,CAAA;I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M,GAAG,IAAI,CAKtD;IAED,iGAAiG;IACjG,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAEjC;CACF"}
@@ -124,6 +124,10 @@ export declare abstract class JsxAdapter extends BaseAdapter {
124
124
  * `expr` (a presence peel, a prop-ref rewrite) fails the identity check
125
125
  * and wins, so this can only ever add the annotation, never undo a
126
126
  * downstream edit.
127
+ *
128
+ * The same identity rule brings back the author's own type syntax
129
+ * (`value={store as never}`, #2573): `typed.tsx` is written only while
130
+ * `expr` is still the text it was captured beside.
127
131
  */
128
132
  protected expressionValueToJs(value: Extract<AttrValue, {
129
133
  kind: 'expression';
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/jsx-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,MAAM,EACN,cAAc,EACd,eAAe,EAChB,MAAM,aAAa,CAAA;AAIpB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAM1D,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,8BAAsB,UAAW,SAAQ,WAAW;IAClD,SAAS,CAAC,aAAa,EAAE,MAAM,CAAK;IAEpC,yEAAyE;IACzE,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAA;IAE9C;;;;;;OAMG;IACH,mBAAmB,EAAE,oBAAoB,CAAa;IAMtD,SAAS,CAAC,sBAAsB,CAC9B,UAAU,EAAE,eAAe,EAAE,GAC5B,MAAM,CAuBR;IAMD;;;;;;;;;;OAUG;IACH,0BAA0B,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CA2NnE;IAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;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yE;IACzE,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAA;IAE9C;;;;;;OAMG;IACH,mBAAmB,EAAE,oBAAoB,CAAa;IAMtD,SAAS,CAAC,sBAAsB,CAC9B,UAAU,EAAE,eAAe,EAAE,GAC5B,MAAM,CAuBR;IAMD;;;;;;;;;;OAUG;IACH,0BAA0B,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CA2NnE;IAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAA0C;IAEhF,SAAS,CAAC,2BAA2B,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAmFlE;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,SAAS,CAAC,+BAA+B,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAyDjE;IAMD,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ5C;IAMD;;;;;OAKG;IACH,SAAS,CAAC,uBAAuB,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,CAE1E;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE;QAAE,IAAI,EAAE,YAAY,CAAA;KAAE,CAAC,GAAG,MAAM,CAYvF;IAMD,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAEhD;IAED,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvC;IAED,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvC;CACF"}
@@ -7,11 +7,11 @@
7
7
  * literal index from a variable one with {@link isLiteralIndex}.
8
8
  */
9
9
  import type { ParsedExpr } from '../expression-parser.ts';
10
- import type { TypeInfo } from '../types.ts';
10
+ import type { TypeInfo, JsSourceText } from '../types.ts';
11
11
  /** True when `type` is the `string` primitive. */
12
12
  export declare function isStringTypeInfo(type: TypeInfo | undefined): boolean;
13
13
  /** True when `initialValue` is a bare string-literal expression. */
14
- export declare function isBareStringLiteral(initialValue: string | undefined): boolean;
14
+ export declare function isBareStringLiteral(initialValue: JsSourceText | undefined): boolean;
15
15
  /**
16
16
  * True when a parsed index is a numeric or string literal (`arr[0]`,
17
17
  * `m['k']`). The spread lowerings refuse (BF101) an indexed spread value
@@ -1 +1 @@
1
- {"version":3,"file":"literal-value.d.ts","sourceRoot":"","sources":["../../src/adapters/literal-value.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,kDAAkD;AAClD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAEpE;AAED,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAI7E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAKzD"}
1
+ {"version":3,"file":"literal-value.d.ts","sourceRoot":"","sources":["../../src/adapters/literal-value.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEzD,kDAAkD;AAClD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAEpE;AAED,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS,GAAG,OAAO,CAInF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAKzD"}