Add DEV.setSignal so devtools can write a signal or store node
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- devtools
調査の方向性
Start from the DEV object that already exposes getSignals, getSources and getObservers, and from the write path behind the setter createSignal returns. Store slot nodes (those with _host and _key) must go through the store setter so onStoreNodeUpdate and subscribers fire. Done means DEV.setSignal works in dev builds for both node kinds, honours equals and scheduling, and can be called from outside an owned scope.
索引モデルが issue の本文から書いたものです。
説明
Devtools can read a signal through DEV, but cannot write one. I'd like a dev-only hook that sets a signal node, or the slot node of a store property, to a new value and notifies its subscribers.
DEV.setSignal(node: Signal<any>, value: unknown): void
Why
The state editor in solidjs/solid-start-devtools#41 lets a developer change a signal or store value from the devtools panel and see the app update. The panel gets nodes from DEV.getSignals and DEV.getSources. It does not have the setter the app got from createSignal or createStore, and writing node._value changes the value without notifying anyone.
To get around this, the PR creates its own createSignal(0) and redefines about 20 fields on that node (_value, _subs, _subsTail, _pendingValue, _statusFlags, _equals, _time, _notifiedAt, _owner, _transition, _firewall and others) as getters and setters that forward to the target node. It then calls its own setter, so the runtime's write path runs against the target. For a store slot it also writes _host.v[_key] and _host.pb[_key] directly.
This works on 2.0.0-rc.20, but it depends on private field names. A rename or a new field in a release breaks editing without a type error. The DEV object already has getSignals, getSources and getObservers, so the runtime is the place that can keep a write hook working.
Proposed behavior
- For a signal node: same as calling the setter
createSignalreturned, includingequals, notification and scheduling. - For a store property slot node (a node with
_hostand_key): same as writing that property through the store setter, soonStoreNodeUpdateand the store's subscribers see it. - Only in dev builds, like the rest of
DEV. - Callable outside an owned scope, from a devtools UI event. The devtools call it inside
runWithOwner(null, …)today to avoidREACTIVE_WRITE_IN_OWNED_SCOPE.
Nested paths are not needed. The devtools build the new value for the node from a path itself, and only write plain objects and arrays.
Devtools side
solidjs/solid-start-devtools#41 already calls DEV.setSignal when it is a function and falls back to the bridge otherwise, so the bridge can be removed once a release has the hook.
- 主要言語
- TypeScript
- スター
- 36.2k
- フォーク
- 1.1k
- 平均マージ
- 9時間 56分
- マージ済み PR(30日)
- 487
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
-
What gets passed to the `when` prop of a `Show` still gets executed twice on SSR対応中かも @brenelz が 5 日前に担当しました。 オープン1.x
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
solidjs/solid#4447 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
unwrapDatabaseError masks real DB errors with TypeError: Cannot convert object to primitive valueオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NEARBuilders/everything-dev#798 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vercel-labs/durable-harness#53 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Redesign tab bars ignore clicks on Linux: hidden chat layers keep window drag regions対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
experiência: a doc manda subir para o Micro do Supabase, mas não diz que exige plano pago nem quanto custa対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea/docs area/ui enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
melgarafael/DeskcommCRM#4098 ·
メンテナーはふだん 1 日以内に返信
-
dependencies platform: ios
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
software-mansion/react-native-executorch#1617 ·
メンテナーはふだん 1 日以内に返信