Skip to content

Fastify update - #79

Merged
gianlazz merged 223 commits into
mainfrom
fastify-update
May 26, 2026
Merged

gianlazz merged 223 commits into
mainfrom
fastify-update

Conversation

@gianlazz

@gianlazz gianlazz commented May 26, 2026 •

Copy link
Copy Markdown
Member

This Fastify migration has yielded nearly a 2x throughput increase and almost halfed the latency.

Before

--- Load Test Results ---
Requests/sec: 1188.10
Latency avg:  7.90 ms
Latency p50:  7.00 ms
Latency p99:  18.00 ms
Throughput:   26.39 MB/sec
-------------------------

After

--- Load Test Results ---
Requests/sec: 2091.64
Latency avg:  4.24 ms
Latency p50:  4.00 ms
Latency p99:  11.00 ms
Throughput:   44.30 MB/sec
-------------------------

gianlazz and others added 28 commits February 19, 2026 16:54
…loading current URL

Immediate reload on 'controlling' caused a black screen on long-lived
htmx-boosted pages. The new SW takes control mid-session before it can
serve in-flight requests, resulting in a blank response.

Instead, set a flag when the SW update takes control and defer the
transition to the user's next boosted htmx GET navigation. The htmx XHR
is cancelled via event.preventDefault() and replaced with a full page
navigation to the intended destination. Checks for boosted=true to avoid
intercepting partial hx-get requests (polls, lazy loads, filters) which
would otherwise navigate the full page to a fragment URL.
…s sdk v3 with aws-sdk/lib-storage upload class for handling chunked streaming uploads
* autocannon load testing

* tsconfig exclude scripts folder

* path fixes
* fastify first cut

* delete pwa.spec

* commonjs module resolution for fastify res.view method declaration, to align closer with official docs

* fix pipeline, update documentation

* rolled back wildcard pattern change

* Added back documentation comments in main.ts

* fixed auth redirects by manually setting value to 302

* formatting

* req.hostname -> back to req.host

* refactor: replace view-context interceptor with fastify reply.locals preHandler hook

Replace the NestJS ViewContextInterceptor with a Fastify preHandler hook that
populates reply.locals, matching the Express res.locals pattern. This provides
uniform request-scoped context to all views (@Render and reply.view alike)
without controller-level boilerplate.

- Add preHandler hook in main.ts to build context once per request
- Delete ViewContextInterceptor and remove APP_INTERCEPTOR registration
- Update manual reply.view() calls in AuthController to spread reply.locals
- Remove ViewContextService dependency from AuthController
- Update ErrorViewFilter to read reply.locals directly with fallback
- Fix req.hostname -> req.host for correct port-inclusive URLs

* commenting express like res.locals equivalent for fastify

* envs and loopback trusting

* drain streams before mimetype error

* normalized baseUrl variable in locals viewcontext

* pinned playwrite action node version and gitignore autocannon results
- added node_modules/sortablejs to static assets
@gianlazz
gianlazz merged commit 03b1338 into main May 26, 2026
2 checks passed
@gianlazz
gianlazz deleted the fastify-update branch June 11, 2026 04:42
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