@farm.js/react 0.1.0-beta.21 → 0.1.0-beta.23
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 +26 -11
- package/dist/compiler-runtime.cjs +285 -231
- package/dist/compiler-runtime.cjs.map +1 -1
- package/dist/compiler-runtime.d.mts +5 -0
- package/dist/compiler-runtime.d.ts +5 -0
- package/dist/compiler-runtime.mjs +285 -231
- package/dist/compiler-runtime.mjs.map +1 -1
- package/dist/index.cjs +25 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.mjs +25 -2
- package/dist/index.mjs.map +1 -1
- package/dist/list.cjs +6 -0
- package/dist/list.cjs.map +1 -1
- package/dist/list.mjs +6 -0
- package/dist/list.mjs.map +1 -1
- package/dist/vite.cjs +88 -33
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +88 -33
- package/dist/vite.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
React renderer integration for FARMJS, including the experimental AOT compiler.
|
|
4
4
|
|
|
5
5
|
React remains the default renderer and needs no package or configuration. Install this package only
|
|
6
|
-
when opting into the compiler
|
|
6
|
+
when opting into the compiler:
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
9
|
pnpm add @farm.js/react
|
|
@@ -15,9 +15,7 @@ import { react } from "@farm.js/react";
|
|
|
15
15
|
|
|
16
16
|
export default defineConfig({
|
|
17
17
|
renderer: react({
|
|
18
|
-
|
|
19
|
-
compiler: true,
|
|
20
|
-
},
|
|
18
|
+
compiler: true,
|
|
21
19
|
}),
|
|
22
20
|
});
|
|
23
21
|
```
|
|
@@ -25,6 +23,25 @@ export default defineConfig({
|
|
|
25
23
|
`compiler: true` uses inference: every application TSX/JSX component is considered, eligible
|
|
26
24
|
components are compiled with hybrid reactivity, and everything else keeps the normal React path.
|
|
27
25
|
|
|
26
|
+
The compiler is experimental and stays off when this option is omitted or `false`. The former
|
|
27
|
+
`react({ experimental: { compiler } })` spelling remains a deprecated alias with the same options
|
|
28
|
+
and a one-time warning. Do not configure both spellings, even when one is `false`.
|
|
29
|
+
|
|
30
|
+
### Compatibility and upgrades
|
|
31
|
+
|
|
32
|
+
`react({ compiler })`, `ReactCompilerOptions`, and `List` from `@farm.js/react/list` are the
|
|
33
|
+
application-facing API. Both inference and annotation mode, static and hybrid reactivity, fallback
|
|
34
|
+
diagnostics, and coverage reporting remain supported. Annotation and static mode are advanced
|
|
35
|
+
options, not separate experimental APIs. The package is independently versioned; a prerelease
|
|
36
|
+
version remains a beta until its stable release is published.
|
|
37
|
+
|
|
38
|
+
The compiler and `@farm.js/react/compiler-runtime` ship together. Generated definitions must use
|
|
39
|
+
the runtime from the same installed package version; they are not a cross-version interchange
|
|
40
|
+
format. Upgrade the package and rebuild the complete app, including SSR and browser output,
|
|
41
|
+
together. Do not copy generated compiler output between package versions or deploy a new server
|
|
42
|
+
with an old browser build. Existing runtime exports remain available, but prefer ordinary React
|
|
43
|
+
source over hand-authored compiler definitions.
|
|
44
|
+
|
|
28
45
|
Hybrid reactivity starts from the compiler's proven state-to-binding dependency lists, then marks
|
|
29
46
|
only multi-state short-circuit bindings for runtime read tracking. For
|
|
30
47
|
`enabled ? activeValue : inactiveValue`, an update to the inactive value does not schedule the
|
|
@@ -53,13 +70,11 @@ For selective adoption, use annotation mode:
|
|
|
53
70
|
|
|
54
71
|
```ts
|
|
55
72
|
renderer: react({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
reactivity: "hybrid",
|
|
62
|
-
},
|
|
73
|
+
compiler: {
|
|
74
|
+
mode: "annotation",
|
|
75
|
+
directive: "use compiler",
|
|
76
|
+
onUnsupported: "warn",
|
|
77
|
+
reactivity: "hybrid",
|
|
63
78
|
},
|
|
64
79
|
}),
|
|
65
80
|
```
|