Generate type for loaderArgs and handlerArgs per event#540
Conversation
WalkthroughThe change refactors type alias declarations for event loaders and handlers in the generated ReScript code. It introduces intermediate type aliases ( Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
DZakh
left a comment
There was a problem hiding this comment.
I don't really like that they will be exposed in lowercase, but I think we'll be able to sort it out in v3.
|
Looks like some tests are failing. I'll help to fix them |
|
Could you guys please show an example for how the new I've fiddled with it for a while but I wasn't able to make it work. |
|
I see that they are not exposed with the |
Quick one following up from this discussion: #539
When creating a loader outside of the handler registration, using the generated types means you can't use type inference for loader return.
Eg. from Paul:
It's more ergonomic to add a type to just the args and let TS infer the return.
I've added the type for handlerArgs as well (although not sure how useful it is because you would need to define loaderReturn)
Summary by CodeRabbit