Skip to content
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

Using RootAction makes TypeScript compilation and vscode intellisense extremly slow #246

Open
zdila opened this issue Dec 5, 2020 · 1 comment

Comments

@zdila
Copy link

zdila commented Dec 5, 2020

Description

If we use in our application RootAction as is recommended in the documentation, then TS compilatin is extremly slow and intellisense in VS Code becomes near-unuseable.

import { ActionType } from 'typesafe-actions';

export type RootAction = ActionType<typeof actions>;

It is reproducible with the project https://github.com/FreemapSlovakia/freemap-v3-react (just clone it and do npm i && DEPLOYMENT=www time ./node_modules/.bin/webpack, but currently it has a workaround you can see below).

A workaround is to replace the above code with this:

import { Action } from 'typesafe-actions';

export type RootAction = Action;

The workaround reduces compilation time from 5:40 to 0:35 and makes vscode intellisense fast.

@zdila zdila changed the title Using RootAction makes TypeScript intellisense and compilatiion extremly slow Using RootAction makes TypeScript compilation and vscode intellisense extremly slow Dec 5, 2020
@thedillonb
Copy link

We are also hitting this. We have approximately 220 actions and have noticed that complication times are pretty extreme when compiling. Unfortunately, I don't think this really has anything to do with typesave-actions. https://github.com/microsoft/TypeScript/wiki/Performance#preferring-base-types-over-unions is probably describing the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants