Skip to content

feat: support Fastify replies in ServerResponse and resources - #7

Merged
3m1n3nc3 merged 2 commits into
mainfrom
feat/fastify-reply
Nov 5, 2026
Merged

3m1n3nc3 merged 2 commits into
mainfrom
feat/fastify-reply

Conversation

@3m1n3nc3

@3m1n3nc3 3m1n3nc3 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Resora can now dispatch responses straight through a Fastify reply. This is needed before arkstack can ship its Fastify driver.

  • Adds a FastifyReplyLike type. ServerResponse, Resource, ResourceCollection and GenericResource now accept a Fastify reply in .response() and withResponse().
  • ServerResponse.statusText() now reads the status text from reply.raw.
  • extractResponseFromCtx now understands clear-router's Fastify { req, reply } context.
  • clearRouterFastifyPlugin now gives the sent reply back to Fastify. Before this, every resource returned from a route logged FST_ERR_REP_ALREADY_SENT.
  • Updates the docs: the non-connect frameworks guide, the server response guide, the roadmap (Fastify is done; Next.js and NestJS stay planned) and the changelog.

Tests

  • New tests/fastify.spec.ts covers JSON output, both ctx shapes, status, headers, cookies, status text, pagination and withResponse.
  • A new plugin test checks that Fastify logs no "already sent" warning. It fails without the fix.
  • The full suite passes: 220 tests.

@3m1n3nc3 3m1n3nc3 self-assigned this Nov 5, 2026
@codecov

codecov Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@3m1n3nc3
3m1n3nc3 merged commit 07944e0 into main Nov 5, 2026
4 checks passed
@3m1n3nc3
3m1n3nc3 deleted the feat/fastify-reply branch November 5, 2026 09:46
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