You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :)
0 commit comments