Comments (7)
I think that creating the verb helpers could be done inside Nest if you really need them.
This is probably the best solution in the meantime.
In my view, Nest's Fastify adapter should call methods from fastify.route
rather than from the instance to ensure that the call is made on a method rather than a user decorator.
If there are no other comments I will close this discussion.
from fastify.
Moving my comment here:
Per @climba03003's comment: #4409 (review)
Backporting these shorthands could conflict with decorated properties of current users, making this breaking
from fastify.
Is there currently a system to prevent http methods from being used as decorators?
We could implement a way to warn the user that he will not be able to use a method name as a decorator in the next version.
In the current version we could check the name of the decorator used, display a warning and prioritize the execution of the user decorator rather than the method to avoid any break.
Just an idea :)
Even if V5 was released tomorrow, I think the NestJs team will take some time before integrating this version into their framework.
I'm just trying to find a solution to prevent the community from waiting a few more years just for some rather standard methods (which are very useful to us in our tools and applications).
from fastify.
Is there currently a system to prevent http methods from being used as decorators?
It just throws, as an example you can try: fastify.decorate('head', () => {})
, it should throw
I'm just trying to find a solution to prevent the community from waiting a few more years
I (and others) really want v5
to be released as soon as possible and we will be pushing for it, right now I just know that most maintainers are busy as node 22 (next LTS) is about to be released, so there is focus on getting as much stuff in it as possible
How about making decorated webdav methods an option (turned off by default in v4
)
I would fully support that actually
from fastify.
You are not block from using those methods by fastify.route
.
It is not necessary for the shorthands method exist before using.
from fastify.
I think that creating the verb helpers could be done inside Nest if you really need them.
Generically this is not needed, because you can always use .route()
. If you can't, it's on Nest.
from fastify.
Indeed the problem is that Nest uses the instance followed by the method to handle the requests in their adapter: https://github.com/nestjs/nest/blob/727032e46e2371a934a1a99ec42634fabd271738/packages/platform-fastify/adapters/fastify-adapter.ts#L705
from fastify.
Related Issues (20)
- `disableRequestLogging` should disable logs in default error handler HOT 6
- incorrect plugin identified for timeout HOT 1
- OPTIONS HTTP method body processing HOT 3
- Dependency update for v5 HOT 1
- Merge main into next HOT 4
- Scoped FastifyRequest Customization via Generic Parameter in FastifyInstance HOT 1
- Flaky test on N|Solid 20 MacOS HOT 2
- Implement simple B-Tree for faster string comparisons HOT 6
- Throwing error in setErrorHandler after a JSON parse SyntaxError causes app to crash
- Where is the documentation for <Reply>.sendFile? HOT 2
- Switch to ajv/2020 for fastify 5 HOT 7
- Fastify v5 coordination HOT 6
- Does Validation-and-Serialization document's outdated?
- Should we drop Node.js v18 for v5? HOT 11
- `disableErrorLogging` option HOT 1
- Request hangs if you `await reply.status` in an async handler. HOT 15
- querystring with property of type number fails HOT 7
- onError hook is called before errorHandler when error is thrown in onRequest hook HOT 6
- Approval Request for Future State Proposal HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastify.