@barefootjs/jsx 0.31.3 → 0.31.5
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/adapters/jsx-adapter.d.ts.map +1 -1
- package/dist/adapters/loop-bound-names.d.ts +18 -0
- package/dist/adapters/loop-bound-names.d.ts.map +1 -1
- package/dist/adapters/template-imports.d.ts +27 -15
- package/dist/adapters/template-imports.d.ts.map +1 -1
- package/dist/adapters/test-adapter.d.ts.map +1 -1
- package/dist/augment-inherited-props.d.ts +12 -2
- package/dist/augment-inherited-props.d.ts.map +1 -1
- package/dist/compiler.d.ts.map +1 -1
- package/dist/debug.d.ts.map +1 -1
- package/dist/free-refs.d.ts +11 -2
- package/dist/free-refs.d.ts.map +1 -1
- package/dist/identifier-pattern.d.ts +62 -0
- package/dist/identifier-pattern.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +968 -789
- package/dist/ir-to-client-js/collect-elements.d.ts +23 -2
- package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-event-delegation.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-reactive-effects.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/reactive-effects.d.ts +7 -0
- package/dist/ir-to-client-js/control-flow/plan/reactive-effects.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/event-delegation.d.ts.map +1 -1
- package/dist/ir-to-client-js/csr-substitute.d.ts +12 -1
- package/dist/ir-to-client-js/csr-substitute.d.ts.map +1 -1
- package/dist/ir-to-client-js/html-template.d.ts +20 -12
- package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
- package/dist/ir-to-client-js/imports.d.ts.map +1 -1
- package/dist/ir-to-client-js/prop-handling.d.ts +25 -2
- package/dist/ir-to-client-js/prop-handling.d.ts.map +1 -1
- package/dist/ir-to-client-js/reactivity.d.ts +46 -2
- package/dist/ir-to-client-js/reactivity.d.ts.map +1 -1
- package/dist/ir-to-client-js/rewrite-props-object.d.ts.map +1 -1
- package/dist/ir-to-client-js/types.d.ts +16 -0
- package/dist/ir-to-client-js/types.d.ts.map +1 -1
- package/dist/ir-to-client-js/utils.d.ts +15 -0
- package/dist/ir-to-client-js/utils.d.ts.map +1 -1
- package/dist/jsx-to-ir.d.ts.map +1 -1
- package/dist/module-exports.d.ts +64 -0
- package/dist/module-exports.d.ts.map +1 -1
- package/dist/relocate.d.ts.map +1 -1
- package/dist/scope/binding-scope.d.ts +1 -1
- package/dist/types.d.ts +41 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/binding-scope-ratchet.test.ts +146 -21
- package/src/__tests__/component-type-parameters.test.ts +70 -0
- package/src/__tests__/csr-materialize-loop-preamble-shadow.test.ts +85 -0
- package/src/__tests__/csr-substitute-enclosing-scope.test.ts +77 -0
- package/src/__tests__/free-refs.test.ts +1 -1
- package/src/__tests__/identifier-pattern.test.ts +170 -0
- package/src/__tests__/loop-child-reactive-attr-const-shadow.test.ts +107 -0
- package/src/__tests__/mutable-binding-writers.test.ts +133 -0
- package/src/__tests__/preamble-conditional-reactivity.test.ts +191 -0
- package/src/__tests__/rewrite-dynamic-imports.test.ts +98 -0
- package/src/__tests__/signal-setter-updater-type.test.ts +81 -0
- package/src/adapters/jsx-adapter.ts +31 -4
- package/src/adapters/loop-bound-names.ts +18 -0
- package/src/adapters/template-imports.ts +93 -0
- package/src/adapters/test-adapter.ts +4 -1
- package/src/augment-inherited-props.ts +13 -1
- package/src/compiler.ts +18 -0
- package/src/debug.ts +38 -24
- package/src/free-refs.ts +14 -5
- package/src/identifier-pattern.ts +79 -0
- package/src/index.ts +1 -1
- package/src/ir-to-client-js/collect-elements.ts +60 -16
- package/src/ir-to-client-js/control-flow/plan/build-event-delegation.ts +2 -1
- package/src/ir-to-client-js/control-flow/plan/build-reactive-effects.ts +1 -0
- package/src/ir-to-client-js/control-flow/plan/reactive-effects.ts +7 -0
- package/src/ir-to-client-js/control-flow/stringify/event-delegation.ts +2 -1
- package/src/ir-to-client-js/control-flow/stringify/reactive-effects.ts +12 -2
- package/src/ir-to-client-js/csr-substitute.ts +19 -2
- package/src/ir-to-client-js/html-template.ts +42 -31
- package/src/ir-to-client-js/imports.ts +2 -1
- package/src/ir-to-client-js/prop-handling.ts +28 -1
- package/src/ir-to-client-js/reactivity.ts +58 -6
- package/src/ir-to-client-js/rewrite-props-object.ts +2 -1
- package/src/ir-to-client-js/types.ts +16 -0
- package/src/ir-to-client-js/utils.ts +24 -8
- package/src/jsx-to-ir.ts +135 -10
- package/src/module-exports.ts +140 -2
- package/src/relocate.ts +2 -1
- package/src/scope/binding-scope.ts +1 -1
- package/src/types.ts +41 -0
|
@@ -201,7 +201,7 @@ export class BindingScope {
|
|
|
201
201
|
* qualifies, including a preamble local shadowing a module const.
|
|
202
202
|
* These call `isBound` / `boundNames()`.
|
|
203
203
|
* - REACTIVITY / SLOT-ID CLASSIFIERS (`referencesLoopParam`,
|
|
204
|
-
* `hasReactiveAttributes`, and the `BindingEnvironment.
|
|
204
|
+
* `hasReactiveAttributes`, and the `BindingEnvironment.loopValueBoundNames`
|
|
205
205
|
* feed built from `makeBindingEnv`, all in `jsx-to-ir.ts`) ask
|
|
206
206
|
* "does this expression read a value that changes per row and so
|
|
207
207
|
* needs its own patchable slot" — a preamble local already gets
|
package/src/types.ts
CHANGED
|
@@ -901,6 +901,28 @@ export interface MapCallbackPreamble {
|
|
|
901
901
|
* keeps the plain interpolation it always had.
|
|
902
902
|
*/
|
|
903
903
|
builderNames: string[]
|
|
904
|
+
/**
|
|
905
|
+
* The subset of {@link declaredNames} whose OWN initializer is itself
|
|
906
|
+
* reactive — reads a signal / memo / reactive prop, directly or
|
|
907
|
+
* transitively through an earlier preamble declaration (#2596). `undefined`
|
|
908
|
+
* (never an empty array) when the preamble contributes no such name, or
|
|
909
|
+
* when it isn't a value-only declaration sequence this analysis covers
|
|
910
|
+
* (see `preambleFromValueStatements`'s caller — a JSX-building preamble
|
|
911
|
+
* doesn't compute this and leaves it unset).
|
|
912
|
+
*
|
|
913
|
+
* Used to decide whether a loop-body CONDITIONAL whose condition
|
|
914
|
+
* bare-references a preamble local should carry the IR `reactive` flag
|
|
915
|
+
* (`markPreambleConditionalReactivity`, jsx-to-ir.ts). Deliberately NOT the
|
|
916
|
+
* same test `collectPreambleRegions`/`markPreambleAttrSlots` use for
|
|
917
|
+
* text/attr positions — those mark ANY reference to `declaredNames`
|
|
918
|
+
* reactive because their region-patch effect re-runs the whole preamble
|
|
919
|
+
* unconditionally on row update, and ordinary signal auto-tracking inside
|
|
920
|
+
* that effect picks up genuine dependencies regardless of the IR flag. A
|
|
921
|
+
* conditional instead swaps whole DOM subtrees via `insert()`, so it stays
|
|
922
|
+
* unwrapped unless the local it reads is proven to depend on an actual
|
|
923
|
+
* external signal — a bare `item.title`-derived local needs no such wrap.
|
|
924
|
+
*/
|
|
925
|
+
reactiveNames?: string[]
|
|
904
926
|
}
|
|
905
927
|
|
|
906
928
|
/**
|
|
@@ -1940,6 +1962,25 @@ export interface IRMetadata {
|
|
|
1940
1962
|
isClientComponent: boolean
|
|
1941
1963
|
typeDefinitions: TypeDefinition[]
|
|
1942
1964
|
propsType: TypeInfo | null
|
|
1965
|
+
/**
|
|
1966
|
+
* The component function's own generic type parameter list, verbatim
|
|
1967
|
+
* from source (each `node.getText()`, joined and wrapped in `<...>`),
|
|
1968
|
+
* e.g. `<NodeType extends NodeBase = NodeBase, EdgeType extends
|
|
1969
|
+
* EdgeBase = EdgeBase>`. `null` when the component isn't generic.
|
|
1970
|
+
*
|
|
1971
|
+
* A generic function component's props type (and often its body) keeps
|
|
1972
|
+
* referencing these names verbatim in emitted output (e.g. `props:
|
|
1973
|
+
* FlowComponentProps<NodeType, EdgeType>`, `createFlowStore<NodeType,
|
|
1974
|
+
* EdgeType>(props)`) — without the function's own declaration also
|
|
1975
|
+
* carrying the type parameters, those references are unresolved names
|
|
1976
|
+
* in the emitted `.tsx` (TS2304). Emitters that print a `function
|
|
1977
|
+
* <name>(...)` signature for the component must splice this verbatim
|
|
1978
|
+
* between the name and the parameter list. Optional (rather than
|
|
1979
|
+
* required) so the many hand-built `IRMetadata` test fixtures across
|
|
1980
|
+
* the suite don't need updating for a field that is `null` for the
|
|
1981
|
+
* overwhelming majority of (non-generic) components.
|
|
1982
|
+
*/
|
|
1983
|
+
typeParameters?: string | null
|
|
1943
1984
|
propsParams: ParamInfo[]
|
|
1944
1985
|
/** Name of the props object parameter (e.g., 'props' in `function Component(props: Props)`) */
|
|
1945
1986
|
propsObjectName: string | null
|