Skip to content

feat(worker): Web-API (edge-style) handlers in functions shim - #103

Merged
Dvorinka merged 2 commits into
mainfrom
feat/edge-style-handlers
Nov 19, 2026
Merged

Dvorinka merged 2 commits into
mainfrom
feat/edge-style-handlers

Conversation

@Dvorinka

Copy link
Copy Markdown
Owner

Summary

  • api/ handlers declaring ≤1 param now receive a Web Request; a returned Response (status, headers, streamed body) is piped back — Vercel's edge-runtime contract on Node's built-in globals
  • (req,res) handlers (arity ≥ 2) are unchanged
  • Hop-by-hop headers (host, connection, content-length, transfer-encoding) filtered before constructing the Request
  • Closes the last Vercel-estate parity gap: nothing-modes runs 14 runtime: 'edge' handlers in production

Verified live

  • GET /api/edge?q=hi → 200, {"edge":true,...,"q":"hi"}, custom x-edge-style header
  • POST /api/edge → 201, req.json() body echoed
  • (req,res) handler /api/hello unchanged; static / unchanged
  • cargo fmt, clippy -D warnings, cargo test green

Generated with Devin

api/ handlers with declared arity <= 1 now get a Web Request and their
Response piped back, matching Vercel's edge-runtime contract on Node
globals. (req,res) handlers unchanged. Verified live: custom status,
headers, Response.json, req.json() body, URL params.
@mira-tdvorak

mira-tdvorak Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Mira PR Walkthrough

Adds Web-API-style dispatch in the worker functions shim so api/ handlers that declare at most one parameter can receive a Fetch-style Request and return a Response with streamed bodies, status, and headers. Existing (req, res) handlers with arity two or greater retain the Node-style contract, while hop-by-hop headers are removed before constructing the edge-compatible request. This closes parity with Vercel edge-runtime handlers.


❌ Review failed — click for details

The code review failed to complete due to an unexpected error.

Stage: Code review
Error type: LLMError
Message: Both primary and fallback models failed


Comment @mira-tdvorak help to get the list of available commands and usage tips.

@Dvorinka
Dvorinka merged commit 0a0cfab into main Nov 19, 2026
2 checks passed
@Dvorinka
Dvorinka deleted the feat/edge-style-handlers branch November 19, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant