@barefootjs/jsx 0.33.1 → 0.33.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.
- package/dist/analyzer.d.ts +17 -0
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/compiler.d.ts +21 -5
- package/dist/compiler.d.ts.map +1 -1
- package/dist/expression-parser.d.ts +14 -0
- package/dist/expression-parser.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +817 -457
- package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/loop-child-arm.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-registration.d.ts.map +1 -1
- package/dist/ir-to-client-js/html-template.d.ts +7 -7
- package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
- package/dist/ir-to-client-js/imports.d.ts +60 -2
- package/dist/ir-to-client-js/imports.d.ts.map +1 -1
- package/dist/ir-to-client-js/index.d.ts.map +1 -1
- package/dist/ir-to-client-js/prop-handling.d.ts +30 -0
- package/dist/ir-to-client-js/prop-handling.d.ts.map +1 -1
- package/dist/ir-to-client-js/reactivity.d.ts +5 -0
- package/dist/ir-to-client-js/reactivity.d.ts.map +1 -1
- package/dist/ir-to-client-js/rewrite-props-object.d.ts +36 -8
- package/dist/ir-to-client-js/rewrite-props-object.d.ts.map +1 -1
- package/dist/ir-to-client-js/utils.d.ts +26 -2
- package/dist/ir-to-client-js/utils.d.ts.map +1 -1
- package/dist/jsx-to-ir.d.ts.map +1 -1
- package/dist/props-binding.d.ts +35 -0
- package/dist/props-binding.d.ts.map +1 -1
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +165 -98
- package/src/__tests__/binding-scope-ratchet.test.ts +5 -1
- package/src/__tests__/child-component-ref-not-mirrored.test.ts +90 -0
- package/src/__tests__/client-js-generation.test.ts +11 -0
- package/src/__tests__/ir-to-client-js/imports.test.ts +107 -0
- package/src/__tests__/ir-to-client-js/merge-compiled-client-js-imports.test.ts +138 -0
- package/src/__tests__/issue-2723-prop-alias-reactivity.test.ts +124 -0
- package/src/__tests__/issue-2754-rest-spread-needs-slot.test.ts +85 -0
- package/src/__tests__/issue-2756-loop-row-honors-client-only.test.ts +173 -0
- package/src/__tests__/merge-template-imports.test.ts +41 -1
- package/src/__tests__/multi-component-shared-default-import.test.ts +55 -0
- package/src/__tests__/rewrite-props-object.test.ts +41 -4
- package/src/__tests__/root-key-relay.test.ts +170 -0
- package/src/__tests__/signal-getter-not-called.test.ts +149 -0
- package/src/__tests__/state-only-file-default-import.test.ts +47 -0
- package/src/analyzer.ts +36 -0
- package/src/compiler.ts +94 -104
- package/src/expression-parser.ts +26 -0
- package/src/index.ts +2 -2
- package/src/ir-to-client-js/collect-elements.ts +45 -30
- package/src/ir-to-client-js/control-flow/stringify/inner-loop.ts +6 -2
- package/src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts +5 -2
- package/src/ir-to-client-js/emit-registration.ts +26 -7
- package/src/ir-to-client-js/generate-init.ts +1 -1
- package/src/ir-to-client-js/html-template.ts +130 -20
- package/src/ir-to-client-js/imports.ts +178 -5
- package/src/ir-to-client-js/index.ts +11 -4
- package/src/ir-to-client-js/prop-handling.ts +83 -0
- package/src/ir-to-client-js/reactivity.ts +59 -0
- package/src/ir-to-client-js/rewrite-props-object.ts +50 -10
- package/src/ir-to-client-js/utils.ts +30 -2
- package/src/jsx-to-ir.ts +523 -49
- package/src/props-binding.ts +51 -0
- package/src/types.ts +48 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-elements.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/collect-elements.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAoC,KAAK,MAAM,EAAmC,MAAM,aAAa,CAAA;AACzH,OAAO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IAAI,CAsSN;AAqcD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,GAAG,EAAE,eAAe,EACpB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,SAAS,OAAO,aAAa,EAAE,gBAAgB,EAAE,GAAG,SAAS;AAChF;;;;GAIG;AACH,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;AACnC;;;;GAIG;AACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,iBAAiB,CAenB;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACrC,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,OAAO,aAAa,EAAE,gBAAgB,EAAE;AACrE;;;;;;;;GAQG;AACH,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;AACnC;;;GAGG;AACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,oBAAoB,EAAE,CA2ExB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop-child-arm.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAcN;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,uBAAuB,EAC7B,MAAM,EAAE,MAAM,GACb,IAAI,CAYN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,6BAA6B,EACnC,MAAM,EAAE,MAAM,GACb,IAAI,CAIN;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,oBAAoB,EAC1B,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,
|
|
1
|
+
{"version":3,"file":"loop-child-arm.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAcN;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,uBAAuB,EAC7B,MAAM,EAAE,MAAM,GACb,IAAI,CAYN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,6BAA6B,EACnC,MAAM,EAAE,MAAM,GACb,IAAI,CAIN;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,oBAAoB,EAC1B,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CA4DN;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,EAAE,EACf,YAAY,EAAE,SAAS,wBAAwB,EAAE,EACjD,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAIN;AA0BD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,GAAG,SAAS,GACrB,IAAI,CAiDN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-registration.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/emit-registration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,EAAE,eAAe,EAAc,MAAM,aAAa,CAAA;AAC/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"emit-registration.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/emit-registration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,EAAE,eAAe,EAAc,MAAM,aAAa,CAAA;AAC/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAOjD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAmD9G;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,MAAM,GACb;IACD,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC9B,CAGA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAMtF;AAkDD,4EAA4E;AAC5E;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,eAAe;AACtB;;;;;;GAMG;AACH,YAAY,CAAC,EAAE;IAAE,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,GACxF,MAAM,CA2GR"}
|
|
@@ -118,7 +118,7 @@ export declare function flatMapLeafKeyExpr(ir: IRNode): string | null;
|
|
|
118
118
|
* `setAttribute`, matching the SSR side (which never emits it for flatMap
|
|
119
119
|
* leaves).
|
|
120
120
|
*/
|
|
121
|
-
export declare function renderFlatMapClientBody(cb: Pick<FlatMapCallback, 'segments'>, restSpreadNames?:
|
|
121
|
+
export declare function renderFlatMapClientBody(cb: Pick<FlatMapCallback, 'segments'>, restSpreadNames?: ReadonlySet<string>): string;
|
|
122
122
|
/** True when any segment leaf declares a `key` — drives the mapArray keyFn. */
|
|
123
123
|
export declare function flatMapCallbackHasKeyedLeaf(cb: Pick<FlatMapCallback, 'segments'>): boolean;
|
|
124
124
|
/**
|
|
@@ -135,8 +135,8 @@ export declare function flatMapCallbackHasKeyedLeaf(cb: Pick<FlatMapCallback, 's
|
|
|
135
135
|
*/
|
|
136
136
|
export declare function renderFlatMapProjectionClientBody(inner: Extract<IRNode, {
|
|
137
137
|
type: 'loop';
|
|
138
|
-
}>, restSpreadNames?:
|
|
139
|
-
export declare function irToHtmlTemplate(node: IRNode, restSpreadNames?:
|
|
138
|
+
}>, restSpreadNames?: ReadonlySet<string>): string;
|
|
139
|
+
export declare function irToHtmlTemplate(node: IRNode, restSpreadNames?: ReadonlySet<string>, loopDepth?: number, loopParams?: ReadonlyArray<string | LoopParamSpec>, branchSlotsVar?: string, inHoistedChildren?: boolean): string;
|
|
140
140
|
/**
|
|
141
141
|
* Slots a top-level (`mapArray`-driven) loop body proves safe to hoist into a
|
|
142
142
|
* shared, once-per-loop template (perf: avoid per-row `document.createElement
|
|
@@ -235,7 +235,7 @@ export declare function flattenSkeletonChildren(children: readonly IRNode[]): IR
|
|
|
235
235
|
* elements (`<div data-bf-ph="sN"></div>`) instead of renderChild() calls.
|
|
236
236
|
* The placeholders are replaced with real createComponent() elements at runtime.
|
|
237
237
|
*/
|
|
238
|
-
export declare function irToPlaceholderTemplate(node: IRNode, restSpreadNames?:
|
|
238
|
+
export declare function irToPlaceholderTemplate(node: IRNode, restSpreadNames?: ReadonlySet<string>, loopDepth?: number, loopParams?: ReadonlyArray<string | LoopParamSpec>): string;
|
|
239
239
|
/**
|
|
240
240
|
* Convert IR children into a JavaScript expression string for createComponent.
|
|
241
241
|
* Produces expressions suitable for use in `get children() { return <expr> }`.
|
|
@@ -260,7 +260,7 @@ export declare function addCondAttrToTemplate(html: string, condId: string): str
|
|
|
260
260
|
*/
|
|
261
261
|
export interface TemplateOptions {
|
|
262
262
|
inlinableConstants?: Map<string, string>;
|
|
263
|
-
restSpreadNames?:
|
|
263
|
+
restSpreadNames?: ReadonlySet<string>;
|
|
264
264
|
propsObjectName?: string | null;
|
|
265
265
|
/**
|
|
266
266
|
* Names that exist only in the init-body scope (or were demoted to unsafe
|
|
@@ -347,7 +347,7 @@ export interface TemplateOptions {
|
|
|
347
347
|
* - Local constant references are inlined with their resolved values (#343)
|
|
348
348
|
* - bf markers ARE included so client code can find elements
|
|
349
349
|
*/
|
|
350
|
-
export declare function irToComponentTemplate(node: IRNode, inlinableConstants?: Map<string, string>, restSpreadNames?:
|
|
350
|
+
export declare function irToComponentTemplate(node: IRNode, inlinableConstants?: Map<string, string>, restSpreadNames?: ReadonlySet<string>, propsObjectName?: string | null, markupSlotIds?: ReadonlySet<string>): string;
|
|
351
351
|
/**
|
|
352
352
|
* Check if a component can have a simple static template generated.
|
|
353
353
|
* Returns false if the component has:
|
|
@@ -385,7 +385,7 @@ export declare function canGenerateStaticTemplate(node: IRNode, propNames: Set<s
|
|
|
385
385
|
* @param inlinableConstants - Map of constant names to their resolved CSR values
|
|
386
386
|
* @param ctx - ClientJsContext supplying signals/memos for `csrSubstitute`
|
|
387
387
|
*/
|
|
388
|
-
export declare function generateCsrTemplate(node: IRNode, inlinableConstants: Map<string, string> | undefined, ctx: ClientJsContext, restSpreadNames?:
|
|
388
|
+
export declare function generateCsrTemplate(node: IRNode, inlinableConstants: Map<string, string> | undefined, ctx: ClientJsContext, restSpreadNames?: ReadonlySet<string>, propsObjectName?: string | null, unsafeLocalNames?: Set<string>, deferredChildSlots?: ReadonlySet<string>): string;
|
|
389
389
|
/**
|
|
390
390
|
* Walk the component IR and collect the slot ids of DIRECT child
|
|
391
391
|
* components whose render must be deferred to init because at least one
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-template.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/html-template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"html-template.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/html-template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAA6B,MAAM,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C,EACtB,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAC7B,OAAO,CA8ET;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EACnD,GAAG,EAAE,eAAe,EACpB,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACrC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,EAC/B,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GACvC,MAAM,CAuBR;AAuHD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EACnD,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,EACjD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAC9B,GAAG,CAAC,MAAM,CAAC,CAoDb;AAsXD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAiBpF"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Import detection and DOM import management.
|
|
3
3
|
*/
|
|
4
4
|
import type { ComponentIR } from '../types.ts';
|
|
5
|
-
export declare const RUNTIME_IMPORT_CANDIDATES: readonly ['createSignal', 'createMemo', 'createEffect', 'onCleanup', 'onMount', 'hydrate', 'insert', 'getLoopChildren', 'getLoopNodes', 'mapArray', 'mapArrayAnchored', 'mapArrayLazy', 'patchLeaf', 'createDisposableEffect', 'findCondContainer', 'createComponent', 'renderChild', 'registerComponent', 'registerTemplate', 'initChild', 'upsertChild', 'mountRowRoot', 'createPortal', 'provideContext', 'createContext', 'useContext', 'forwardProps', 'applyRestAttrs', 'splitProps', 'spreadAttrs', 'styleToCss', 'escapeAttr', 'escapeText', 'escapeTextOrNode', 'bfMarkup', 'escapeTextOrMarkup', 'qsa', 'qsaItem', 'qsaChildScope', 'qsaChildScopes', 'upsertChildItem', '__slot', '__bfSlot', '__bfText', 'claimSlots', 'lazySlots', 'lazyClaimSlots', 'textOrNode', 'beginTurn', 'endTurn', 'date', 'formatDate'];
|
|
5
|
+
export declare const RUNTIME_IMPORT_CANDIDATES: readonly ['createSignal', 'createMemo', 'createEffect', 'onCleanup', 'onMount', 'hydrate', 'insert', 'getLoopChildren', 'getLoopNodes', 'mapArray', 'mapArrayAnchored', 'mapArrayLazy', 'patchLeaf', 'createDisposableEffect', 'findCondContainer', 'createComponent', 'renderChild', 'registerComponent', 'registerTemplate', 'initChild', 'upsertChild', 'mountRowRoot', 'createPortal', 'provideContext', 'createContext', 'useContext', 'forwardProps', 'applyRestAttrs', 'splitProps', 'spreadAttrs', 'styleToCss', 'escapeAttr', 'escapeText', 'escapeTextOrNode', 'bfMarkup', 'escapeTextOrMarkup', 'markupOrEmpty', 'qsa', 'qsaItem', 'qsaChildScope', 'qsaChildScopes', 'upsertChildItem', '__slot', '__bfSlot', '__bfText', 'claimSlots', 'lazySlots', 'lazyClaimSlots', 'textOrNode', 'beginTurn', 'endTurn', 'date', 'formatDate'];
|
|
6
6
|
/** @deprecated Use RUNTIME_IMPORT_CANDIDATES */
|
|
7
|
-
export declare const DOM_IMPORT_CANDIDATES: readonly ["createSignal", "createMemo", "createEffect", "onCleanup", "onMount", "hydrate", "insert", "getLoopChildren", "getLoopNodes", "mapArray", "mapArrayAnchored", "mapArrayLazy", "patchLeaf", "createDisposableEffect", "findCondContainer", "createComponent", "renderChild", "registerComponent", "registerTemplate", "initChild", "upsertChild", "mountRowRoot", "createPortal", "provideContext", "createContext", "useContext", "forwardProps", "applyRestAttrs", "splitProps", "spreadAttrs", "styleToCss", "escapeAttr", "escapeText", "escapeTextOrNode", "bfMarkup", "escapeTextOrMarkup", "qsa", "qsaItem", "qsaChildScope", "qsaChildScopes", "upsertChildItem", "__slot", "__bfSlot", "__bfText", "claimSlots", "lazySlots", "lazyClaimSlots", "textOrNode", "beginTurn", "endTurn", "date", "formatDate"];
|
|
7
|
+
export declare const DOM_IMPORT_CANDIDATES: readonly ["createSignal", "createMemo", "createEffect", "onCleanup", "onMount", "hydrate", "insert", "getLoopChildren", "getLoopNodes", "mapArray", "mapArrayAnchored", "mapArrayLazy", "patchLeaf", "createDisposableEffect", "findCondContainer", "createComponent", "renderChild", "registerComponent", "registerTemplate", "initChild", "upsertChild", "mountRowRoot", "createPortal", "provideContext", "createContext", "useContext", "forwardProps", "applyRestAttrs", "splitProps", "spreadAttrs", "styleToCss", "escapeAttr", "escapeText", "escapeTextOrNode", "bfMarkup", "escapeTextOrMarkup", "markupOrEmpty", "qsa", "qsaItem", "qsaChildScope", "qsaChildScopes", "upsertChildItem", "__slot", "__bfSlot", "__bfText", "claimSlots", "lazySlots", "lazyClaimSlots", "textOrNode", "beginTurn", "endTurn", "date", "formatDate"];
|
|
8
8
|
export declare const RUNTIME_MODULE = "@barefootjs/client/runtime";
|
|
9
9
|
export declare const IMPORT_PLACEHOLDER = "/* __BAREFOOTJS_DOM_IMPORTS__ */";
|
|
10
10
|
export declare const MODULE_CONSTANTS_PLACEHOLDER = "/* __MODULE_LEVEL_CONSTANTS__ */";
|
|
@@ -41,6 +41,64 @@ export declare function collectUserDomImports(ir: ComponentIR): string[];
|
|
|
41
41
|
* fatal.
|
|
42
42
|
*/
|
|
43
43
|
export declare function makeValueUsageTest(generatedCode: string): (localName: string) => boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Render already-filtered-to-used specifier fragments for one import source
|
|
46
|
+
* into one or two legal import declaration lines. Shared by every call site
|
|
47
|
+
* that re-serializes an `ImportInfo`'s specifiers into client-JS import
|
|
48
|
+
* text — `collectExternalImports` below and the state-only-file client-JS
|
|
49
|
+
* path (`compiler.ts`'s single-component early return for a `.tsx` with no
|
|
50
|
+
* JSX return but exported `@client` module signals) — so the
|
|
51
|
+
* default/namespace handling lives in exactly one place.
|
|
52
|
+
*
|
|
53
|
+
* A default or namespace specifier needs its own import syntax
|
|
54
|
+
* (`import X from '...'` / `import * as X from '...'`), never the
|
|
55
|
+
* named-import braces a plain specifier gets — a plain `import { lock }
|
|
56
|
+
* from '...'` for a DEFAULT-imported `lock` compiles to a real, silently-
|
|
57
|
+
* wrong ESM import (no such named export) that only surfaces once a
|
|
58
|
+
* bundler actually resolves it (#2767 follow-up: a server component's own
|
|
59
|
+
* compiled init previously never reached a real Rollup graph, so this was
|
|
60
|
+
* unreachable until that gap closed).
|
|
61
|
+
*
|
|
62
|
+
* `import Default, { a, b } from '...'` is the only legal single-line
|
|
63
|
+
* pairing — a namespace specifier can't combine with named ones, but
|
|
64
|
+
* multiple import declarations for the same source are legal ESM, so a
|
|
65
|
+
* used namespace specifier always gets its own line.
|
|
66
|
+
*/
|
|
67
|
+
export declare function renderUsedImportLines(source: string, usedDefault: string | null, usedNamespace: string | null, usedNamed: string[]): string[];
|
|
68
|
+
/**
|
|
69
|
+
* Merge multiple sibling components' compiled client-JS blobs (one file
|
|
70
|
+
* with several `export function`s, e.g. `compileMultipleComponents`'s two
|
|
71
|
+
* `.client.js` outputs) into one conflict-free block.
|
|
72
|
+
*
|
|
73
|
+
* Real top-level `ImportDeclaration` statements are found via a
|
|
74
|
+
* `ts.createSourceFile` AST walk — never a text/regex line scan — so a
|
|
75
|
+
* string or template-literal VALUE that merely contains a line starting
|
|
76
|
+
* with `import ` (a docs component embedding a code sample, say) can never
|
|
77
|
+
* be torn out of its literal and hoisted into the imports block. This
|
|
78
|
+
* mirrors `combine-client-js.ts`'s `parseAndMerge`, the established
|
|
79
|
+
* precedent for exactly this shape of parse (see that file's docstring
|
|
80
|
+
* and issue #1702, the regression it exists to prevent) — CLAUDE.md
|
|
81
|
+
* requires it for "compiled client JS" specifically. Reaching a bundler
|
|
82
|
+
* for the FIRST time is precisely what a plain server component newly
|
|
83
|
+
* promoted to a Rollup entry by `needsClientEntry` (#2767) now does, so a
|
|
84
|
+
* line-based scan here carries real risk, not just a style violation.
|
|
85
|
+
*
|
|
86
|
+
* Differs from `parseAndMerge` in two ways required by this call site:
|
|
87
|
+
* (1) default and named specifiers from the same source fold into ONE
|
|
88
|
+
* declaration via `renderUsedImportLines`'s rule, rather than surviving
|
|
89
|
+
* as separate verbatim, exact-string-deduped lines — the fold is what
|
|
90
|
+
* prevents the duplicate-binding `SyntaxError` two sibling components can
|
|
91
|
+
* otherwise produce for a shared default import (#2767 follow-up); (2) an
|
|
92
|
+
* unresolved `@bf-child:` placeholder import is KEPT (deduped by exact
|
|
93
|
+
* text, same as any other side-effect import), never dropped — unlike
|
|
94
|
+
* `parseAndMerge`'s parent-child inlining case, this merge runs inside
|
|
95
|
+
* `compileMultipleComponents`, BEFORE `@barefootjs/vite`'s `resolveId`
|
|
96
|
+
* gets a chance to rewrite the placeholder into a real module reference.
|
|
97
|
+
*
|
|
98
|
+
* Returns the fully assembled `<imports>\n\n<code…>` block ready to use
|
|
99
|
+
* as a `.client.js` file's content.
|
|
100
|
+
*/
|
|
101
|
+
export declare function mergeCompiledClientJsImports(codeBlobs: string[]): string;
|
|
44
102
|
/**
|
|
45
103
|
* Collect external (non-DOM, non-component) imports that are used in generated code.
|
|
46
104
|
* These are third-party libraries like @barefootjs/form, zod, etc. that need to be
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/imports.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/imports.ts"],"names":[],"mappings":"AAAA;;GAEG;A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AS,EAAE,MAAM,KAAK,OAAO,CAWxF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,SAAS,EAAE,MAAM,EAAE,GAClB,MAAM,EAAE,CASV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAwFxE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA6CvH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AAajC,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAExE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,WAAW,CAAA;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,EAAE,yBAAyB,CAAA;IAC9C,mBAAmB,CAAC,EAAE,oBAAoB,CAAA;CAC3C;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACjC;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,WAAW,EACf,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAC5B,mBAAmB,CAAC,EAAE,MAAM,EAAE,EAC9B,KAAK,CAAC,EAAE,SAAS,EACjB,mBAAmB,CAAC,EAAE,mBAAmB,EACzC,OAAO,CAAC,EAAE,OAAO,GAChB,MAAM,CAUR;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,EAAE,EAAE,WAAW,EACf,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAC5B,mBAAmB,CAAC,EAAE,MAAM,EAAE,EAC9B,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9D,KAAK,CAAC,EAAE,SAAS,EACjB,mBAAmB,CAAC,EAAE,mBAAmB,EACzC,OAAO,CAAC,EAAE,OAAO,GAChB,cAAc,CA2BhB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,WAAW,GAAG;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAiC/F"}
|
|
@@ -4,6 +4,36 @@
|
|
|
4
4
|
import type { ParamInfo, SignalInfo } from '../types.ts';
|
|
5
5
|
import type { ClientJsContext } from './types.ts';
|
|
6
6
|
import type { BindingScope } from '../scope/binding-scope.ts';
|
|
7
|
+
/**
|
|
8
|
+
* Which of the component's two "forwards the caller's leftover props"
|
|
9
|
+
* bindings `name` ultimately names — `'rest'` for `ctx.restPropsName`
|
|
10
|
+
* (the destructured `...rest` binding), `'props'` for `ctx.propsObjectName`
|
|
11
|
+
* (a whole undestructured `(props)` parameter spread whole), or `null` when
|
|
12
|
+
* `name` is neither, walking through any bare `const x__alias = <name>`
|
|
13
|
+
* alias chain to get there (#2723's `alias-props` mutation aliases every
|
|
14
|
+
* destructured binding, the rest parameter included, e.g.
|
|
15
|
+
* `const props__alias = props`).
|
|
16
|
+
*
|
|
17
|
+
* A `{...spread}` attribute is recognised as "forwards the caller's
|
|
18
|
+
* leftover props" (routed to the `applyRestAttrs` runtime helper /
|
|
19
|
+
* excluded from the SSR template's `spreadAttrs({...})` merge, and — only
|
|
20
|
+
* for the `'rest'` case — given the destructured prop names to exclude
|
|
21
|
+
* from what it forwards) by comparing its source expression against
|
|
22
|
+
* exactly `ctx.restPropsName` / `ctx.propsObjectName`. Without this
|
|
23
|
+
* resolver an alias hop makes that comparison fail even though the spread
|
|
24
|
+
* still forwards the SAME object — `collect-elements.ts` then never
|
|
25
|
+
* registers the rest-attrs application at all, and `html-template.ts`'s
|
|
26
|
+
* merge path stops filtering the spread out, folding it into a
|
|
27
|
+
* `spreadAttrs({...})` call keyed by the alias name instead of the
|
|
28
|
+
* runtime-visible one.
|
|
29
|
+
*
|
|
30
|
+
* The walk itself lives in `props-binding.ts`'s `resolveRestSpreadOriginCore`,
|
|
31
|
+
* shared with Phase 1's slot-id decision so both phases agree on which
|
|
32
|
+
* spreads forward the caller's leftover props (#2754). This wrapper only
|
|
33
|
+
* supplies the `ClientJsContext`-shaped inputs.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveRestSpreadOrigin(ctx: ClientJsContext, name: string): 'rest' | 'props' | null;
|
|
36
|
+
export declare function resolveRestSpreadNames(ctx: ClientJsContext): ReadonlySet<string>;
|
|
7
37
|
/**
|
|
8
38
|
* Expand dynamic prop value by resolving local constants.
|
|
9
39
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-handling.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/prop-handling.ts"],"names":[],"mapp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UAAU,EAClB,WAAW,EAAE,SAAS,EAAE,EACxB,eAAe,GAAE,MAAM,GAAG,IAAW,GACpC,MAAM,GAAG,IAAI,CAoCf"}
|
|
@@ -123,6 +123,11 @@ export declare function decideWrapForChildProp(expandedValue: string, ctx: Clien
|
|
|
123
123
|
* The signal-getter and memo regexes (`\b<name>\s*\(`) still run against
|
|
124
124
|
* the raw string — those are call-shape patterns, not bare-identifier
|
|
125
125
|
* checks, and are outside the scope of #1267.
|
|
126
|
+
*
|
|
127
|
+
* A reference that only reaches a signal/memo/prop through an intervening
|
|
128
|
+
* `const x__alias = x` hop is walked via `ctx.localConstants` below (#2723)
|
|
129
|
+
* — see that block's own comment for why this lives here rather than on
|
|
130
|
+
* `BindingScope` or a new tracking structure.
|
|
126
131
|
*/
|
|
127
132
|
export declare function needsEffectWrapper(expr: string, ctx: ClientJsContext, freeIdentifiers?: ReadonlySet<string>): boolean;
|
|
128
133
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactivity.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/reactivity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAkB,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAwC,MAAM,aAAa,CAAA;AACpJ,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,UAAU,EACX,MAAM,YAAY,CAAA;AAKnB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGxD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,EAC/C,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,SAAS,CAAC,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,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,EAC/C,0BAA0B,UAAQ,EAClC,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,qBAAqB,EAAE,CAsEzB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* AST-based rename of the source-level props object name (e.g. `props
|
|
3
|
-
*
|
|
4
|
-
* `_p` across the joined
|
|
2
|
+
* AST-based rename of the source-level props object name(s) (e.g. `props`,
|
|
3
|
+
* a user-supplied destructure name, or a destructured rest binding like
|
|
4
|
+
* `...rest`) → the generated parameter name `_p` across the joined
|
|
5
|
+
* init-body string.
|
|
5
6
|
*
|
|
6
7
|
* Replaces the pre-C2 regex hack `\\b<propsObjectName>\\b` which silently
|
|
7
8
|
* matched contexts that should NOT have been rewritten:
|
|
@@ -22,10 +23,37 @@
|
|
|
22
23
|
* rewrite becomes a compile-time error.
|
|
23
24
|
*/
|
|
24
25
|
/**
|
|
25
|
-
* Rename every value-position reference to `propsObjectName`
|
|
26
|
-
* to `
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* Rename every value-position reference to `propsObjectName` — and,
|
|
27
|
+
* independently, to `restPropsName` (#2723) — in `code` to `_p`.
|
|
28
|
+
*
|
|
29
|
+
* `restPropsName` matters even in destructured-prop mode (where
|
|
30
|
+
* `propsObjectName` is null and the analyzer already pre-rewrites bare
|
|
31
|
+
* NAMED-prop refs into `templateXxx` fields, per the historical
|
|
32
|
+
* `propsObjectName ?? 'props'` fallback this replaces): a destructured
|
|
33
|
+
* rest binding (`const { className, ...rest } = props` /
|
|
34
|
+
* `function F({ className, ...rest })`) is not itself a "named prop," so
|
|
35
|
+
* nothing pre-rewrites a bare reference to it. Such a reference reaches
|
|
36
|
+
* this pass whenever the init body needs `rest`'s OWN VALUE rather than
|
|
37
|
+
* just recognising a `{...rest}` spread by name — e.g. a `const
|
|
38
|
+
* rest__alias = rest` hop (#2723's `alias-props` mutation aliases the
|
|
39
|
+
* rest parameter along with every named one). A rest binding named
|
|
40
|
+
* anything but "props" (`...rest`, `...leftover`) left such a reference
|
|
41
|
+
* dangling as a `ReferenceError`, so the analyzer's actual
|
|
42
|
+
* `restPropsName` is passed in to remove that guesswork.
|
|
43
|
+
*
|
|
44
|
+
* The `propsObjectName ?? 'props'` fallback is KEPT alongside it, not
|
|
45
|
+
* replaced by it. The two do different jobs, and reading the fallback as
|
|
46
|
+
* merely a lucky guess at the rest binding's name regressed the
|
|
47
|
+
* doc-example `StatementExample`: a component that destructures its
|
|
48
|
+
* parameters can still write `props.itemId` inside a handler body, and
|
|
49
|
+
* `propsObjectName` is null for exactly that shape — so dropping the
|
|
50
|
+
* fallback left `props.itemId` in the emitted init, where no `props`
|
|
51
|
+
* binding exists to satisfy it.
|
|
52
|
+
*
|
|
53
|
+
* Each candidate name is rewritten independently and skipped when null,
|
|
54
|
+
* already `_p`, or a duplicate of one already processed (a component
|
|
55
|
+
* whose props param IS its own rest destructure target, if that shape
|
|
56
|
+
* ever arises, would otherwise walk the AST twice for the same name).
|
|
29
57
|
*/
|
|
30
|
-
export declare function rewritePropsObjectRef(code: string, propsObjectName: string | null): string;
|
|
58
|
+
export declare function rewritePropsObjectRef(code: string, propsObjectName: string | null, restPropsName?: string | null): string;
|
|
31
59
|
//# sourceMappingURL=rewrite-props-object.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rewrite-props-object.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/rewrite-props-object.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rewrite-props-object.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/rewrite-props-object.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,aAAa,GAAE,MAAM,GAAG,IAAW,GAClC,MAAM,CASR"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { AttrValue, LoopParamBinding, FreeReference, IRNode } from '../types.ts';
|
|
6
6
|
import type { TopLevelLoop, BranchLoop, LoopOffset } from './types.ts';
|
|
7
7
|
import { templatePartsToJsExpr } from '../template-parts.ts';
|
|
8
|
-
import { BF_KEY as DATA_KEY, BF_KEY_PREFIX as DATA_KEY_PREFIX, BF_PLACEHOLDER as DATA_BF_PH, BF_LOOP_START, BF_LOOP_END, loopStartMarker, loopEndMarker, loopItemMarker, toHTMLAttrName as toHtmlAttrName } from '@barefootjs/shared';
|
|
8
|
+
import { BF_KEY as DATA_KEY, BF_KEY_PREFIX as DATA_KEY_PREFIX, BF_PLACEHOLDER as DATA_BF_PH, BF_LOOP_START, BF_LOOP_END, loopStartMarker, loopEndMarker, loopItemMarker, toHTMLAttrName as toHtmlAttrName, keyAttrName as sharedKeyAttrName } from '@barefootjs/shared';
|
|
9
9
|
export { DATA_KEY, DATA_KEY_PREFIX, DATA_BF_PH, BF_LOOP_START, BF_LOOP_END, loopStartMarker, loopEndMarker, loopItemMarker, toHtmlAttrName };
|
|
10
10
|
/**
|
|
11
11
|
* Parameter name for the props object in generated init/template functions.
|
|
@@ -16,8 +16,32 @@ export declare const PROPS_PARAM = "_p";
|
|
|
16
16
|
* Get the data-key attribute name for a given loop depth.
|
|
17
17
|
* Outer loop (depth 0): 'data-key'
|
|
18
18
|
* Nested loops (depth N): 'data-key-N'
|
|
19
|
+
*
|
|
20
|
+
* Re-exported from `@barefootjs/shared` (the single source of truth also
|
|
21
|
+
* used by `jsx-to-ir.ts`'s `IRElement.keyAttr` resolution) so existing
|
|
22
|
+
* imports of this module keep working.
|
|
23
|
+
*/
|
|
24
|
+
export declare const keyAttrName: typeof sharedKeyAttrName;
|
|
25
|
+
/**
|
|
26
|
+
* Build the trailing `, <bfId>, <keyAttrName>` arguments for a NESTED
|
|
27
|
+
* (`loopDepth > 0`) `mapArray(...)` call — `inner-loop.ts` / `loop-child-arm.ts`,
|
|
28
|
+
* the only two stringify sites whose loop can be nested (#2753 Shape B: the
|
|
29
|
+
* runtime otherwise has no way to know it isn't the outermost loop, and
|
|
30
|
+
* always stamped the plain `data-key` name).
|
|
31
|
+
*
|
|
32
|
+
* A depth-0 (or unkeyed) loop needs no change at all: `mapArray`'s own
|
|
33
|
+
* default (`BF_KEY`, `'data-key'`) is already correct there, and an unkeyed
|
|
34
|
+
* loop's runtime never stamps a key attribute regardless of the name — so
|
|
35
|
+
* this returns `bfIdArg` UNCHANGED, keeping every other call site (and every
|
|
36
|
+
* existing depth-0 call here) byte-identical.
|
|
37
|
+
*
|
|
38
|
+
* `bfIdArg` is the existing profiling-id suffix (e.g. `profileBindingId(...)`,
|
|
39
|
+
* either `''` or `, "<id>"`) already threaded through these two call sites —
|
|
40
|
+
* an empty one is widened to an explicit `, undefined` placeholder so the
|
|
41
|
+
* name lands in the right positional slot (`mapArray`'s 6th parameter is
|
|
42
|
+
* `bfId`, not `keyAttrName`).
|
|
19
43
|
*/
|
|
20
|
-
export declare function
|
|
44
|
+
export declare function mapArrayKeyArgs(bfIdArg: string, keyed: boolean, loopDepth: number): string;
|
|
21
45
|
/**
|
|
22
46
|
* Strip ^ prefix from slot ID for use as JavaScript variable name.
|
|
23
47
|
* `^s3` → `s3` (since `_^s3` is not a valid identifier)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAkB,gBAAgB,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACrG,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEt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EvE;AAwED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,CAUvH;AAmGD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EACrC,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,aAAa,CAAC,GAAG,MAAM,CAQ/G"}
|
package/dist/jsx-to-ir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-to-ir.d.ts","sourceRoot":"","sources":["../src/jsx-to-ir.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,KAAK,MAAM,EA+BZ,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,KAAK,eAAe,EAA0E,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"jsx-to-ir.d.ts","sourceRoot":"","sources":["../src/jsx-to-ir.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,KAAK,MAAM,EA+BZ,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,KAAK,eAAe,EAA0E,MAAM,uBAAuB,CAAA;AAw/BpI,wBAAgB,OAAO,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAOhE"}
|
package/dist/props-binding.d.ts
CHANGED
|
@@ -37,4 +37,39 @@ export declare function propsDestructureBinding(p: ParamInfo): string;
|
|
|
37
37
|
* short-circuit.
|
|
38
38
|
*/
|
|
39
39
|
export declare function buildPropAliasMap(params: readonly ParamInfo[]): Map<string, string> | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* The two component bindings that forward the caller's leftover props:
|
|
42
|
+
* the destructured `...rest` binding and a whole undestructured `(props)`
|
|
43
|
+
* parameter. Both phases carry these names — the analyzer context in
|
|
44
|
+
* Phase 1, the client-JS context in Phase 2 — so the resolver below takes
|
|
45
|
+
* them as data rather than binding to either context type.
|
|
46
|
+
*/
|
|
47
|
+
export interface RestSpreadBindings {
|
|
48
|
+
restPropsName: string | null;
|
|
49
|
+
propsObjectName: string | null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Which of `bindings` the name `name` ultimately reaches, walking through
|
|
53
|
+
* any bare `const x__alias = <name>` hop recorded in `constantValues`
|
|
54
|
+
* (name → initializer text). `'rest'` for the destructured rest binding,
|
|
55
|
+
* `'props'` for the whole props object, `null` for anything else.
|
|
56
|
+
*
|
|
57
|
+
* The single definition of "this `{...spread}` forwards the caller's
|
|
58
|
+
* leftover props", shared by the two phases that must agree on it: Phase 1
|
|
59
|
+
* decides whether the host element gets a slot id (#2754 — without one the
|
|
60
|
+
* spread has no client-side patch point at all, so a pure CSR mount drops
|
|
61
|
+
* every caller-supplied attribute), and Phase 2 decides whether to route
|
|
62
|
+
* the spread to `applyRestAttrs` and filter it out of the template's
|
|
63
|
+
* `spreadAttrs({...})` merge. Two copies of the rule would let an element
|
|
64
|
+
* qualify for one and not the other, which is exactly the silent-drop
|
|
65
|
+
* shape #2754 reports.
|
|
66
|
+
*
|
|
67
|
+
* Walks hop by hop (not a precomputed set) so a multi-hop alias
|
|
68
|
+
* (`const p2 = props; const p3 = p2`) resolves through every link;
|
|
69
|
+
* `visited` guards a constant cycle (`const a = b; const b = a`). A
|
|
70
|
+
* constant whose value isn't a bare identifier on the chain (a real
|
|
71
|
+
* computed object) stops the walk, so a genuinely different spread
|
|
72
|
+
* expression is never mistaken for the rest object.
|
|
73
|
+
*/
|
|
74
|
+
export declare function resolveRestSpreadOriginCore(bindings: RestSpreadBindings, constantValues: ReadonlyMap<string, string | undefined>, name: string): 'rest' | 'props' | null;
|
|
40
75
|
//# sourceMappingURL=props-binding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props-binding.d.ts","sourceRoot":"","sources":["../src/props-binding.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAWrD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAO5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAS/F"}
|
|
1
|
+
{"version":3,"file":"props-binding.d.ts","sourceRoot":"","sources":["../src/props-binding.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAWrD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAO5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAS/F;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,kBAAkB,EAC5B,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EACvD,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,OAAO,GAAG,IAAI,CAUzB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -225,6 +225,47 @@ export interface IRElement {
|
|
|
225
225
|
children: IRNode[];
|
|
226
226
|
slotId: string | null;
|
|
227
227
|
needsScope: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* The row-key attribute this element carries, resolved ONCE here instead
|
|
230
|
+
* of independently by 16 emit sites (#2753 root-cause: the client
|
|
231
|
+
* runtime's `mapArray` stamping an index key onto unkeyed rows SSR never
|
|
232
|
+
* emits, and disagreeing with SSR's depth-suffixed name on nested rows —
|
|
233
|
+
* see that issue for the two measured shapes). Replaces the `carriesDataKey`
|
|
234
|
+
* boolean (#2732/#2744): a boolean was a degenerate encoding of the same
|
|
235
|
+
* decision — "does this element get a key attribute, and what is it
|
|
236
|
+
* called" — that still left the VALUE and the depth-derived NAME to be
|
|
237
|
+
* re-derived by every adapter (a mutable stack in Hono, a
|
|
238
|
+
* `currentLoopKeyDepth` field in every DSL adapter) and by the client
|
|
239
|
+
* runtime. Absent means "this element carries no key attribute" — the
|
|
240
|
+
* correct, final answer for an unkeyed loop's row, not a hint adapters
|
|
241
|
+
* still have to gate further.
|
|
242
|
+
*
|
|
243
|
+
* Two disjoint sources, both resolved at IR-build time
|
|
244
|
+
* (`resolveKeyAttrs`/loop construction in `jsx-to-ir.ts`):
|
|
245
|
+
*
|
|
246
|
+
* - `value` present: this element is DIRECTLY a `.map()` row root
|
|
247
|
+
* compiled inline in this same component (`IRLoop.key`/`.depth`
|
|
248
|
+
* already resolved the expression and nesting depth) — adapters lower
|
|
249
|
+
* `value` exactly like any other attribute-value expression.
|
|
250
|
+
* - `value` absent: this element is one of the component's own possible
|
|
251
|
+
* render roots (a plain element/if-statement-branch root, or — when
|
|
252
|
+
* `needsScope` is false because hydration markers moved to a wrapping
|
|
253
|
+
* `<!--bf-scope:...-->` comment (#2732) — the first eligible element
|
|
254
|
+
* of a `needsScopeComment` fragment root) that RELAYS a key an
|
|
255
|
+
* external caller supplies at runtime, when THIS component is itself
|
|
256
|
+
* invoked as a caller's keyed loop row (the `data-key` prop / Rust
|
|
257
|
+
* `bf.data_key` field, or client `createComponent`'s `key` argument).
|
|
258
|
+
* There is no local expression to lower here, only a name.
|
|
259
|
+
*
|
|
260
|
+
* "First element, not first node" (for the fragment-root shape) mirrors
|
|
261
|
+
* the CSR runtime's own resolution of the identical ambiguity
|
|
262
|
+
* (`component.ts`'s `roots.find(isElement)`, #2735) rather than inventing
|
|
263
|
+
* a second answer.
|
|
264
|
+
*/
|
|
265
|
+
keyAttr?: {
|
|
266
|
+
name: string;
|
|
267
|
+
value?: string;
|
|
268
|
+
};
|
|
228
269
|
/**
|
|
229
270
|
* Page-lifecycle boundary id for an element lowered from `<Region>`
|
|
230
271
|
* (spec/router.md). Set only on region host elements; adapters emit it as
|
|
@@ -244,6 +285,16 @@ export interface IRExpression {
|
|
|
244
285
|
expr: string;
|
|
245
286
|
/** Pre-transformed expr with destructured prop refs rewritten to _p.xxx (for client JS templates). */
|
|
246
287
|
templateExpr?: string;
|
|
288
|
+
/**
|
|
289
|
+
* Marks a VALUE moved into element content by a lowering (today only
|
|
290
|
+
* `lowerFormControlValueSsr`'s `<textarea>`, #2765) — client builders
|
|
291
|
+
* must escape it, unlike the normal pre-rendered-HTML `${...}` case.
|
|
292
|
+
*
|
|
293
|
+
* Not read via `templateExpr` instead: that field also rebinds to
|
|
294
|
+
* `_p.xxx`, which drops a destructured prop's `?? {}` default when the
|
|
295
|
+
* builder's output lives in init scope (`client-js-generation.test.ts`).
|
|
296
|
+
*/
|
|
297
|
+
escapeInClientTemplate?: boolean;
|
|
247
298
|
/**
|
|
248
299
|
* Structured parse of `expr` (`parseExpression(expr.trim())`), attached once
|
|
249
300
|
* during IR construction so SSR adapters emit from the tree instead of each
|