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

fix: prevent crash in moduleResolution Node16+ #2230

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

jasonlyu123
Copy link
Member

#1965 #2228

Patching the releaseDocument methods of DocumentRegistry so it doesn't error. From my understanding, TypeScript doesn't use the impliedNodeFormat inside the DocumentRegistry. It'll always be treated as undefined for the svelte files. So, patching the releaseDocument part should be enough.

While we were here, I also changed to reuse the documentRegistry across language services. It should reduce some memory usage for files reused across language services. While checking if we can optimize the restart as well, I found that TypesScript added the support for scriptKind changes three years ago. So we no longer need to restart it because of scriptKind changes.

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great findings, thank you!

@dummdidumm dummdidumm merged commit bc82064 into sveltejs:master Dec 13, 2023
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants