From d76d54c41223120e097a6f234bee28d99a518247 Mon Sep 17 00:00:00 2001 From: iris Date: Fri, 6 Nov 2026 22:38:56 +0100 Subject: [PATCH] frontend: preact 11.2.0 All four packages move from preact 10.29.8 to 11.2.0. The new types need four small changes in swarm-ui and the shared dropdown: a ref that may be empty is typed RefObject, HTMLAttributes is imported from preact instead of read from the JSX namespace, and TextField's type is the five kinds it is used with, asserted once for the input's new union. npm-deps-hash follows the lockfile. --- frontend/npm-deps-hash | 2 +- frontend/package-lock.json | 16 ++++++++-------- frontend/packages/agent/package.json | 2 +- frontend/packages/dashboard/package.json | 2 +- frontend/packages/shared/package.json | 2 +- .../packages/shared/src/dropdown/Dropdown.tsx | 2 +- frontend/packages/swarm-ui/package.json | 2 +- .../src/agent/detail/AgentDetailPopover.tsx | 2 +- .../src/agent/roster/AgentCardLayout.tsx | 4 ++-- .../packages/swarm-ui/src/ui/popover/Popover.tsx | 2 +- .../swarm-ui/src/ui/text-field/TextField.tsx | 7 +++++-- 11 files changed, 23 insertions(+), 20 deletions(-) diff --git a/frontend/npm-deps-hash b/frontend/npm-deps-hash index fb109ba2..597bd316 100644 --- a/frontend/npm-deps-hash +++ b/frontend/npm-deps-hash @@ -1 +1 @@ -sha256-PO8UpPlpyNE4DbhFJAFk3PQNWrBf02XirBuYqtu5fAg= +sha256-Hzu21wcDxdn32JJPpj/3sJSkEDH32mqrm4YsFvHfni0= diff --git a/frontend/package-lock.json b/frontend/package-lock.json index caeed598..063c8135 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -904,16 +904,16 @@ } }, "node_modules/preact": { - "version": "10.29.8", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.29.8.tgz", - "integrity": "sha512-ej2aVZ+vZ8WO7tvlQWRM9N63A0KzF9q4mWJfDUHgYaIofWY9hu74QdnQrjoPMmZi2/nZ5gN0bJCQF49xQqx09Q==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/preact/-/preact-11.2.0.tgz", + "integrity": "sha512-/HfHI/7N84e6GrWBJ3J280z3mLaRJiDcSvj/A+y/4AbLnND/1UlGHe1sR6oYuTGwId0nP7dqDU9OnLxMPZ7xBg==", "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" }, "peerDependencies": { - "preact-render-to-string": ">=5" + "preact-render-to-string": ">=6.7.0" }, "peerDependenciesMeta": { "preact-render-to-string": { @@ -983,7 +983,7 @@ "dependencies": { "@hive/shared": "*", "chart.js": "4.6.1", - "preact": "10.29.8" + "preact": "11.2.0" }, "devDependencies": { "typescript": "7.0.2" @@ -994,7 +994,7 @@ "version": "0.0.0", "dependencies": { "@hive/shared": "*", - "preact": "10.29.8" + "preact": "11.2.0" } }, "packages/shared": { @@ -1003,7 +1003,7 @@ "dependencies": { "dompurify": "^3.2.4", "marked": "18.1.3", - "preact": "10.29.8" + "preact": "11.2.0" } }, "packages/swarm-ui": { @@ -1011,7 +1011,7 @@ "version": "0.0.0", "dependencies": { "@hive/shared": "*", - "preact": "10.29.8", + "preact": "11.2.0", "wouter-preact": "3.13.0" }, "devDependencies": { diff --git a/frontend/packages/agent/package.json b/frontend/packages/agent/package.json index ebf5be40..74b0a0f5 100644 --- a/frontend/packages/agent/package.json +++ b/frontend/packages/agent/package.json @@ -11,7 +11,7 @@ "dependencies": { "@hive/shared": "*", "chart.js": "4.6.1", - "preact": "10.29.8" + "preact": "11.2.0" }, "devDependencies": { "typescript": "7.0.2" diff --git a/frontend/packages/dashboard/package.json b/frontend/packages/dashboard/package.json index 0bc57fed..48f47931 100644 --- a/frontend/packages/dashboard/package.json +++ b/frontend/packages/dashboard/package.json @@ -9,6 +9,6 @@ }, "dependencies": { "@hive/shared": "*", - "preact": "10.29.8" + "preact": "11.2.0" } } diff --git a/frontend/packages/shared/package.json b/frontend/packages/shared/package.json index 0bc77faa..252c5297 100644 --- a/frontend/packages/shared/package.json +++ b/frontend/packages/shared/package.json @@ -8,7 +8,7 @@ "dependencies": { "dompurify": "^3.2.4", "marked": "18.1.3", - "preact": "10.29.8" + "preact": "11.2.0" }, "exports": { ".": "./src/index.js", diff --git a/frontend/packages/shared/src/dropdown/Dropdown.tsx b/frontend/packages/shared/src/dropdown/Dropdown.tsx index 6cf198fb..5162af9d 100644 --- a/frontend/packages/shared/src/dropdown/Dropdown.tsx +++ b/frontend/packages/shared/src/dropdown/Dropdown.tsx @@ -52,7 +52,7 @@ export interface DropdownProps { * `MetaNav`'s own hand-rolled popover (which wraps trigger+popover in * one ref) already avoids this. */ - anchorRef?: RefObject; + anchorRef?: RefObject; } export function Dropdown({ diff --git a/frontend/packages/swarm-ui/package.json b/frontend/packages/swarm-ui/package.json index 47a2fbd1..9cbc038f 100644 --- a/frontend/packages/swarm-ui/package.json +++ b/frontend/packages/swarm-ui/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@hive/shared": "*", - "preact": "10.29.8", + "preact": "11.2.0", "wouter-preact": "3.13.0" }, "devDependencies": { diff --git a/frontend/packages/swarm-ui/src/agent/detail/AgentDetailPopover.tsx b/frontend/packages/swarm-ui/src/agent/detail/AgentDetailPopover.tsx index 932b90f9..2b8b2a13 100644 --- a/frontend/packages/swarm-ui/src/agent/detail/AgentDetailPopover.tsx +++ b/frontend/packages/swarm-ui/src/agent/detail/AgentDetailPopover.tsx @@ -29,7 +29,7 @@ export function AgentDetailPopover({ agent: string; open: boolean; onClose: () => void; - anchorRef: RefObject; + anchorRef: RefObject; }) { // `undefined` until the roster has answered; `null` when it has and the // agent is not in it. diff --git a/frontend/packages/swarm-ui/src/agent/roster/AgentCardLayout.tsx b/frontend/packages/swarm-ui/src/agent/roster/AgentCardLayout.tsx index 7aab4538..e946eccc 100644 --- a/frontend/packages/swarm-ui/src/agent/roster/AgentCardLayout.tsx +++ b/frontend/packages/swarm-ui/src/agent/roster/AgentCardLayout.tsx @@ -4,7 +4,7 @@ // the slots with the real sub components; `AgentCardSkeleton` fills the same // slots with placeholder shapes, so the card that replaces it lands in the same // place. -import type { ComponentChildren, JSX } from "preact"; +import type { ComponentChildren, HTMLAttributes } from "preact"; import "./AgentCard.css"; export function AgentCardLayout({ @@ -23,7 +23,7 @@ export function AgentCardLayout({ message: ComponentChildren; chevron?: ComponentChildren; /** Attributes of the header row, for the card that opens on a click. */ - rowProps?: JSX.HTMLAttributes; + rowProps?: HTMLAttributes; }) { return (
diff --git a/frontend/packages/swarm-ui/src/ui/popover/Popover.tsx b/frontend/packages/swarm-ui/src/ui/popover/Popover.tsx index a08e4eba..fc2c8557 100644 --- a/frontend/packages/swarm-ui/src/ui/popover/Popover.tsx +++ b/frontend/packages/swarm-ui/src/ui/popover/Popover.tsx @@ -45,7 +45,7 @@ export function Popover({ onClose: () => void; /** The element the popover hangs under. A click on it is not an outside * click, so its own toggle handler stays in charge of closing. */ - anchorRef: RefObject; + anchorRef: RefObject; /** `aria-label` for the floating box. */ label: string; children: ComponentChildren; diff --git a/frontend/packages/swarm-ui/src/ui/text-field/TextField.tsx b/frontend/packages/swarm-ui/src/ui/text-field/TextField.tsx index df772fb4..8da71763 100644 --- a/frontend/packages/swarm-ui/src/ui/text-field/TextField.tsx +++ b/frontend/packages/swarm-ui/src/ui/text-field/TextField.tsx @@ -29,7 +29,7 @@ export function TextField({ label: string; value: string; onInput: (value: string) => void; - type?: string; + type?: "text" | "password" | "number" | "url" | "datetime-local"; pattern?: string; title?: string; required?: boolean; @@ -46,7 +46,10 @@ export function TextField({