Closed galvez closed 6 months ago
Name | Link |
---|---|
Latest commit | 4bb1ada5cfdf43c1ada9a9de274e0f3e82227651 |
Latest deploy log | https://app.netlify.com/sites/agitated-mahavira-26f8f9/deploys/65d2f574d157f40008119021 |
Deploy Preview | https://deploy-preview-135--agitated-mahavira-26f8f9.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
This is the sixth major release of
@fastify/vite
.It has important changes that required the introduction of a couple of breaking changes, thus the new major release.
New features
Type definitions have been comprehensively expanded, hat off to @Gehbt.
reply.html()
function, returned bycreateHtmlTemplateFunction()
, now always returns aReadable
. And any parameter passed to it can also be aReadable
. In addition, placeholders now also support the dot notation, and receiveapp
(the Fastify plugin scope),req
,reply
,client
androute
as part of their default context in the defaultcreateRouteHandler()
definition . For the followingindex.html
:The following
reply.html()
call should work:If no
createRenderFunction
function is provided,createRouteHandler()
will now by default call the route module'sdefault
export, as follows:The plugin's config object now has two injected readonly properties:
hasRenderFunction
indicates whether orcreateRenderFunction
was provided.ssrManifest
contains the parsed JSON from thessr-manifest.json
file (production only).Breaking changes
The default call signature of
reply.render()
increateRouteHandler()
changed as follows:The default call signature of
createRouteHandler()
andcreateErrorHandler()
have changed as follows:In both cases,
route
is a reference to the route module, andclient
is a reference to the client module.Fixes
fix: explicitly export named type by @MrBazlow
fix: replaced target from main tag to div with id "root" for semantic HTML by @SvMak
Many thanks to the contributors!
Miscellaneous
Node v20+ is now used in development.
Vitest has been replaced with Node's native test runner.
ESLint has been replaced with Biome for speed[^1].
[^1]: Biome is lacking a formatting option that makes it not fully StandardJS-compliant, but it's an acceptable compromise since it was possible to remove several ESLint plugins from the dependencies and still have superior performance.