Add Deno socket server support - #6724
Conversation
🦋 Changeset detectedLatest commit: 8b5f86b The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds native Deno TCP, Unix, and TLS SocketServer adapters with scoped listener cleanup, connection handling, retry backoff, public exports, tests, and a patch changeset. ChangesDeno SocketServer adapters
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant DenoSocketServer
participant DenoListener
participant SocketHandler
Client->>DenoSocketServer: start server
DenoSocketServer->>DenoListener: listen TCP, Unix, or TLS
DenoListener-->>DenoSocketServer: listener
Client->>DenoListener: connect
DenoSocketServer->>DenoListener: accept connection
DenoSocketServer->>SocketHandler: run handler with connection
SocketHandler-->>Client: echo response
DenoSocketServer->>DenoListener: close resources on scope release
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Comment |
Bundle Size Analysis
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/platform-deno/test/DenoSocketServer.test.ts (1)
23-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for connection cleanup after a handler completes.
None of the tests assert that the underlying
Deno.Connis closed once the handler finishes. Given the cleanup path relies onContext.omit(Scope.Scope)plus an (unverified) implicit scope fromEffect.runForkWithindenoSocketServer.ts, a test usingmakeTestConnthat tracks whetherclose()was called after a successfulrunhandler would directly validate that path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/platform-deno/test/DenoSocketServer.test.ts` around lines 23 - 38, The Deno socket tests lack coverage verifying connection cleanup after a handler completes. Extend makeTestConn to track close() invocation, then add a test that runs a successful handler through the socket server and asserts the underlying Deno.Conn was closed after completion, covering the cleanup path involving Context.omit(Scope.Scope) and Effect.runForkWith.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/platform-deno/test/DenoSocketServer.test.ts`:
- Around line 23-38: The Deno socket tests lack coverage verifying connection
cleanup after a handler completes. Extend makeTestConn to track close()
invocation, then add a test that runs a successful handler through the socket
server and asserts the underlying Deno.Conn was closed after completion,
covering the cleanup path involving Context.omit(Scope.Scope) and
Effect.runForkWith.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: cdbe3312-ede9-413f-989d-3fa31aec1c00
📒 Files selected for processing (5)
.changeset/add-deno-socket-server.mdpackages/platform-deno/src/DenoSocketServer.tspackages/platform-deno/src/index.tspackages/platform-deno/src/internal/denoSocketServer.tspackages/platform-deno/test/DenoSocketServer.test.ts
Closes EFF-149
Summary
Testing
nix develop -c deno task test --run packages/platform-deno/test/DenoSocketServer.test.tsnix develop -c deno check .nix develop -c pnpm checknix develop -c pnpm lintSummary by CodeRabbit
New Features
SocketServersupport for TCP, Unix, and TLS.Bug Fixes
Tests