Skip to content

feat: Inertia and lean profile support for Fastify - #26

Merged
3m1n3nc3 merged 5 commits into
mainfrom
feat/fastify-follow-ups
Nov 5, 2026
Merged

3m1n3nc3 merged 5 commits into
mainfrom
feat/fastify-follow-ups

Conversation

@3m1n3nc3

@3m1n3nc3 3m1n3nc3 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-ups to #23 that bring Fastify level with Express and H3.

Inertia

  • @arkstack/driver-fastify/middlewares exports inertia(). It runs the rest of the request inside Inertia's context and upgrades 302 redirects to 303 for Inertia PUT, PATCH and DELETE visits.
  • create-arkstack no longer blocks Inertia for the Fastify template. Its existing setup step wires the middleware and the root route without changes.

Lean profile

  • Lean Fastify projects crashed on start. The template built its CORS options in the Application constructor, before the env global exists. Plugin options can now be a function that Fastify calls when it loads the plugin, and the template uses that.
  • The Fastify router skips route files that don't exist, so lean projects no longer log an error about the missing api.ts. A file that fails to load is still logged.
  • The template's middleware config now type-checks (req was implicitly any).

Docs

  • Fastify is marked Stable.
  • The Inertia guide has a Fastify tab, and the Fastify guide no longer says Inertia is unavailable.
  • The getting-started guide, the API page and the roadmap described express-lean and h3-lean as template aliases, but those aliases were removed. They now describe lean and full as profiles of every template, chosen at the prompt or with --lean or --full.

Testing

  • packages/driver-fastify: 44 tests pass, including new ones for the Inertia middleware, function plugin options and missing or broken route files.
  • create-arkstack and packages/inertia tests pass, and lint is clean.
  • I built and started a lean Fastify project made with makeLeanProfile. It serves / and answers CORS preflights with the configured origin.
  • I scaffolded a full Fastify project with applyInertia(…, 'vue'), built it and started it. / returns the Inertia page object for X-Inertia requests and the HTML document otherwise.

The template built its CORS options in the Application constructor, before
the env global exists, so lean projects crashed on start. Plugin options can
now be a function, and the template's middleware config type-checks.
Lean projects have no api routes, so a missing file is no longer logged as an error.
@codecov

codecov Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/driver-fastify/src/middlewares/inertia.ts 88.23% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@3m1n3nc3
3m1n3nc3 merged commit a019900 into main Nov 5, 2026
4 checks passed
@3m1n3nc3
3m1n3nc3 deleted the feat/fastify-follow-ups branch November 5, 2026 13:09
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