elysiajs / elysia

Ergonomic Framework for Humans
https://elysiajs.com
MIT License
10.25k stars 219 forks source link

EdenTreaty seems to work only with chained calls #147

Closed aureliendepeyrelongue closed 1 year ago

aureliendepeyrelongue commented 1 year ago

Hello, thank you for your work !

I really like the eden treaty feature but i found something strange. When we are not directly chaining Elysia handlers mapping, errors seem to occur with the eden treaty configuration. As if the type inference did not work properly. Maybe i am missing something !

Thanks for your work.

Capture d’écran 2023-09-14 à 11 59 05 Capture d’écran 2023-09-14 à 11 59 38 Capture d’écran 2023-09-14 à 12 00 04
JoeHillyard commented 1 year ago

This is expected under the design pattern implemented as mentioned here. I am still new to Elysia but I don't see this a major issue with this until you need to extract handlers into separate files at which point I believe you can leverage plugins.

Someone else with more experience with the framework may be able to provide more information

aureliendepeyrelongue commented 1 year ago

Thank you @JoeHillyard for your answer, you are right, and yes it works well with plugins !

SaltyAom commented 1 year ago

Since the issue seems to have been solved, and there is no further communication, I'm closing the issue.

Feels free to reopen this issue if the problem stills persists.