feat(net): simplify JavaScript API - #3815
Conversation
|
Warning Review limit reachedNext included review available in 2 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (80)
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 |
Recommendation: MERGEReviewed head Positive improvement?Yes. The public surface is clearer and smaller:
Publish switching catalog/media to static tracks (demand-gated encoder handles) removes the request-loop boilerplate and matches how fan-out actually works. Worth the complexity?Yes. The WeakMap wire registry + Different approach?Not needed. Soft-deprecation / dual exports would prolong the messy surface this PR is closing. Breaking on Bug fixes that support merge
Nits (non-blocking)
Verdict: MERGE — clear API win, encapsulation is justified, migrations/docs are complete, protocol risk is low. This is an automated review, not the maintainer's decision |
Verdict: request changes |
Co-Authored-By: Codex <codex@openai.com>
Co-Authored-By: Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
ccb8b02 to
2a6334b
Compare
Verdict: request changes |
Co-Authored-By: OpenAI Codex <codex@openai.com>
|
Merge pass complete:
The automated request to retarget breaking API work to (written by GPT-5) |
Verdict: request changes |



Problem
@moq/netexposed overlapping names, positional connection arguments, ad-hoc duration and range types, and transport-only operations on public handles. Those shapes obscured ownership and forced consumers to assemble lower-level request loops themselves. Connection pooling also kept the first requested linger and dropped delay defaults when callers supplied only part of the backoff configuration.Approach
Impact
SessionError,StreamError,StreamErrorOptions,NotFound, andLaggedmove underErrorasError.Session,Error.Stream,Error.StreamOptions,Error.NotFound, andError.TooFarBehind. Numeric error codes remain top-level.connect(url, props?)becomesconnect({ url, ... });accept(transport, url, props?)becomesaccept({ transport, url, ... });WebSocketOptionsbecomesWebSocketProps;Connection.DelaybecomesConnection.Backoff; and public configuration durations useTime.Milli.Established.consume()andEstablished.announcedBroadcast()are removed in favor of the origin request surface.Origin.RequestbecomesOrigin.Requesting; incomingBroadcastRequestbecomesOrigin.Request; andTable.request(path)becomesrequest(path, { announced? }).startGroupandendGroupbecome the typed inclusive/exclusiveGroupsrange, andmaxAgeusesTime.Milli.Alternatives
Compatibility aliases or parallel methods would preserve the ambiguous surface through the release. Keeping transport operations public would also expose implementation details the consumer API does not need. This PR makes the breaking cleanup directly before release instead.
Follow-ups
Release notes should call out that importing the
Errornamespace may require an alias such asError as NetErrorto avoid colliding with the JavaScript global. No code follow-up is required.Validation
nix develop --command just checknix develop --command just test@moq/net: 825 tests passed(written by GPT-5)