cheogram-www
created pr with
cheogram-www/react-compiler-fixes.1
commented
Changes are available at https://tangled.org/mrry.band/cheogram-www on branch react-compiler-fixes.
cmds
checkout latest patchset:
ssh pr.pico.sh pull cheogram-www:react-compiler-fixes | git am -3checkout specific patchset revision:
ssh pr.pico.sh pull cheogram-www:react-compiler-fixes [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh cheogram-www:react-compiler-fixesadd comment to patch request:
ssh pr.pico.sh comment cheogram-www:react-compiler-fixes "lgtm!"
Patchset
cheogram-www/react-compiler-fixes.1
Test each file for compilability
Eric Roberts
Fix Account.tsx for react-compiler
2026-11-10T17:11:18ZEric Roberts
Fix Accounts.tsx for react-compiler
2026-11-10T17:23:58ZEric Roberts
Fix Chat.tsx for react-compiler
2026-11-10T17:26:31ZEric Roberts
Fix Chats.tsx for react-compiler
2026-11-10T17:29:12ZEric Roberts
Fix Login.tsx for react-compiler
2026-11-10T17:32:03ZEric Roberts
Fix MessageDebugger.tsx for react-compiler
2026-11-10T17:33:10ZEric Roberts
Fix MessageMenuInChat.tsx for react-compiler
2026-11-10T17:33:57ZEric Roberts
Fix Quill.tsx for react-compiler
2026-11-10T17:34:29ZEric Roberts
→ Fix Register.tsx for react-compiler
2026-11-10T17:35:10ZEric Roberts
2026-11-10T17:36:03Z
Fix Register.tsx for react-compiler
Eric Roberts
2026-11-10T17:36:03ZThe password-needed listener hits the same false hook error:
Hooks must be called at the top level of a function component
or custom Hook
Use reauthenticate helper
Semantic diff summary
0 added,
4 modified,
0 signature changed,
0 removed
across 2 analyzed files
+3
-11
scripts/compiler.test.mjs
#
| ... | ... | @@ -3,10 +3,6 @@ import { glob } from "node:fs/promises"; | |
| 3 | 3 | import { test } from "node:test"; | |
| 4 | 4 | import { createServer } from "vite"; | |
| 5 | 5 | ||
| 6 | - | const compilerSkips = new Set([ | |
| 7 | - | "components/Register.tsx", | |
| 8 | - | ]); | |
| 9 | - | ||
| 10 | 6 | test("React Compiler", async (t) => { | |
| 11 | 7 | const server = await createServer({ | |
| 12 | 8 | mode: "compiler-test", |
| ... | ... | @@ -36,13 +32,9 @@ test("React Compiler", async (t) => { | |
| 36 | 32 | cwd: "src", | |
| 37 | 33 | exclude: ["**/*.test.*", "**/*.d.ts"], | |
| 38 | 34 | })) { | |
| 39 | - | await t.test( | |
| 40 | - | `compiles src/${file}`, | |
| 41 | - | { skip: compilerSkips.has(file) && "Known React Compiler diagnostics" }, | |
| 42 | - | async () => { | |
| 43 | - | assert.ok(await server.transformRequest(`/src/${file}`)); | |
| 44 | - | }, | |
| 45 | - | ); | |
| 35 | + | await t.test(`compiles src/${file}`, async () => { | |
| 36 | + | assert.ok(await server.transformRequest(`/src/${file}`)); | |
| 37 | + | }); | |
| 46 | 38 | } | |
| 47 | 39 | } finally { | |
| 48 | 40 | await server.close(); |
+2
-2
src/components/Register.tsx
#
| ... | ... | @@ -13,7 +13,7 @@ import { Suspense, useState, FormEvent } from "react"; | |
| 13 | 13 | import { Context, Accounts } from "../App"; | |
| 14 | 14 | import { FormSection } from "./Form"; | |
| 15 | 15 | import { newAccount } from "./Login"; | |
| 16 | - | import { href } from "../util"; | |
| 16 | + | import { href, reauthenticate } from "../util"; | |
| 17 | 17 | ||
| 18 | 18 | const RegisterInner = () => { | |
| 19 | 19 | const navigate = useNavigate(); |
| ... | ... | @@ -32,7 +32,7 @@ const RegisterInner = () => { | |
| 32 | 32 | const account = newAccount(accountId, idbp, persistence); | |
| 33 | 33 | if (data.has("password")) { | |
| 34 | 34 | const token = account.client.addPasswordNeededListener(() => { | |
| 35 | - | account.client.usePassword("" + data.get("password")); | |
| 35 | + | reauthenticate(account.client, "" + data.get("password")); | |
| 36 | 36 | account.client.removeEventListener(token); | |
| 37 | 37 | }); | |
| 38 | 38 | } |