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

Watch Mode: Do we really need full config file read and update on package json change #48315

Closed
sheetalkamat opened this issue Mar 17, 2022 · 4 comments · Fixed by #48866
Closed
Assignees
Labels
Needs Investigation This issue needs a team member to investigate its status.

Comments

@sheetalkamat
Copy link
Member

This seems incorrect.. Full Reload means read config file again to calculate file names.. Why do we need to do that for package.json changes.
Also changesAffectResolution seems very unoptimized way of saying resolve all modules again. Need smarter way to invalidate resolutions.. Esp when someone is not using the node12+ stuff.. looks like every npm install will be problematic? (it many times spans across multiple updates if its many packages)

Originally posted by @sheetalkamat in #44935 (comment)

@weswigham
Copy link
Member

To restate what I said in the other thread for anyone who comes to this issue: none of the package.json watch logic is dependent on node12 - some might be flaggable to any node-like mode though, though. Likewise, some may still need to be unconditional (with respect to module resolution) due to @types (and triple-slash types references) always using node module modes, detecting and distinguishing these cases is potentially a bit involved.

@sheetalkamat
Copy link
Member Author

It still does not need config file read which is what ConfigFileProgramReloadLevel.Full does. It just needs normal program update.. Change in package.hson is not going to affect what files are root file names and options.?

Even though package.json change did affect before the node12 , normally package.json is replaced by npm install. Our module resolution failed lookup watches covered those scenarios (more or less) as most of the time it meant change in files as well..
Even though it was not perfect it was practical since not reusing resolution is costly and practically it didnt pose the problem.

@weswigham
Copy link
Member

Change in package.hson is not going to affect what files are root file names and options.?

Ahhh, probably not, yeah. At least I don't think any package settings will affect the root files calculated by build, just because build seems to ignore the types option and files pulled in from node_modules. Is there a reload level that corresponds with needing to do a full rebuild without recalculating the file list though? Afaik the two were tied together (and, moreover, the root file calculation is, intentionally, incredibly cheap in build mode).

@sheetalkamat
Copy link
Member Author

not setting config file reload is equivalent to creating new program with updated things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants