-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(platform-fastify): added compatibility for fastify version 5.x 🔥 #13990
base: master
Are you sure you want to change the base?
Conversation
277ea4b
to
581e13d
Compare
Pull Request Test Coverage Report for Build 7e0bb406-6bd1-460e-b3f8-f7d31a089897Details
💛 - Coveralls |
581e13d
to
0acb84c
Compare
Fastify v5 requires Node v20 so we will have to wait till the next major release of Nest to make the version bump. |
@johaven please open a new feature request issue for that instead. |
If it's compatible with both v4 and v5, I don't think it's necessary to wait for the next major of Nest? |
Agreed with @songkeys - since this is just expanding support to include Fastify 5, and not dropping support for earlier versions either of fastify or of node itself, it feels like it could be included in a minor version update? |
@kamilmysliwiec I guess there’s no need to wait for the next major release - if possible, it’d be great if you could go ahead and merge it. |
The thing is that: NestJS v10 is supposed to support nodejs v16. Thus, changing those semver ranges of I know that if you have Not sure how we could address this limitation(?) without a major bump on NestJS side. |
Ah - that makes sense @micalevisk. I actually ran into that issue with a different package recently so understand what you mean. One possibility for future-proofing this would be to move fastify to be a peer dependency, so that end-developers manage the version of fastify they're using directly? That sort of change would also definitely need to be done in a major version bump, though. I guess, given that, what are the possibilities of doing a major version bump for the nestjs + fastify package specifically? Or is the philosophy here that this package's version needs to stay in sync with the mainline nestjs? |
I'd like to see if we could have a major version in the works to support both Fastify v5 and Express v5, since these have both just come out recently. Due to the version ambiguity @micalevisk mentioned, I think a major version update is the way to go, FWIW. Is there ongoing work/planning for this? The packages here all leave LTS next year: it needs to happen at some point. |
In any case, Node 16 reach end of life1 year ago, and Node 18 will do the same in 6 months, so I think that release a new major release with Node 20 as breaking change is more that justified... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FastifyReply
added RouteGeneric
before the RawServer
generic (following suit of FastifyRequest
).
This needs to be accounted for in the adapter.
https://github.com/nestjs/nest/blob/master/packages/platform-fastify/adapters/fastify-adapter.ts#L131-L132
Also the path-to-regexp
v6 -> v8 is breaking the path normalization in the middleware.
https://github.com/nestjs/nest/blob/master/packages/platform-fastify/adapters/fastify-adapter.ts#L584-L600
Any progress here?... :( |
@gperdomor the support for Fastify v5 will be add in NestJS v11. There is no ETA. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Proposal:
Does this PR introduce a breaking change?
Other information
It would be nice if NestJS version 10.x was already compatible with Fastify v5.x without waiting for the next major version of NestJS, leaving compatibility with Fastify v4.x