fix(installer): retain browsers installed via Playwrigth CLI #5904
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.
Suggestion cannot be applied right now. Please check back later.
Browser registry is responsible for 3 things:
Currently, registry relies on a single "download" field in
browsers.jsonto carry both (1) and (2). However, browsers in (3) are marked as
download: falseso that they aren't installed automatically in (2), soauto-remove procedure in (1) removes them on subsequent installation.
One possible approach to fix this would be modifying package's
browsers.jsontochange
download: falsetotruewhen browsers are installed withPlaywright CLI. This approach was explored here:
bc04a51
We decided against this since we have a history of issues related to
package modifications after NPM installation. This breaks all
sorts of yarn/npm caching mechanisms.
Instead, this patch is a two-step refactor:
browsers.json. Now, all registries(including old ones from previously-released versions) will retain any
browsers that are mentioned in the
browsers.json.installation.
With this change, the registry tasks are done like this:
otherwise it is removed from registry
installByDefaultto carry default installationseverythings that's referenced in (1), browsers aren't removed.
Fixes #5902