Expose replacement implementations of `QueryClient` APIs in UI
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 需要釐清
- 活躍度
- 冷清
- 技術堆疊
- typescript
- 領域
- frontend
研究方向
先閱讀遭阻塞的 issue #8530 和 ADR 0020 PR #131,以了解 guard 設計和待完成的對齊工作。檢視 createUIQueryClient API,以及此處所述的 react-router v6 createHashRouter/RouterProvider 遷移。完成的標準是為樂觀更新、路由載入器和 getQueryCache 變更選擇並交付獲批准的替代方案。
由索引模型根據 Issue 內容生成。
描述
Tracks follow-up work after the initial guard implementation (#8530) and ADR-level alignment on PR #131.
Subissues
Replacement: optimistic-update alternative for data-service-backed state (setQueryData / setQueriesData)
#8530 throws on these for data-service keys. This ticket designs and ships a sanctioned alternative so feature teams can still do optimistic UI updates. Options (pending ADR 0020 PR #131 resolution):
- Messenger-dispatched primitive:
dataService.setOptimisticCacheData(queryKey, updater)that writes to the background cache and propagates viacacheUpdated→hydrate(). Loses synchronous-write semantics; cold-path MV3 SW wake-up (100–300ms) makes worst case materially slower than the canonical pattern. - Sanctioned UI facade with explicit rollback on mutation failure. Preserves synchronous-write semantics.
- Explicit ADR statement that optimistic updates for data-service keys are out of scope under Option A.
File after PR #131 alignment on which option to pursue.
Replacement: route-loader integration for data-service keys (ensureQueryData / ensureInfiniteQueryData)
#8530 throws on these for data-service keys. This ticket designs and ships a sanctioned loader-compatible alternative. Extension is mid-transition to react-router v6 data-router (createHashRouter + RouterProvider), where loader: () => queryClient.ensureQueryData(...) is the natural pattern. Options (pending PR #131 resolution):
ensureDataServiceQueryData(routeMessenger, queryKey)— dispatches to the service via the route messenger, awaits cache population. Composes with the UI messengers ADRRouteMessengerauthorization boundary. Requires route-messenger-manager or closure-injected handle (UI messengers ADR Option 1B).- Block loaders from consuming data-service keys; treat route data loading as React-side only (
useSuspenseQueryin route component).
File after PR #131 alignment on which option to pursue.
getQueryCache() facade**
client.getQueryCache().build/.add/.remove bypasses all instance-shadowing from #8530. Two design options:
- Shadow
getQueryCacheto return a facade that gates mutating methods by key prefix - Stop returning a raw
QueryClientfromcreateUIQueryClient— return a narrower facade (breaking API change)
File after Layer 1 (#8530) is validated and a design option is chosen.
Dependencies
Blocked on: #8530 (Layer 1 guards)
Blocked on (replacements): ADR 0020 PR #131 resolution
- 主要語言
- TypeScript
- 星號
- 424
- 分支
- 311
- 平均合併
- 1 天 8 小時
- 30 天內合併 PR
- 446
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
MetaMask/core 的其他 Issue
-
EIP-1898 object selectors fail before downstream RPC in eth-json-rpc-middleware 26.0.0可能已有人在做 @debojyoti10CC 於 5 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
CI: "Validate changelog diffs" job fails on every fork-sourced pull request可能已有人在做 @Roxen-AS 於 37 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
platform-api-docs: `scan` strategy misses ESM-only packages, which ship `.d.ts` rather than `.d.cts`可能已有人在做 @gaohan1994 於 39 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
[utils] Replace the `uuid` dependency with `crypto.randomUUID()`可能已有人在做 @avantikonde 於 51 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
MetaMask/core#10210 · 1 個 reaction ·
維護者通常 1 天內回覆
-
[utils] `toWei` accepts fractional wei and returns wrong values可能已有人在做 @Roxen-AS 於 37 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
相似的 Issue
-
enhancement from-app needs-triage
難度 2/5 1-3 小時 新手友好度 68/100
nightly-labs/openbot#19162 ·
維護者通常 1 天內回覆
-
triage:in-progress
難度 2/5 1-3 小時 新手友好度 76/100
Cotal-AI/Cotal#11229 · 1 則留言 ·
維護者通常 1 天內回覆
-
npm ci fails with EALLOWREMOTE on npm 12可能已有人在做 @landry-kapgnep 今天認領。 未關閉status/need-triage
難度 1/5 1 小時以內 新手友好度 82/100
google-gemini/gemini-cli#30525 · 2 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
omdsh-dev/DSH-better-sidebar#1290 ·
維護者通常 1 天內回覆
-
Suggest a wallet: WalletChan可能已有人在做 @apoorvlathey 今天認領。 未關閉awaiting changes needs triage 📥
難度 2/5 1-3 小時 新手友好度 76/100
ethereum/ethereum-org-website#20000 · 3 則留言 ·
維護者通常 1 天內回覆