wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
12.75k stars 1.14k forks source link

Revisit types exported from the SDK #2020

Open sodic opened 1 month ago

sodic commented 1 month ago

Item 47 of Effective Typescript says "Export all types that appear in public APIs. The reasoning is solid and goes something like this:

Users will eventually want to reference a type your library uses (e.g., it's part of a function's type signature) only to find out it isn't exported. Since TypeScript has many powerful utility types, they'll find a way to extract and use it anyway (e.g., with ReturnType, Parameters, typeof, etc.).

If a type appears in a public function declaration, it's effectively exported. Therefore, you should do your users a favor and just export them explicitly.

Our SDK doesn't currently do this, so let's make it happen :)