Closed mikecann closed 3 years ago
This is likely fixed in master
: https://github.com/microsoft/TypeScript/issues/39826 .
You can install from a GitHub link and try it out - please let me know if performance is improved.
Unfortunately, it's not possible to install monorepo packages from github when using npm (there is no way to specify which directory should be installed). I've heard that Yarn 2 has a syntax for this though.
However, I think it should be possible to install the current master using one of those thanks to our CodeSandbox CI integration:
yarn add https://pkg.csb.dev/davidkpiano/xstate/commit/53d0dd5b/xstate
npm i https://pkg.csb.dev/davidkpiano/xstate/commit/53d0dd5b/xstate
FYI, it seems that strictFunctionTypes: true
massively improves the performance.
Awesome thanks @AlCalzone, im just waiting for the dust to settle in https://github.com/microsoft/TypeScript/issues/39826 before I have another go at this.
Closing this as a lot of TypeScript updates/changes have happened since this issue, and performance has improved.
Description This is a difficult one to lockdown, but I have searched the issues and surprisingly couldnt find a mention of other issues.
It seems like the typescript performance in the editor is really poor. I suspect this is to to lots of type aliasing and other complex type inferrence rules.
Theres probably not a lot that can be done about it but I thought I would open an issue anyways.
Expected Result Intellisense should be fast
Actual Result Its noticably slow even on this 6-core intel-i9 desktop PC
Reproduction
const interpreter = interpret(lightMachine);
) and then typeinterpreter
and press.
and notice the time taken for the intellisense window to open.An example video here: https://www.dropbox.com/s/jawsfq8frfop4aw/cbrJVjwwlr.mp4?dl=0
This is best case as im running on a powerful desktop PC, less powerful laptops would probably be much slower.
Additional context Latest version of XState and Typescript, tsconfig looks like: