docs(js): document Derived on the @moq/signals page - #2753
Conversation
dbffa4d to
f41f052
Compare
6e5ffe4 to
22e5f42
Compare
Splits back out of #2752, which had to drop this section because Derived does not exist on main or dev yet. Covers what Derived buys over Computed (named sources instead of tracking, a correct first read, no close()) and what it costs (fn runs per read, so it must stay cheap and pure), plus the notify-on-actual-change behavior that lets a source move without moving the view. Blocked on #2705, which adds the class. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
22e5f42 to
62f2a79
Compare
|
Warning Review limit reached
Next review available in: 29 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Derivedsection todoc/lib/js/@moq/signals.md: what it buys overComputed(sources named up front instead of tracked, a correct first read rather thanundefined, noclose()), what it costs (fnruns on every read, so it must stay cheap and pure), and the notify-on-actual-change behavior that lets a source move without moving the view.Overviewline and the list of readablesgetter()accepts.Why this was split from #2752
An adversarial review flagged the section in #2752:
Deriveddoes not exist onmainordev. It lives only in commit3870cd1aonclaude/js-origin-extract(#2705). #2752 therefore shipped without it, describing only whatmainexports, and the section was parked here.Merging ahead of the implementation
This lands before #2705, which is the PR that actually adds the class, so the published page documents
Derivedahead of the code. Until #2705 merges todevanddevreachesmain, a reader who copies the sample gets a failing import. Deliberate and self-correcting once #2705 propagates; flagged here so the gap is on the record rather than a surprise.Public API changes
None. Documentation only.
Test plan
js/signals/src/index.tstaken from3870cd1asoDerivedresolves: zero errors. This confirms thenew Derived([this.#peers], (peers) => peers.size > 0)sample infers correctly through theconst S extends readonly Getter<unknown>[]generic and thatpeek()returnsboolean.bun remark . --quiet --frailpasses.just checkon this branch cannot exercise the sample, sinceDerivedis not in the tree here. Worth re-running once feat(js/net)!: route publish and consume through Origins, share one connection per relay #2705 lands.(Written by Opus 5)