Summary
Two @netscript/fresh-ui registry components ship source that fails deno lint / deno check the moment they're copied into a standard Deno Fresh app via ui:add / ui:init (alpha.18). Both block deno task check immediately, so every consumer must hand-patch copy-source files (which then get clobbered on the next ui:init --force). Fixing upstream makes them permanent.
Repro: netscript ui:init --force + netscript ui:add ai into a Deno app, then deno lint . && deno check.
1 · registry/components/ui/chart-block.tsx — jsx-key (3 unkeyed list renders, column variant)
error[jsx-key]: Missing 'key' prop for an element
chart-block.tsx:70 {ticks.map((tick) => <span class='ns-colchart__ytick'>…)}
chart-block.tsx:73 {data.map((datum) => <div class='ns-colchart__col'>…)}
chart-block.tsx:87 {data.map((datum) => <span>{datum.label}</span>)}
Fix: add key (index is fine) to each mapped element, e.g. data.map((datum, i) => <span key={i}>….
2 · registry/islands/ui/toast.tsx (Toast) — setTimeout ref type (TS2322)
TS2322: Type 'Timeout' is not assignable to type 'number'.
toast.tsx exitTimeoutRef.current = globalThis.setTimeout(…) (useRef<number>())
Under Deno with Node types in scope, globalThis.setTimeout returns Timeout, not number. The three timeout refs are declared useRef<number>().
Fix: useRef<ReturnType<typeof setTimeout>>() for exitTimeoutRef / hideTimeoutRef / urlCleanupTimeoutRef (leave the two genuine numeric refs).
Context
Found while adopting fresh-ui@0.0.1-alpha.18 in eis-chat (rickylabs/eis-chat#28/#29). Patched locally as copy-source for now; filing so the registry source is fixed permanently. Both are trivial, mechanical fixes.
Summary
Two
@netscript/fresh-uiregistry components ship source that failsdeno lint/deno checkthe moment they're copied into a standard Deno Fresh app viaui:add/ui:init(alpha.18). Both blockdeno task checkimmediately, so every consumer must hand-patch copy-source files (which then get clobbered on the nextui:init --force). Fixing upstream makes them permanent.Repro:
netscript ui:init --force+netscript ui:add aiinto a Deno app, thendeno lint . && deno check.1 ·
registry/components/ui/chart-block.tsx—jsx-key(3 unkeyed list renders, column variant)Fix: add
key(index is fine) to each mapped element, e.g.data.map((datum, i) => <span key={i}>….2 ·
registry/islands/ui/toast.tsx(Toast) —setTimeoutref type (TS2322)Under Deno with Node types in scope,
globalThis.setTimeoutreturnsTimeout, notnumber. The three timeout refs are declareduseRef<number>().Fix:
useRef<ReturnType<typeof setTimeout>>()forexitTimeoutRef/hideTimeoutRef/urlCleanupTimeoutRef(leave the two genuine numeric refs).Context
Found while adopting fresh-ui@0.0.1-alpha.18 in eis-chat (rickylabs/eis-chat#28/#29). Patched locally as copy-source for now; filing so the registry source is fixed permanently. Both are trivial, mechanical fixes.