Skip to content

fix(signals): keep a dependent unnamed resource apart from the one it reads - #284

Merged
erkamyaman merged 1 commit into
mainfrom
fix/h-signals
Oct 11, 2026
Merged

erkamyaman merged 1 commit into
mainfrom
fix/h-signals

Conversation

@erkamyaman

@erkamyaman erkamyaman commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

What and why

groupsOf in signal-resources.ts merges resource parts into one resource when an edge links two Resource… nodes with the same name. Unnamed resources (debugName is optional) all share the name undefined. A resource's extRequest node is the one that reads the user's params function.

So with the common dependent pattern posts = resource({ params: () => this.user.value(), … }), the edge extRequest (posts) → value (user) merged both resources. The Resources list and the resources array from inspect-signals showed 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 extRequest part no longer join groups. A resource's own parts never rely on that edge: state and loadEffect read extRequest, 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. On main it 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:check
  • pnpm typecheck (includes the ngc template checks)
  • pnpm test:devtools (all passing)
  • pnpm skills:check (when .claude/ changed): not changed
  • No docs change needed: the fix makes the code match existing docs (no-docs)
  • pnpm extension:build and extension/ui committed (when app/ changed): not changed
  • Checked in the browser with axe (when the UI changed): no UI change

Summary by CodeRabbit

  • Bug Fixes
    • Unnamed resources that reference another unnamed resource now remain grouped separately in devtools. Each resource retains its own displayed value and node identifiers, rather than being combined with the resource it references.

… 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.
@erkamyaman erkamyaman added the no-docs This pull request needs no docs change (the reason is in the description) label Oct 11, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
5d7ca2c 2026-10-11T03:18:09.040Z View logs ↗

@github-actions github-actions Bot added the area: package The ng-devtools package (packages/ng-devtools) label Oct 11, 2026
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6ef83ddc-539b-4892-8512-b379f6f9ac6e

📥 Commits

Reviewing files that changed from the base of the PR and between 58273c6 and 5d7ca2c.


📒 Files selected for processing (2)
  • packages/devtools/src/__tests__/signal-resources.test.ts
  • packages/devtools/src/signal-resources.ts

Limit details: You’ve used all 10 included reviews currently available.



📝 Walkthrough

Walkthrough

groupsOf no longer unions same-name resource parts when the consumer is extRequest. A regression test checks that two unnamed resources remain separate when the second resource's parameters reference the first resource's value.

Changes

Resource grouping

Layer / File(s) Summary
Exclude extRequest edges
packages/devtools/src/signal-resources.ts, packages/devtools/src/__tests__/signal-resources.test.ts
groupsOf skips same-name edges from extRequest. The test verifies that linked unnamed resources retain separate groups, values, and node IDs.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix


Merge Risk: ⚪ Minimal · up to 5d7ca

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 Summary

Architecture risk: 🔵 Low · up to 5d7ca

The change affects 1 system.

Changed systems: packages/devtools

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/devtools (library) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/devtools/src/tests/signal-resources.test.ts: Adds a test with two unnamed resources and graph edges linking the second resource’s parameters to the first resource’s value; it expects separate resource groups with distinct values and node IDs.
  • observed — Modified behavior in packages/devtools/src/signal-resources.ts: groupsOf now excludes same-name edges whose consumer is extRequest; previously, those edges were unioned like other parts.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: preventing a dependent unnamed resource from merging with the unnamed resource that it reads.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 2
  • Waived: $0.50 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.


Comment @coderabbitai help to get the list of available commands.

@erkamyaman
erkamyaman merged commit 55aea54 into main Oct 11, 2026
7 of 9 checks passed
@erkamyaman
erkamyaman deleted the fix/h-signals branch October 11, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: package The ng-devtools package (packages/ng-devtools) no-docs This pull request needs no docs change (the reason is in the description)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant