This new major alpha release paves the way for the upcoming @fastify/[email protected]
and @fastify/[email protected]
releases.
It will also be the first @fastify/vite
release to support Vite 6. Currently this release still supports Vite 5, but support for Vite 6 is almost done and will be added to subsequent v8.0.0-alpha
releases.
Warning
The final v8.0.0
release will oficially deprecate Vite 5 support.
It will stay on the next
tag on npm until Vite 6 is released. After that, Vite 5 support will be removed and @fastify/[email protected]
and @fastify/[email protected]
will require @fastify/vite
v6.0.7
(Fastify v4) or v7.0.1
(Fastfiy v5) to run.
Caution
Do not upgrade to this release if you're using @fastify/[email protected]
or @fastify/[email protected]
or @fastify/[email protected]
.
This release is intended to support the upcoming @fastify/[email protected]
and @fastify/[email protected]
releases.
Breaking changes
This release reverses a feature introduced in v6.0.0
, namely the Readable
support in createHtmlTemplateFunction()
. The performance degradation is just too high (up to 20%), and affects the majority of users, who don't really make use of this feature.
In addition, the default definition of createHtmlTemplateFunction()
now returns a Promise
:
- const indexHtmlTemplate = config.createHtmlTemplateFunction(source)
+ const indexHtmlTemplate = await config.createHtmlTemplateFunction(source)
Revamped HTML template compiler
This releases includes a completely rewritten HTML template compiler:
- Now using
html-rewriter-wasm
for safety. - Undefined values are now printed as empty strings.
- The inner contents of
<script>
tags are safely ignored.
As mentioned before, it also drops support for Readable
streams, requiring you to handle streaming manually, which has become extremely straightforward via Readable.from()
.
Miscellaneous
Tests are now running in CI and are much faster.
Fastify v5 and Node v22 are now used in development and all examples have been updated to use them.
Biome has been replaced with Oxc for speed1.
-
Biome is still amazingly fast but Oxc manages to be faster by further skipping a few steps in formatting, which still seems like an acceptable compromise given how fast it is and the fact we don't lose any truly important diagnostics. ↩