Controllers should show type errors if a plugin is installed without the correct context. #1554
Replies: 1 comment 1 reply
-
|
I think the issue comes from how Elysia’s plugin typing works today. Right now, a plugin can add fields to the context ( In this case, So even though grammY relies on
TypeScript has no way to enforce this because Elysia doesn’t expose a “required decorator” or “plugin dependency contract”. In short:
If Elysia eventually supports a type signature like:
or a similar dependency annotation, then TypeScript could catch this at compile time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following controller.
grammyrelies on theenvfield within theContext.However, if I were to remove
decorate,TypeScript knows that
grammYrelies on aenvdecorator, so why can't Elysia use this information to check if the controller, at the point of installation, has the field installed?Beta Was this translation helpful? Give feedback.
All reactions