Open yusukebe opened 6 months ago
Hey @kosei28 What do you think about it?
This is exactly what I wanted!
However, merging this may cause type errors in many projects currently using Hono's RPC, so I think this should be considered carefully.
@kosei28 Thanks for the comment!
However, merging this may cause type errors in many projects currently using Hono's RPC, so I think this should be considered carefully.
Exactly. We don't have to hurry!
I think res should always include some sort of unknown response anyway, any route could return 500 if it throws an error or 502/504 if there's a proxy in the way, and even if middleware responses were included there's still throw new HTTPException
which can't be picked up by typescript.
Hey guys any timeline on this? currently i have a authentication middleware but without this feature I am having to authenticate at every request to get typings correctly. Any work around that you can suggest will also be fine.
What is the feature you are proposing?
Currently, the RPC mode does not support middleware response. The client can't handle the response from the middleware:
I'm not 100% sure, but perhaps we can implement it by modifying
types.ts
:It will be worth implementing, though the code will be very long.