playwright/src
Andrey Lushnikov 2064d27dc6
fix(installer): retain browsers installed via Playwrigth CLI (#5904)
Browser registry is responsible for 3 things:
1. Remove downloaded browsers if there are no packages that refer to them
2. Install default browsers needed for the current package
3. Install browsers on-demand when used through Playwright CLI

Currently, registry relies on a single "download" field in `browsers.json`
to carry both (1) and (2). However, browsers in (3) are marked as
`download: false` so that they aren't installed automatically in (2), so
auto-remove procedure in (1) removes them on subsequent installation.

One possible approach to fix this would be modifying package's `browsers.json` to
change `download: false` to `true` when browsers are installed with
Playwright CLI. This approach was explored here:
bc04a51800

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:
- remove the "download" field in `browsers.json`. Now, all registries
(including old ones from previously-released versions) will retain any
browsers that are mentioned in the `browsers.json`.
- add a new flag "installByDefault", that is **only used** for default
installation.

With this change, the registry tasks are done like this:
- (1) auto-removal: if browser has a back reference, it is retained,
otherwise it is removed from registry
- (2) default installation: use only `installByDefault` to carry default installations
- (3) CLI installation: simply installs browsers. Since we retain
everythings that's referenced in (1), browsers aren't removed.

Fixes #5902
2021-03-22 11:43:29 -07:00
..
cli chore: add missing await to floating promises (#5813) 2021-03-22 09:59:39 -07:00
client chore: add missing await to floating promises (#5813) 2021-03-22 09:59:39 -07:00
common chore: pass parsed stack in metainfo (#5407) 2021-02-10 18:52:28 -08:00
dispatchers chore: add missing await to floating promises (#5813) 2021-03-22 09:59:39 -07:00
install fix(installer): retain browsers installed via Playwrigth CLI (#5904) 2021-03-22 11:43:29 -07:00
protocol infra(channel): wire release channel to all tests (#5820) 2021-03-15 08:07:57 -07:00
remote chore: add missing await to floating promises (#5813) 2021-03-22 09:59:39 -07:00
server chore: add missing await to floating promises (#5813) 2021-03-22 09:59:39 -07:00
third_party/highlightjs feat(java): implement codegen (#5692) 2021-03-03 14:32:09 -08:00
utils fix(installer): retain browsers installed via Playwrigth CLI (#5904) 2021-03-22 11:43:29 -07:00
web chore: unify recorder & tracer uis (#5791) 2021-03-11 11:22:59 -08:00
.eslintrc.js chore(lint): add @typescript-eslint/type-annotation-spacing rule (#897) 2020-02-07 13:36:49 -08:00
browserServerImpl.ts feat(inspector): pause on page/context close (#5319) 2021-02-19 09:33:24 -08:00
inprocess.ts chore: centralize playwright creation, bind context listeners to instance (#5217) 2021-01-29 16:00:56 -08:00
nativeDeps.ts chore: organize per-browser dependencies (#5787) 2021-03-11 20:22:50 -08:00
outofprocess.ts test: add basic end-to-end driver test (#5426) 2021-02-12 09:05:32 -08:00
service.ts chore: add websocket connection mode (#4510) 2020-11-20 15:19:39 -08:00