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
[WIP] Persist resolutions and program information and reuse it when building program incrementally or during editor #41004
Draft
sheetalkamat
wants to merge
49
commits into
main
Choose a base branch
from
persistentResolutions
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+217,666
−422
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cb79ae2
to
36d89be
Compare
2f726c1
to
18035fa
Compare
18035fa
to
d05151a
Compare
aa893c3
to
7e761cd
Compare
073ed19
to
fb609c0
Compare
12ca63c
to
abe3b73
Compare
a0e33af
to
7c202bd
Compare
|
This is a really interesting idea. What sorts of speed-ups/memory reduction savings have you seen on larger projects? |
…d to a file This ensure --watch and editor behaviour matches with what happens without watch and there is no confusion as well as we are not watching unnecessary things
… enabling persistResolutions)
…ect reference files in the program so editor can use correct program
95eeb32
to
f0db440
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Author: Team
Experiment
A fork with an experimental idea which might not make it into master
For Uncommitted Bug
PR for untriaged, rejected, closed or missing bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.


This PR adds option
persistResolutionswhich perists the program and resolutions information into the tsbuildinfo file. This option is meant to also mean that if module is resolved to file, dont watch any of the failed lookup locations for those, and always use that file as resolved file unless that file is deleted. The unresolved modules are still resolved again to see if it can be resolved at time of program creation.This also adds option
cleanPersistedProgramto remove the persisted program information (without loosing incremental build information) which helps in creating program as if this option was not enabled. So if user changes location of where the resolution needs to be, they can use this option.The main changes are:
oldProgramasProgramFromBuildInfowhich is built from program information saved in tsbuildinfo. The stored information is partial information needed to make decisions about whether program structure can be completely reused or only module resolutions can be safely used or cannot reuse at all.persistResolutionsis true. Need to be stored with and without--outoption.oldProgramdiffer inuseSourceOfProjectReferenceRedirect, then structure cannot be reused and in case ofpersistentResolutionit means module resolution can be reused.Questions to answer :
persistResolutionsok. Given we do need to store more information than just resolutions but resolutions are the main things that determine the behavior of if they should be retained or not.cleanPersistedProgramnow useful. It was in the start because when i was experimenting , module name resolution whether failed or succeeded would be re-used so if you did npm install, you would want to run this command to clean up. Now that we still resolve failed lookups or if resolved file is deleted, things should flow more smoothly and just deleting tsbuildinfo file should be ok in that rare case.. The new behaviour works better with editing experience.cleanPersistedProgramoption. Will it be intuitive?cleanPersistedProgramoption to be run and then restart the tsserver to handle the the project updates?