Switch from namespace syntax to declare module syntax#33
Switch from namespace syntax to declare module syntax#33abcd-ca wants to merge 2 commits intodbeckwith:masterfrom
namespace syntax to declare module syntax#33Conversation
Vite (https://vitejs.dev/) is not able to handle that syntax for some reason
namespace syntax to declare module syntax
|
Hi, let me know what you think; I can fix the tests and maybe the lint step if that's my change that the Lint check is complaining about |
|
I'd like to understand a little more about the problem you were having with Vite and exactly why this solves it. Until I understand that problem I'm hesitant to make this change as I don't see what real advantages this approach has. Semantically, the types being generated by this library do not describe an actual JavaScript module, as the use of Another thing it sounded like you wanted to change was the ergonomics of importing types: |
The
namespacessyntax was causing Vite to fail to compile. I changed the emitter to generatedeclare modulesyntax instead and now Vite is happy. The import syntax in my Typescript app that consumes the generated types look nicer now too.Generated backendTypes.d.ts before:
Import syntax before:
Generated backendTypes.d.ts after:
Import syntax before: