ZeroOne 繁體中文技術部落格

Cloudflare Agents 的 McpAgent 要怎麼遷移?先分出 stateless 與 legacy 路徑
Cloudflare Agents SDK 0.20 將 McpAgent 標為 deprecated。遷移到 MCP SDK v2 前,先盤點 session、RPC 與 stream 依賴,再以 stateless handler 或雙路徑逐步切換。
1146 字
|
6 分鐘
Cover Image of the Post
content-visibility: auto 怎麼用:加上 contain-intrinsic-size 避免版面跳動
content-visibility: auto 可略過離開視窗內容的渲染工作,但沒設定預估尺寸會造成版面變動。本文說明何時適用、contain-intrinsic-size 寫法與可存取性檢查。
676 字
|
3 分鐘
Cover Image of the Post
CSS Scroll Snap 怎麼避開固定導覽列:scroll-padding 與 scroll-margin
CSS Scroll Snap 可讓輪播與章節捲動對齊,但固定 header 常遮住標題。本文用 scroll-snap-type、scroll-padding、scroll-margin 說明容器與目標元素各自要放什麼設定。
531 字
|
3 分鐘
Cover Image of the Post
Docker Compose profiles 怎麼用:把本機除錯工具與正式服務分開啟動
Docker Compose profiles 可讓同一份 compose.yaml 依需求啟動除錯、監控或測試服務。本文整理 profiles 的啟用方式、依賴陷阱、驗證指令與 include 的分工。
651 字
|
3 分鐘
Cover Image of the Post
HTML Popover API 怎麼用:用原生按鈕建立可關閉的浮層
HTML Popover API 可用 popover 與 popovertarget 建立原生浮層。本文整理 auto、manual 的關閉差異、最小範例、焦點與 Dialog 的選用界線。
789 字
|
4 分鐘
Cover Image of the Post
fetch 逾時怎麼處理:用 AbortSignal.timeout() 取消慢請求
JavaScript fetch 不會自動逾時。本文用 AbortSignal.timeout() 與 AbortController 示範取消慢請求、辨識 TimeoutError、處理元件卸載與避免把取消誤判成 API 失敗。
653 字
|
3 分鐘
Cover Image of the Post
Cloudflare Workers integration test 怎麼寫?用 createTestHarness 測 production build
Cloudflare Workers 新增 createTestHarness,可在 Node.js test runner 中測試一個或多個 Worker 的 production build、route 與外部 fetch。本文整理 Vitest 最小範例與 unit test 的分工。
569 字
|
3 分鐘
Cover Image of the Post
Dependabot malware alert 怎麼處理?先確認能否修補,再收斂供應鏈風險
GitHub Dependabot 擴大惡意套件 advisory 的生態系覆蓋。本文整理 malware alert 啟用方式、為何不一定有自動更新 PR,以及發現命中後的 lockfile、token 與替代套件檢查流程。
654 字
|
3 分鐘
Cover Image of the Post