-
-
Notifications
You must be signed in to change notification settings - Fork 204
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 auto import with svelte-google-materialdesign-icons #2244
Comments
The reason for this is because of this monster package.json exports: It's over 8000 lines. TypeScript spends a ton of time comparing the path of the dts files to the subpath export. Even though a single comparison is cheap, it is looped n x n times. Although TypeScript can definitely optimize to reduce the loop count. But this feels like an edge case. Normally, the With auto-import cache (#2237 or #2242), this should be at least usable. But it'll still take a huge amount of time for the first time and after the cache has been invalidated. Another thing is during the parser error stage. All completion is global completion with no token to filter auto-import. So the time it takes is usually way higher than in the ts file. |
Save issue here with Tabler Icons Svelte, maybe for the same reason: big export in package.json file of that library. I can't figure out how to solve it browsing linked issue. Can you provide the fix here? |
I am closing this since there is not much we can do. This needs to be fixed in TypeScript. Or the libraries should remove the thousands of lines of export map. I still haven't heard a reason as to why this is needed so I also don't know how to explain it when opening an upstream issue. If library authors have Svelte-specific reasons why this is required, feel free to comment here. Otherwise, please file an issue in TypeScript. |
A solution to these monster export maps is using star imports: "./*.svelte": {
"types": "./dist/*.svelte.d.ts",
"svelte": "./dist/*.svelte.ts"
} |
can you further elaborate this? for what did you make that work? |
This is something the library itself needs to do, so it's not under your control as a consumer. |
Originally posted by @MiraiSubject in #1984 (comment)
The text was updated successfully, but these errors were encountered: