Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add verbatim type specifier to export from statements (#2310)
### 🎯 Goal If we want the codebase to be compilable by tools like Vite, that use esbuild under the hood to process files one-by-one, we should follow the rules for isolated typescript modules. Previously we were breaking the isolated modules rule by doing re-exports like this one: ```ts export { DefaultStreamChatGenerics, ChannelUnreadUiState } from './types'; ``` Where both `DefaultStreamChatGenerics` and `ChannelUnreadUiState` are types. When processing a single file, the compiler doesn't know if these are types or not, and leaves the export statement as is, when really it should be removed. Fixing this by using verbatim module syntax: ```ts export type { DefaultStreamChatGenerics, ChannelUnreadUiState } from './types'; ``` After fixing all issues, `isolatedModules` was enabled in tsconfig. A good side-effect of this change is that Ladle (which uses Vite internally) now works again, which is crucial for e2e tests :)
- Loading branch information