@farm.js/react 0.1.0-beta.2 → 0.1.0-beta.4
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/README.md +148 -42
- package/dist/compiler-runtime.cjs +2087 -134
- package/dist/compiler-runtime.cjs.map +1 -1
- package/dist/compiler-runtime.d.mts +94 -1
- package/dist/compiler-runtime.d.ts +94 -1
- package/dist/compiler-runtime.mjs +2087 -134
- package/dist/compiler-runtime.mjs.map +1 -1
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/dist/list.cjs +18 -1
- package/dist/list.cjs.map +1 -1
- package/dist/list.mjs +18 -1
- package/dist/list.mjs.map +1 -1
- package/dist/vite.cjs +1321 -75
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +1321 -75
- package/dist/vite.mjs.map +1 -1
- package/package.json +4 -3
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
type CompilerStateUpdater = unknown | ((previous: unknown) => unknown);
|
|
4
|
+
type CompilerRuntimeReactivity = "static" | "hybrid";
|
|
4
5
|
interface CompilerCell {
|
|
5
6
|
get(): unknown;
|
|
6
7
|
set(next: CompilerStateUpdater): void;
|
|
7
8
|
}
|
|
8
9
|
interface CompilerTextBinding<Props> {
|
|
9
10
|
kind: "text";
|
|
11
|
+
/** Runtime tracking is useful only for compiler-proven short-circuiting readers. */
|
|
12
|
+
tracking?: "dynamic";
|
|
10
13
|
path: readonly number[];
|
|
11
14
|
/** Stable ref target emitted by newer compiler versions. */
|
|
12
15
|
target?: number;
|
|
@@ -15,6 +18,8 @@ interface CompilerTextBinding<Props> {
|
|
|
15
18
|
}
|
|
16
19
|
interface CompilerAttributeBinding<Props> {
|
|
17
20
|
kind: "attribute";
|
|
21
|
+
/** Runtime tracking is useful only for compiler-proven short-circuiting readers. */
|
|
22
|
+
tracking?: "dynamic";
|
|
18
23
|
path: readonly number[];
|
|
19
24
|
/** Stable ref target emitted by newer compiler versions. */
|
|
20
25
|
target?: number;
|
|
@@ -24,6 +29,8 @@ interface CompilerAttributeBinding<Props> {
|
|
|
24
29
|
}
|
|
25
30
|
interface CompilerStyleBinding<Props> {
|
|
26
31
|
kind: "style";
|
|
32
|
+
/** Runtime tracking is useful only for compiler-proven short-circuiting readers. */
|
|
33
|
+
tracking?: "dynamic";
|
|
27
34
|
path: readonly number[];
|
|
28
35
|
/** Stable ref target emitted by newer compiler versions. */
|
|
29
36
|
target?: number;
|
|
@@ -58,10 +65,14 @@ interface CompilerHostElement {
|
|
|
58
65
|
value: unknown;
|
|
59
66
|
}[];
|
|
60
67
|
children: readonly (CompilerHostElement | unknown)[];
|
|
68
|
+
/** Direct-child structure owned without creating another React fiber. */
|
|
69
|
+
block?: CompilerHostBlock;
|
|
61
70
|
}
|
|
62
71
|
type CompilerKeyedRowElement = CompilerHostElement;
|
|
63
72
|
interface CompilerKeyedRowEvent {
|
|
64
73
|
name: string;
|
|
74
|
+
/** Host-element path relative to the keyed row root. */
|
|
75
|
+
path?: readonly number[];
|
|
65
76
|
invoke(item: unknown, index: number, event: React.SyntheticEvent): unknown;
|
|
66
77
|
}
|
|
67
78
|
interface CompilerKeyedRowConditionalBranch {
|
|
@@ -82,10 +93,45 @@ interface CompilerHostConditionalBinding {
|
|
|
82
93
|
name?: string;
|
|
83
94
|
read(): unknown;
|
|
84
95
|
}
|
|
96
|
+
interface CompilerStaticRangeBinding {
|
|
97
|
+
kind: "text" | "attribute" | "style";
|
|
98
|
+
/** Static segment before range N, or the trailing segment at ranges.length. */
|
|
99
|
+
segment: number;
|
|
100
|
+
/** Direct host sibling inside that static segment. */
|
|
101
|
+
sibling: number;
|
|
102
|
+
/** Host-element path relative to the selected static sibling. */
|
|
103
|
+
path: readonly number[];
|
|
104
|
+
name?: string;
|
|
105
|
+
read(): unknown;
|
|
106
|
+
}
|
|
85
107
|
interface CompilerHostConditionalBranch {
|
|
86
108
|
create(): CompilerHostElement;
|
|
87
109
|
bindings: readonly CompilerHostConditionalBinding[];
|
|
88
110
|
}
|
|
111
|
+
interface CompilerHostConditionalRanges {
|
|
112
|
+
kind: "conditional-ranges";
|
|
113
|
+
id: number;
|
|
114
|
+
ranges: readonly CompilerConditionalRange[];
|
|
115
|
+
trailing: number;
|
|
116
|
+
bindings?: readonly CompilerStaticRangeBinding[];
|
|
117
|
+
}
|
|
118
|
+
interface CompilerHostKeyedRanges {
|
|
119
|
+
kind: "keyed-ranges";
|
|
120
|
+
id: number;
|
|
121
|
+
ranges: readonly CompilerKeyedRange[];
|
|
122
|
+
trailing: number;
|
|
123
|
+
bindings?: readonly CompilerStaticRangeBinding[];
|
|
124
|
+
/** Compiler output may store only static direct children and materialize rows from the ranges. */
|
|
125
|
+
staticChildrenOnly?: boolean;
|
|
126
|
+
}
|
|
127
|
+
interface CompilerHostMixedRanges {
|
|
128
|
+
kind: "mixed-ranges";
|
|
129
|
+
id: number;
|
|
130
|
+
ranges: readonly CompilerMixedRange[];
|
|
131
|
+
trailing: number;
|
|
132
|
+
bindings?: readonly CompilerStaticRangeBinding[];
|
|
133
|
+
}
|
|
134
|
+
type CompilerHostBlock = CompilerHostConditionalRanges | CompilerHostKeyedRanges | CompilerHostMixedRanges;
|
|
89
135
|
interface CompilerHostConditionalBlockProps {
|
|
90
136
|
id: number;
|
|
91
137
|
render(): React.ReactElement;
|
|
@@ -95,21 +141,47 @@ interface CompilerHostConditionalBlockProps {
|
|
|
95
141
|
truthy?: CompilerHostConditionalBranch;
|
|
96
142
|
falsy?: CompilerHostConditionalBranch;
|
|
97
143
|
}
|
|
144
|
+
interface CompilerConditionalRange {
|
|
145
|
+
/** Number of static direct host siblings between this slot and the previous slot. */
|
|
146
|
+
before: number;
|
|
147
|
+
test(): unknown;
|
|
148
|
+
/** Logical && can produce a visible number instead of an empty branch. */
|
|
149
|
+
logical?: boolean;
|
|
150
|
+
truthy?: CompilerHostConditionalBranch;
|
|
151
|
+
falsy?: CompilerHostConditionalBranch;
|
|
152
|
+
}
|
|
153
|
+
interface CompilerConditionalRangesBlockProps {
|
|
154
|
+
id: number;
|
|
155
|
+
render(): React.ReactElement;
|
|
156
|
+
rootRef?: React.RefCallback<Element>;
|
|
157
|
+
ranges: readonly CompilerConditionalRange[];
|
|
158
|
+
/** Number of static direct host siblings after the final conditional slot. */
|
|
159
|
+
trailing: number;
|
|
160
|
+
bindings?: readonly CompilerStaticRangeBinding[];
|
|
161
|
+
}
|
|
98
162
|
interface CompilerKeyedRowBinding {
|
|
99
163
|
kind: "text" | "attribute" | "style";
|
|
100
164
|
path: readonly number[];
|
|
101
165
|
name?: string;
|
|
166
|
+
/** Component state cells read by this binding, when emitted by the compiler. */
|
|
167
|
+
dependencies?: readonly number[];
|
|
102
168
|
read(item: unknown, index: number): unknown;
|
|
103
169
|
}
|
|
104
170
|
interface CompilerKeyedRowsBlockProps {
|
|
105
171
|
id: number;
|
|
106
172
|
render(event: (item: unknown, index: number, eventId: number) => React.EventHandler<React.SyntheticEvent>, conditional: (item: unknown, index: number, conditionalId: number, render: (item: unknown, index: number) => React.ReactNode) => React.ReactNode): React.ReactElement;
|
|
107
173
|
items(): Iterable<unknown> | null | undefined;
|
|
174
|
+
/** State cells that can change the row collection or its key projection. */
|
|
175
|
+
structureDependencies?: readonly number[];
|
|
108
176
|
rowKey(item: unknown, index: number): React.Key;
|
|
109
177
|
create(item: unknown, index: number): CompilerKeyedRowElement;
|
|
110
178
|
bindings: readonly CompilerKeyedRowBinding[];
|
|
111
179
|
events?: readonly CompilerKeyedRowEvent[];
|
|
180
|
+
/** Route compiler-proven bubbling row events through the stable React container. */
|
|
181
|
+
delegateEvents?: boolean;
|
|
112
182
|
conditionals?: readonly CompilerKeyedRowConditional[];
|
|
183
|
+
/** Row descriptors contain compiler-owned nested host scopes. */
|
|
184
|
+
hostBlocks?: boolean;
|
|
113
185
|
}
|
|
114
186
|
interface CompilerKeyedRange {
|
|
115
187
|
/** Number of static direct host siblings between this range and the previous range. */
|
|
@@ -119,6 +191,17 @@ interface CompilerKeyedRange {
|
|
|
119
191
|
create(item: unknown, index: number): CompilerKeyedRowElement;
|
|
120
192
|
bindings: readonly CompilerKeyedRowBinding[];
|
|
121
193
|
}
|
|
194
|
+
type CompilerMixedRange = ({
|
|
195
|
+
kind: "conditional";
|
|
196
|
+
} & CompilerConditionalRange) | ({
|
|
197
|
+
kind: "keyed";
|
|
198
|
+
} & CompilerKeyedRange);
|
|
199
|
+
interface CompilerMixedRangesBlockProps {
|
|
200
|
+
id: number;
|
|
201
|
+
render(): React.ReactElement;
|
|
202
|
+
create(): CompilerHostElement;
|
|
203
|
+
rootRef?: React.RefCallback<Element>;
|
|
204
|
+
}
|
|
122
205
|
interface CompilerKeyedRangesBlockProps {
|
|
123
206
|
id: number;
|
|
124
207
|
render(): React.ReactElement;
|
|
@@ -126,6 +209,7 @@ interface CompilerKeyedRangesBlockProps {
|
|
|
126
209
|
ranges: readonly CompilerKeyedRange[];
|
|
127
210
|
/** Number of static direct host siblings after the final keyed range. */
|
|
128
211
|
trailing: number;
|
|
212
|
+
bindings?: readonly CompilerStaticRangeBinding[];
|
|
129
213
|
}
|
|
130
214
|
interface CompilerComponentBlockProps {
|
|
131
215
|
id: number;
|
|
@@ -134,20 +218,29 @@ interface CompilerComponentBlockProps {
|
|
|
134
218
|
interface CompilerBlockRuntime {
|
|
135
219
|
Conditional: React.ComponentType<CompilerConditionalBlockProps>;
|
|
136
220
|
HostConditional: React.ComponentType<CompilerHostConditionalBlockProps>;
|
|
221
|
+
ConditionalRanges: React.ComponentType<CompilerConditionalRangesBlockProps>;
|
|
137
222
|
KeyedList: React.ComponentType<CompilerKeyedListBlockProps>;
|
|
138
223
|
KeyedRows: React.ComponentType<CompilerKeyedRowsBlockProps>;
|
|
139
224
|
KeyedRanges: React.ComponentType<CompilerKeyedRangesBlockProps>;
|
|
225
|
+
MixedRanges: React.ComponentType<CompilerMixedRangesBlockProps>;
|
|
140
226
|
Component: React.ComponentType<CompilerComponentBlockProps>;
|
|
141
227
|
target(id: number): React.RefCallback<Element>;
|
|
142
228
|
}
|
|
143
229
|
type CompilerBinding<Props> = CompilerTextBinding<Props> | CompilerAttributeBinding<Props> | CompilerStyleBinding<Props> | CompilerConditionalBlockBinding;
|
|
144
230
|
interface CompiledComponentDefinition<Props> {
|
|
145
231
|
displayName: string;
|
|
232
|
+
/** Scheduler selected by the compiler. Hand-authored definitions default to `static`. */
|
|
233
|
+
reactivity?: CompilerRuntimeReactivity;
|
|
146
234
|
/** Stable development-only identity used to preserve state across compatible refreshes. */
|
|
147
235
|
hmrId?: string;
|
|
148
236
|
/** Changes when the compiler-owned state layout is no longer refresh-compatible. */
|
|
149
237
|
stateSignature?: string;
|
|
150
238
|
initialize(props: Props): readonly unknown[];
|
|
239
|
+
/**
|
|
240
|
+
* Compiler-emitted flat prop reads. Primitive values can share the local
|
|
241
|
+
* dependency graph; identity-bearing values retain normal React rendering.
|
|
242
|
+
*/
|
|
243
|
+
readProps?(props: Props): readonly unknown[];
|
|
151
244
|
render(props: Props, state: readonly CompilerCell[], blocks: CompilerBlockRuntime): React.ReactElement;
|
|
152
245
|
bindings: readonly CompilerBinding<Props>[];
|
|
153
246
|
}
|
|
@@ -160,4 +253,4 @@ interface CompiledComponentDefinition<Props> {
|
|
|
160
253
|
*/
|
|
161
254
|
declare function createCompiledComponent<Props>(definition: CompiledComponentDefinition<Props>): React.ComponentType<Props>;
|
|
162
255
|
|
|
163
|
-
export { type CompiledComponentDefinition, type CompilerAttributeBinding, type CompilerBinding, type CompilerBlockRuntime, type CompilerCell, type CompilerComponentBlockProps, type CompilerConditionalBlockBinding, type CompilerConditionalBlockProps, type CompilerHostConditionalBinding, type CompilerHostConditionalBlockProps, type CompilerHostConditionalBranch, type CompilerHostElement, type CompilerKeyedListBlockProps, type CompilerKeyedRange, type CompilerKeyedRangesBlockProps, type CompilerKeyedRowBinding, type CompilerKeyedRowConditional, type CompilerKeyedRowConditionalBranch, type CompilerKeyedRowElement, type CompilerKeyedRowEvent, type CompilerKeyedRowsBlockProps, type CompilerStateUpdater, type CompilerStyleBinding, type CompilerTextBinding, createCompiledComponent };
|
|
256
|
+
export { type CompiledComponentDefinition, type CompilerAttributeBinding, type CompilerBinding, type CompilerBlockRuntime, type CompilerCell, type CompilerComponentBlockProps, type CompilerConditionalBlockBinding, type CompilerConditionalBlockProps, type CompilerConditionalRange, type CompilerConditionalRangesBlockProps, type CompilerHostBlock, type CompilerHostConditionalBinding, type CompilerHostConditionalBlockProps, type CompilerHostConditionalBranch, type CompilerHostConditionalRanges, type CompilerHostElement, type CompilerHostKeyedRanges, type CompilerHostMixedRanges, type CompilerKeyedListBlockProps, type CompilerKeyedRange, type CompilerKeyedRangesBlockProps, type CompilerKeyedRowBinding, type CompilerKeyedRowConditional, type CompilerKeyedRowConditionalBranch, type CompilerKeyedRowElement, type CompilerKeyedRowEvent, type CompilerKeyedRowsBlockProps, type CompilerMixedRange, type CompilerMixedRangesBlockProps, type CompilerRuntimeReactivity, type CompilerStateUpdater, type CompilerStaticRangeBinding, type CompilerStyleBinding, type CompilerTextBinding, createCompiledComponent };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
type CompilerStateUpdater = unknown | ((previous: unknown) => unknown);
|
|
4
|
+
type CompilerRuntimeReactivity = "static" | "hybrid";
|
|
4
5
|
interface CompilerCell {
|
|
5
6
|
get(): unknown;
|
|
6
7
|
set(next: CompilerStateUpdater): void;
|
|
7
8
|
}
|
|
8
9
|
interface CompilerTextBinding<Props> {
|
|
9
10
|
kind: "text";
|
|
11
|
+
/** Runtime tracking is useful only for compiler-proven short-circuiting readers. */
|
|
12
|
+
tracking?: "dynamic";
|
|
10
13
|
path: readonly number[];
|
|
11
14
|
/** Stable ref target emitted by newer compiler versions. */
|
|
12
15
|
target?: number;
|
|
@@ -15,6 +18,8 @@ interface CompilerTextBinding<Props> {
|
|
|
15
18
|
}
|
|
16
19
|
interface CompilerAttributeBinding<Props> {
|
|
17
20
|
kind: "attribute";
|
|
21
|
+
/** Runtime tracking is useful only for compiler-proven short-circuiting readers. */
|
|
22
|
+
tracking?: "dynamic";
|
|
18
23
|
path: readonly number[];
|
|
19
24
|
/** Stable ref target emitted by newer compiler versions. */
|
|
20
25
|
target?: number;
|
|
@@ -24,6 +29,8 @@ interface CompilerAttributeBinding<Props> {
|
|
|
24
29
|
}
|
|
25
30
|
interface CompilerStyleBinding<Props> {
|
|
26
31
|
kind: "style";
|
|
32
|
+
/** Runtime tracking is useful only for compiler-proven short-circuiting readers. */
|
|
33
|
+
tracking?: "dynamic";
|
|
27
34
|
path: readonly number[];
|
|
28
35
|
/** Stable ref target emitted by newer compiler versions. */
|
|
29
36
|
target?: number;
|
|
@@ -58,10 +65,14 @@ interface CompilerHostElement {
|
|
|
58
65
|
value: unknown;
|
|
59
66
|
}[];
|
|
60
67
|
children: readonly (CompilerHostElement | unknown)[];
|
|
68
|
+
/** Direct-child structure owned without creating another React fiber. */
|
|
69
|
+
block?: CompilerHostBlock;
|
|
61
70
|
}
|
|
62
71
|
type CompilerKeyedRowElement = CompilerHostElement;
|
|
63
72
|
interface CompilerKeyedRowEvent {
|
|
64
73
|
name: string;
|
|
74
|
+
/** Host-element path relative to the keyed row root. */
|
|
75
|
+
path?: readonly number[];
|
|
65
76
|
invoke(item: unknown, index: number, event: React.SyntheticEvent): unknown;
|
|
66
77
|
}
|
|
67
78
|
interface CompilerKeyedRowConditionalBranch {
|
|
@@ -82,10 +93,45 @@ interface CompilerHostConditionalBinding {
|
|
|
82
93
|
name?: string;
|
|
83
94
|
read(): unknown;
|
|
84
95
|
}
|
|
96
|
+
interface CompilerStaticRangeBinding {
|
|
97
|
+
kind: "text" | "attribute" | "style";
|
|
98
|
+
/** Static segment before range N, or the trailing segment at ranges.length. */
|
|
99
|
+
segment: number;
|
|
100
|
+
/** Direct host sibling inside that static segment. */
|
|
101
|
+
sibling: number;
|
|
102
|
+
/** Host-element path relative to the selected static sibling. */
|
|
103
|
+
path: readonly number[];
|
|
104
|
+
name?: string;
|
|
105
|
+
read(): unknown;
|
|
106
|
+
}
|
|
85
107
|
interface CompilerHostConditionalBranch {
|
|
86
108
|
create(): CompilerHostElement;
|
|
87
109
|
bindings: readonly CompilerHostConditionalBinding[];
|
|
88
110
|
}
|
|
111
|
+
interface CompilerHostConditionalRanges {
|
|
112
|
+
kind: "conditional-ranges";
|
|
113
|
+
id: number;
|
|
114
|
+
ranges: readonly CompilerConditionalRange[];
|
|
115
|
+
trailing: number;
|
|
116
|
+
bindings?: readonly CompilerStaticRangeBinding[];
|
|
117
|
+
}
|
|
118
|
+
interface CompilerHostKeyedRanges {
|
|
119
|
+
kind: "keyed-ranges";
|
|
120
|
+
id: number;
|
|
121
|
+
ranges: readonly CompilerKeyedRange[];
|
|
122
|
+
trailing: number;
|
|
123
|
+
bindings?: readonly CompilerStaticRangeBinding[];
|
|
124
|
+
/** Compiler output may store only static direct children and materialize rows from the ranges. */
|
|
125
|
+
staticChildrenOnly?: boolean;
|
|
126
|
+
}
|
|
127
|
+
interface CompilerHostMixedRanges {
|
|
128
|
+
kind: "mixed-ranges";
|
|
129
|
+
id: number;
|
|
130
|
+
ranges: readonly CompilerMixedRange[];
|
|
131
|
+
trailing: number;
|
|
132
|
+
bindings?: readonly CompilerStaticRangeBinding[];
|
|
133
|
+
}
|
|
134
|
+
type CompilerHostBlock = CompilerHostConditionalRanges | CompilerHostKeyedRanges | CompilerHostMixedRanges;
|
|
89
135
|
interface CompilerHostConditionalBlockProps {
|
|
90
136
|
id: number;
|
|
91
137
|
render(): React.ReactElement;
|
|
@@ -95,21 +141,47 @@ interface CompilerHostConditionalBlockProps {
|
|
|
95
141
|
truthy?: CompilerHostConditionalBranch;
|
|
96
142
|
falsy?: CompilerHostConditionalBranch;
|
|
97
143
|
}
|
|
144
|
+
interface CompilerConditionalRange {
|
|
145
|
+
/** Number of static direct host siblings between this slot and the previous slot. */
|
|
146
|
+
before: number;
|
|
147
|
+
test(): unknown;
|
|
148
|
+
/** Logical && can produce a visible number instead of an empty branch. */
|
|
149
|
+
logical?: boolean;
|
|
150
|
+
truthy?: CompilerHostConditionalBranch;
|
|
151
|
+
falsy?: CompilerHostConditionalBranch;
|
|
152
|
+
}
|
|
153
|
+
interface CompilerConditionalRangesBlockProps {
|
|
154
|
+
id: number;
|
|
155
|
+
render(): React.ReactElement;
|
|
156
|
+
rootRef?: React.RefCallback<Element>;
|
|
157
|
+
ranges: readonly CompilerConditionalRange[];
|
|
158
|
+
/** Number of static direct host siblings after the final conditional slot. */
|
|
159
|
+
trailing: number;
|
|
160
|
+
bindings?: readonly CompilerStaticRangeBinding[];
|
|
161
|
+
}
|
|
98
162
|
interface CompilerKeyedRowBinding {
|
|
99
163
|
kind: "text" | "attribute" | "style";
|
|
100
164
|
path: readonly number[];
|
|
101
165
|
name?: string;
|
|
166
|
+
/** Component state cells read by this binding, when emitted by the compiler. */
|
|
167
|
+
dependencies?: readonly number[];
|
|
102
168
|
read(item: unknown, index: number): unknown;
|
|
103
169
|
}
|
|
104
170
|
interface CompilerKeyedRowsBlockProps {
|
|
105
171
|
id: number;
|
|
106
172
|
render(event: (item: unknown, index: number, eventId: number) => React.EventHandler<React.SyntheticEvent>, conditional: (item: unknown, index: number, conditionalId: number, render: (item: unknown, index: number) => React.ReactNode) => React.ReactNode): React.ReactElement;
|
|
107
173
|
items(): Iterable<unknown> | null | undefined;
|
|
174
|
+
/** State cells that can change the row collection or its key projection. */
|
|
175
|
+
structureDependencies?: readonly number[];
|
|
108
176
|
rowKey(item: unknown, index: number): React.Key;
|
|
109
177
|
create(item: unknown, index: number): CompilerKeyedRowElement;
|
|
110
178
|
bindings: readonly CompilerKeyedRowBinding[];
|
|
111
179
|
events?: readonly CompilerKeyedRowEvent[];
|
|
180
|
+
/** Route compiler-proven bubbling row events through the stable React container. */
|
|
181
|
+
delegateEvents?: boolean;
|
|
112
182
|
conditionals?: readonly CompilerKeyedRowConditional[];
|
|
183
|
+
/** Row descriptors contain compiler-owned nested host scopes. */
|
|
184
|
+
hostBlocks?: boolean;
|
|
113
185
|
}
|
|
114
186
|
interface CompilerKeyedRange {
|
|
115
187
|
/** Number of static direct host siblings between this range and the previous range. */
|
|
@@ -119,6 +191,17 @@ interface CompilerKeyedRange {
|
|
|
119
191
|
create(item: unknown, index: number): CompilerKeyedRowElement;
|
|
120
192
|
bindings: readonly CompilerKeyedRowBinding[];
|
|
121
193
|
}
|
|
194
|
+
type CompilerMixedRange = ({
|
|
195
|
+
kind: "conditional";
|
|
196
|
+
} & CompilerConditionalRange) | ({
|
|
197
|
+
kind: "keyed";
|
|
198
|
+
} & CompilerKeyedRange);
|
|
199
|
+
interface CompilerMixedRangesBlockProps {
|
|
200
|
+
id: number;
|
|
201
|
+
render(): React.ReactElement;
|
|
202
|
+
create(): CompilerHostElement;
|
|
203
|
+
rootRef?: React.RefCallback<Element>;
|
|
204
|
+
}
|
|
122
205
|
interface CompilerKeyedRangesBlockProps {
|
|
123
206
|
id: number;
|
|
124
207
|
render(): React.ReactElement;
|
|
@@ -126,6 +209,7 @@ interface CompilerKeyedRangesBlockProps {
|
|
|
126
209
|
ranges: readonly CompilerKeyedRange[];
|
|
127
210
|
/** Number of static direct host siblings after the final keyed range. */
|
|
128
211
|
trailing: number;
|
|
212
|
+
bindings?: readonly CompilerStaticRangeBinding[];
|
|
129
213
|
}
|
|
130
214
|
interface CompilerComponentBlockProps {
|
|
131
215
|
id: number;
|
|
@@ -134,20 +218,29 @@ interface CompilerComponentBlockProps {
|
|
|
134
218
|
interface CompilerBlockRuntime {
|
|
135
219
|
Conditional: React.ComponentType<CompilerConditionalBlockProps>;
|
|
136
220
|
HostConditional: React.ComponentType<CompilerHostConditionalBlockProps>;
|
|
221
|
+
ConditionalRanges: React.ComponentType<CompilerConditionalRangesBlockProps>;
|
|
137
222
|
KeyedList: React.ComponentType<CompilerKeyedListBlockProps>;
|
|
138
223
|
KeyedRows: React.ComponentType<CompilerKeyedRowsBlockProps>;
|
|
139
224
|
KeyedRanges: React.ComponentType<CompilerKeyedRangesBlockProps>;
|
|
225
|
+
MixedRanges: React.ComponentType<CompilerMixedRangesBlockProps>;
|
|
140
226
|
Component: React.ComponentType<CompilerComponentBlockProps>;
|
|
141
227
|
target(id: number): React.RefCallback<Element>;
|
|
142
228
|
}
|
|
143
229
|
type CompilerBinding<Props> = CompilerTextBinding<Props> | CompilerAttributeBinding<Props> | CompilerStyleBinding<Props> | CompilerConditionalBlockBinding;
|
|
144
230
|
interface CompiledComponentDefinition<Props> {
|
|
145
231
|
displayName: string;
|
|
232
|
+
/** Scheduler selected by the compiler. Hand-authored definitions default to `static`. */
|
|
233
|
+
reactivity?: CompilerRuntimeReactivity;
|
|
146
234
|
/** Stable development-only identity used to preserve state across compatible refreshes. */
|
|
147
235
|
hmrId?: string;
|
|
148
236
|
/** Changes when the compiler-owned state layout is no longer refresh-compatible. */
|
|
149
237
|
stateSignature?: string;
|
|
150
238
|
initialize(props: Props): readonly unknown[];
|
|
239
|
+
/**
|
|
240
|
+
* Compiler-emitted flat prop reads. Primitive values can share the local
|
|
241
|
+
* dependency graph; identity-bearing values retain normal React rendering.
|
|
242
|
+
*/
|
|
243
|
+
readProps?(props: Props): readonly unknown[];
|
|
151
244
|
render(props: Props, state: readonly CompilerCell[], blocks: CompilerBlockRuntime): React.ReactElement;
|
|
152
245
|
bindings: readonly CompilerBinding<Props>[];
|
|
153
246
|
}
|
|
@@ -160,4 +253,4 @@ interface CompiledComponentDefinition<Props> {
|
|
|
160
253
|
*/
|
|
161
254
|
declare function createCompiledComponent<Props>(definition: CompiledComponentDefinition<Props>): React.ComponentType<Props>;
|
|
162
255
|
|
|
163
|
-
export { type CompiledComponentDefinition, type CompilerAttributeBinding, type CompilerBinding, type CompilerBlockRuntime, type CompilerCell, type CompilerComponentBlockProps, type CompilerConditionalBlockBinding, type CompilerConditionalBlockProps, type CompilerHostConditionalBinding, type CompilerHostConditionalBlockProps, type CompilerHostConditionalBranch, type CompilerHostElement, type CompilerKeyedListBlockProps, type CompilerKeyedRange, type CompilerKeyedRangesBlockProps, type CompilerKeyedRowBinding, type CompilerKeyedRowConditional, type CompilerKeyedRowConditionalBranch, type CompilerKeyedRowElement, type CompilerKeyedRowEvent, type CompilerKeyedRowsBlockProps, type CompilerStateUpdater, type CompilerStyleBinding, type CompilerTextBinding, createCompiledComponent };
|
|
256
|
+
export { type CompiledComponentDefinition, type CompilerAttributeBinding, type CompilerBinding, type CompilerBlockRuntime, type CompilerCell, type CompilerComponentBlockProps, type CompilerConditionalBlockBinding, type CompilerConditionalBlockProps, type CompilerConditionalRange, type CompilerConditionalRangesBlockProps, type CompilerHostBlock, type CompilerHostConditionalBinding, type CompilerHostConditionalBlockProps, type CompilerHostConditionalBranch, type CompilerHostConditionalRanges, type CompilerHostElement, type CompilerHostKeyedRanges, type CompilerHostMixedRanges, type CompilerKeyedListBlockProps, type CompilerKeyedRange, type CompilerKeyedRangesBlockProps, type CompilerKeyedRowBinding, type CompilerKeyedRowConditional, type CompilerKeyedRowConditionalBranch, type CompilerKeyedRowElement, type CompilerKeyedRowEvent, type CompilerKeyedRowsBlockProps, type CompilerMixedRange, type CompilerMixedRangesBlockProps, type CompilerRuntimeReactivity, type CompilerStateUpdater, type CompilerStaticRangeBinding, type CompilerStyleBinding, type CompilerTextBinding, createCompiledComponent };
|