New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow typescript compile time #217
Comments
I have the same issue with a project about the same size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I work on a typescript react redux app using typesafe-actions. Recently, compiling / typechecking takes a lot of time (around 180s) (the app also requires more memory recently >8GB, but we fixed this using craco, and is not a problem anymore). The main section that I identified that takes a lot of time is the
ActionType<typeof RootAction>
(commenting this line will generate errors, but will reduce the compile time to ~10s).The problem seems to be when infering all action types on the RootAction, it seems to be an union of all types from all actions.
The codebase has:
The setup is as follows:
Action:
Epic:
Reducer:
Reducers are merged using
combineReducer
, except from this is when merging reducers into RootReducer, where the setup is as follows (this might not be the best approach, but AFAIK this shouldn't be the main problem ):Action / State types:
My solution would be to remove typechecking with RootAction and add the types by hand for each
.handleAction
, but this is a workaround, not a fix. Do you have any ideas what how to fix that long compilation time on RootAction?The text was updated successfully, but these errors were encountered: