Repository navigation
feat: add Fastify runtime driver and template - #23
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
3m1n3nc3
marked this pull request as ready for review
November 5, 2026 12:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Fastify as a third runtime next to Express and H3. This was the top item on the roadmap.
Commits
ServerDriver. The Express and H3 drivers each had their own copy of the bind address setup, the ngrok tunnel, the startup lines and theserver:starthook. That code now lives in aServerDriverbase in@arkstack/common, and each driver only implements its listen call. The ngrok dependency moves to common. The driver tests now stubServerDriver.forwardinstead of mocking@ngrok/ngrok.@arkstack/driver-fastify.auth,resora,formdata,requestLoggerandlimitermiddlewares.globalruns ononRequest,beforeonpreHandler, andafterononResponse.doneruns inside the middleware's own async context, solocaleMiddleware()still sets the locale for the handler.pluginsoption. Formbody and multipart are on by default, and static files are served with@fastify/static.createApp(). Fastify fixes a route's error handler when the route is built, and route setup is async, so setting it later missed some routes.templates/fastify.src/config/plugins.ts.boot()sets the app up only once, because parasito callsstartup()for every request.pnpm preparefor this template, and the release script bumps its version.--stackis rejected, because there's no Fastify Inertia adapter yet.docs/guide/fastify-runtime.md, plus updates to the README (Fastify listed as Beta), the roadmap, getting started, AGENTS.md and SKILL.md.Before this is ready to merge
This PR depends on two upstream fixes:
clearRouterFastifyPluginreturns the body after the reply was sent, and Fastify logsFST_ERR_REP_ALREADY_SENTon every resource response.driver-fastify/tests/router.test.tscovers this, and it's the only test that fails on this branch right now.apiResourcecrashes on startup withMethod 'POST' already declared.Once both are released, the
@resora/plugin-clear-router,resoraandclear-routercatalog versions need bumping here.Tests
pnpm lintandpnpm build:templatespass./api,/api/usersagainst the database, a DELETE through a_methodPOST, the welcome view, static files, a 404 as an Arkstack JSON error, CORS preflight, andark route:list.