@farm.js/create-app 0.1.0-beta.35 → 0.1.0-beta.36
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/package.json +1 -1
- package/templates/_renderers/preact/package.json +2 -2
- package/templates/_renderers/solid/package.json +2 -2
- package/templates/_renderers/svelte/package.json +2 -2
- package/templates/_renderers/vue/package.json +2 -2
- package/templates/auth/package.json +3 -3
- package/templates/basic/package.json +2 -2
- package/templates/better-auth/package.json +3 -3
- package/templates/react-compiler/README.md +2 -0
- package/templates/react-compiler/farm.config.ts +5 -0
- package/templates/react-compiler/package.json +2 -2
- package/templates/react-compiler/scripts/verify-experiment.mjs +7 -1
- package/templates/react-compiler/src/app/globals.css +5 -0
- package/templates/react-compiler/src/app/page.tsx +5 -2
- package/templates/react-compiler/src/farm.d.ts +1 -5
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type-check": "tsc --noEmit"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@farm.js/core": "0.1.0-beta.
|
|
14
|
+
"@farm.js/core": "0.1.0-beta.36",
|
|
15
15
|
"@farm.js/preact": "0.1.0-beta.30",
|
|
16
16
|
"@fontsource-variable/geist": "5.3.0",
|
|
17
17
|
"@fontsource-variable/geist-mono": "5.3.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"zod": "4.1.12"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@farm.js/cli": "0.1.0-beta.
|
|
22
|
+
"@farm.js/cli": "0.1.0-beta.36",
|
|
23
23
|
"tailwindcss": "^4.0.0",
|
|
24
24
|
"typescript": "^5.3.3"
|
|
25
25
|
},
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type-check": "tsc --noEmit"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@farm.js/core": "0.1.0-beta.
|
|
13
|
+
"@farm.js/core": "0.1.0-beta.36",
|
|
14
14
|
"@farm.js/solid": "0.1.0-beta.26",
|
|
15
15
|
"@fontsource-variable/geist": "5.3.0",
|
|
16
16
|
"@fontsource-variable/geist-mono": "5.3.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"zod": "4.1.12"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@farm.js/cli": "0.1.0-beta.
|
|
21
|
+
"@farm.js/cli": "0.1.0-beta.36",
|
|
22
22
|
"tailwindcss": "^4.0.0",
|
|
23
23
|
"typescript": "^5.3.3"
|
|
24
24
|
},
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type-check": "svelte-check --tsconfig ./tsconfig.json"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@farm.js/core": "0.1.0-beta.
|
|
14
|
+
"@farm.js/core": "0.1.0-beta.36",
|
|
15
15
|
"@farm.js/svelte": "0.1.0-beta.29",
|
|
16
16
|
"@fontsource-variable/geist": "5.3.0",
|
|
17
17
|
"@fontsource-variable/geist-mono": "5.3.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"zod": "4.1.12"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@farm.js/cli": "0.1.0-beta.
|
|
22
|
+
"@farm.js/cli": "0.1.0-beta.36",
|
|
23
23
|
"svelte-check": "4.7.5",
|
|
24
24
|
"tailwindcss": "^4.0.0",
|
|
25
25
|
"typescript": "^5.3.3"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type-check": "vue-tsc --noEmit"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@farm.js/core": "0.1.0-beta.
|
|
13
|
+
"@farm.js/core": "0.1.0-beta.36",
|
|
14
14
|
"@farm.js/vue": "0.1.0-beta.26",
|
|
15
15
|
"@fontsource-variable/geist": "5.3.0",
|
|
16
16
|
"@fontsource-variable/geist-mono": "5.3.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"zod": "4.1.12"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@farm.js/cli": "0.1.0-beta.
|
|
21
|
+
"@farm.js/cli": "0.1.0-beta.36",
|
|
22
22
|
"tailwindcss": "^4.0.0",
|
|
23
23
|
"typescript": "^5.3.3",
|
|
24
24
|
"vue-tsc": "3.3.9"
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"type-check": "tsc --noEmit"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@farm.js/auth": "0.1.0-beta.
|
|
16
|
-
"@farm.js/core": "0.1.0-beta.
|
|
15
|
+
"@farm.js/auth": "0.1.0-beta.36",
|
|
16
|
+
"@farm.js/core": "0.1.0-beta.36",
|
|
17
17
|
"@fontsource-variable/geist": "5.3.0",
|
|
18
18
|
"@fontsource-variable/geist-mono": "5.3.0",
|
|
19
19
|
"better-call": "1.3.2",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"react-dom": "^19.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@farm.js/cli": "0.1.0-beta.
|
|
24
|
+
"@farm.js/cli": "0.1.0-beta.36",
|
|
25
25
|
"@types/node": "20.19.9",
|
|
26
26
|
"@types/react": "^19.0.0",
|
|
27
27
|
"@types/react-dom": "^19.0.0",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"type-check": "tsc --noEmit"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@farm.js/core": "0.1.0-beta.
|
|
13
|
+
"@farm.js/core": "0.1.0-beta.36",
|
|
14
14
|
"@fontsource-variable/geist": "5.3.0",
|
|
15
15
|
"@fontsource-variable/geist-mono": "5.3.0",
|
|
16
16
|
"react": "^19.0.0",
|
|
17
17
|
"react-dom": "^19.0.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@farm.js/cli": "0.1.0-beta.
|
|
20
|
+
"@farm.js/cli": "0.1.0-beta.36",
|
|
21
21
|
"@types/react": "^19.0.0",
|
|
22
22
|
"@types/react-dom": "^19.0.0",
|
|
23
23
|
"tailwindcss": "^4.0.0",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"type-check": "tsc --noEmit"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@farm.js/better-auth": "0.1.0-beta.
|
|
15
|
-
"@farm.js/core": "0.1.0-beta.
|
|
14
|
+
"@farm.js/better-auth": "0.1.0-beta.36",
|
|
15
|
+
"@farm.js/core": "0.1.0-beta.36",
|
|
16
16
|
"@fontsource-variable/geist": "5.3.0",
|
|
17
17
|
"@fontsource-variable/geist-mono": "5.3.0",
|
|
18
18
|
"better-auth": "1.6.25",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"react-dom": "^19.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@farm.js/cli": "0.1.0-beta.
|
|
25
|
+
"@farm.js/cli": "0.1.0-beta.36",
|
|
26
26
|
"@types/node": "20.19.9",
|
|
27
27
|
"@types/pg": "8.20.0",
|
|
28
28
|
"@types/react": "^19.0.0",
|
|
@@ -37,6 +37,8 @@ FARM_REACT_COMPILER=true pnpm build
|
|
|
37
37
|
FARM_REACT_COMPILER=false pnpm build
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
The status shown on the starter page reflects the resolved value used for that build.
|
|
41
|
+
|
|
40
42
|
Components are considered automatically. Add `"use no compiler"` to a component when you need an
|
|
41
43
|
explicit React-only path.
|
|
42
44
|
|
|
@@ -4,6 +4,11 @@ import { react } from "@farm.js/react";
|
|
|
4
4
|
const compilerEnabled = process.env.FARM_REACT_COMPILER !== "false";
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|
|
7
|
+
env: {
|
|
8
|
+
public: {
|
|
9
|
+
FARM_REACT_COMPILER_ENABLED: () => compilerEnabled,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
7
12
|
renderer: react({
|
|
8
13
|
experimental: {
|
|
9
14
|
compiler: compilerEnabled,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type-check": "tsc --noEmit"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@farm.js/core": "0.1.0-beta.
|
|
14
|
+
"@farm.js/core": "0.1.0-beta.36",
|
|
15
15
|
"@farm.js/react": "0.1.0-beta.0",
|
|
16
16
|
"@fontsource-variable/geist": "5.3.0",
|
|
17
17
|
"@fontsource-variable/geist-mono": "5.3.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"react-dom": "19.2.8"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@farm.js/cli": "0.1.0-beta.
|
|
22
|
+
"@farm.js/cli": "0.1.0-beta.36",
|
|
23
23
|
"@playwright/test": "^1.52.0",
|
|
24
24
|
"@types/react": "^19.0.0",
|
|
25
25
|
"@types/react-dom": "^19.0.0",
|
|
@@ -6,6 +6,7 @@ import { chromium } from "@playwright/test";
|
|
|
6
6
|
|
|
7
7
|
const port = Number(process.env.FARM_EXPERIMENT_PORT || 4327);
|
|
8
8
|
const origin = `http://127.0.0.1:${port}`;
|
|
9
|
+
const compilerEnabled = process.env.FARM_REACT_COMPILER !== "false";
|
|
9
10
|
const serverEntry = path.resolve(".farm/.output/server/index.mjs");
|
|
10
11
|
const screenshotPath =
|
|
11
12
|
process.env.FARM_EXPERIMENT_SCREENSHOT || "/tmp/farm-react-compiler-starter.png";
|
|
@@ -65,6 +66,10 @@ try {
|
|
|
65
66
|
|
|
66
67
|
await page.goto(origin, { waitUntil: "networkidle" });
|
|
67
68
|
await page.getByRole("heading", { name: /compiler handles the rest/i }).waitFor();
|
|
69
|
+
assert.equal(
|
|
70
|
+
(await page.locator("[data-compiler-status]").textContent())?.trim(),
|
|
71
|
+
`experimental.compiler: ${String(compilerEnabled)}`,
|
|
72
|
+
);
|
|
68
73
|
|
|
69
74
|
const executions = {};
|
|
70
75
|
for (const pathName of ["compiled", "react"]) {
|
|
@@ -82,7 +87,7 @@ try {
|
|
|
82
87
|
executions[pathName].added = executions[pathName].final - executions[pathName].initial;
|
|
83
88
|
}
|
|
84
89
|
|
|
85
|
-
assert.equal(executions.compiled.added, 0);
|
|
90
|
+
assert.equal(executions.compiled.added, compilerEnabled ? 0 : 2);
|
|
86
91
|
assert.equal(executions.react.added, 2);
|
|
87
92
|
assert.deepEqual(browserErrors, []);
|
|
88
93
|
|
|
@@ -94,6 +99,7 @@ try {
|
|
|
94
99
|
result: "PASS",
|
|
95
100
|
productionUrl: origin,
|
|
96
101
|
screenshot: screenshotPath,
|
|
102
|
+
compilerEnabled,
|
|
97
103
|
compiledUpdateExecutions: executions.compiled.added,
|
|
98
104
|
reactUpdateExecutions: executions.react.added,
|
|
99
105
|
},
|
|
@@ -216,6 +216,11 @@ code {
|
|
|
216
216
|
box-shadow: 0 0 0 3px var(--accent-soft);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
.status-dot[data-enabled="false"] {
|
|
220
|
+
background: var(--ink-faint);
|
|
221
|
+
box-shadow: 0 0 0 3px rgb(255 255 255 / 6%);
|
|
222
|
+
}
|
|
223
|
+
|
|
219
224
|
.compiler-check {
|
|
220
225
|
margin-top: 1.9rem;
|
|
221
226
|
border: 1px solid var(--line);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { publicEnv } from "@farm.js/core/env";
|
|
1
2
|
import { CompilerComparison } from "../components/compiler-comparison";
|
|
2
3
|
import { ResourceLinks } from "../components/resource-links";
|
|
3
4
|
|
|
4
5
|
export default function HomePage() {
|
|
6
|
+
const compilerMode = String(publicEnv.FARM_REACT_COMPILER_ENABLED);
|
|
7
|
+
|
|
5
8
|
return (
|
|
6
9
|
<main className="landing-main">
|
|
7
10
|
<section className="hero-section">
|
|
@@ -29,8 +32,8 @@ export default function HomePage() {
|
|
|
29
32
|
<div className="command-row">
|
|
30
33
|
<span>02</span>
|
|
31
34
|
<div className="compiler-status">
|
|
32
|
-
<span className="status-dot" aria-hidden="true" />
|
|
33
|
-
<code>experimental.compiler:
|
|
35
|
+
<span className="status-dot" data-enabled={compilerMode} aria-hidden="true" />
|
|
36
|
+
<code data-compiler-status>experimental.compiler: {compilerMode}</code>
|
|
34
37
|
</div>
|
|
35
38
|
</div>
|
|
36
39
|
</div>
|
|
@@ -53,9 +53,7 @@ declare global {
|
|
|
53
53
|
import type FarmConfig from "../farm.config";
|
|
54
54
|
import type { InferEnv } from "@farm.js/core/env";
|
|
55
55
|
|
|
56
|
-
type FarmConfigEnv = typeof FarmConfig extends { env?: infer TEnv }
|
|
57
|
-
? NonNullable<TEnv>
|
|
58
|
-
: never;
|
|
56
|
+
type FarmConfigEnv = typeof FarmConfig extends { env?: infer TEnv } ? NonNullable<TEnv> : never;
|
|
59
57
|
type FarmResolvedEnv = [FarmConfigEnv] extends [never]
|
|
60
58
|
? { server: {}; public: {} }
|
|
61
59
|
: InferEnv<FarmConfigEnv>;
|
|
@@ -73,5 +71,3 @@ declare module "@farm.js/core" {
|
|
|
73
71
|
public: FarmResolvedEnv["public"];
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
|
-
|
|
77
|
-
export {};
|