Repository navigation
fix(signals): keep a dependent unnamed resource apart from the one it reads - #284
Conversation
… reads Resource parts are grouped into one resource when an edge joins two nodes with the same name. Unnamed resources all share the name undefined, and a resource's extRequest node reads the user's params, so when params read another unnamed resource's value the two were merged into one entry. Edges from extRequest no longer join groups; a resource's own parts never need them.
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The change keeps resources separate when one resource’s parameters reference another while preserving grouping of ordinary resource parts. No actionable merge-blocking risk is established. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review details
Pre-merge checks |
|
What and why
groupsOfinsignal-resources.tsmerges resource parts into one resource when an edge links twoResource…nodes with the same name. Unnamed resources (debugNameis optional) all share the nameundefined. A resource'sextRequestnode is the one that reads the user'sparamsfunction.So with the common dependent pattern
posts = resource({ params: () => this.user.value(), … }), the edgeextRequest(posts) →value(user) merged both resources. The Resources list and theresourcesarray frominspect-signalsshowed a single "resource 1" with the first resource's value and status, and all ten internal nodes listed under it. The second resource disappeared.Edges whose consumer is an
extRequestpart no longer join groups. A resource's own parts never rely on that edge:stateandloadEffectreadextRequest, not the other way round.How it was verified
New test in
signal-resources.test.ts, using the node and edge shape a real Angular app produces for two unnamed resources where one reads the other. Onmainit gets one group. With the fix it gets "resource 1" and "resource 2" with their own values. All package tests pass.pnpm commit:check(commit messages follow the guidelines)pnpm format:checkpnpm typecheck(includes thengctemplate checks)pnpm test:devtools(all passing)pnpm skills:check(when.claude/changed): not changedno-docs)pnpm extension:buildandextension/uicommitted (whenapp/changed): not changedSummary by CodeRabbit