inad9300/Soil

DeepPartial is slow

Closed this issue · 4 comments

I know there is no proper workaround - we have to wait for TypeScript 2.8, but still I think that DeepPartial is extremely slow. I have for now changed it to:

export type DeepPartial<T> = {} | T

which kind of works, but does not throw on non existing properties...

I have also found some slowness when dealing with big files full of types in VS Code, but haven't associated it to DeepPartial though. When exactly have you find things to be slow?

Hopefully soon we will see if upgrading to TypeScript 2.8 helps :)

Well I use Monaco

https://microsoft.github.io/monaco-editor/

and there with DeepPartial, the intellisense takes up to 3 seconds and without it, the intellisense is instantaneous. Could be something in Typescript language service? I think VS Code uses Typescript server protocol instead.

Definitely something to follow up, as code completion is a big part of what makes having type definitions valuable.

The current published version of the project does no longer require a deep partial type. Since I'm generating dedicated interfaces adjusted for element creation, I define all their properties as optional at the source. Auto-completion feels instant now :)