-
Notifications
You must be signed in to change notification settings - Fork 42
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
Improve imports/deps to use playwright-core transitively and Improve Example naming #158
Conversation
This patch aims to help reduce the number of deps a user's suite would need by: 1. Making playwright-core a transitive dep 2. Using the `Page` object from `playwright-core` instead of `playwright-chromium` which is more correct 3. Updating the todos example `package.json` to no longer reference `playwright` as a dep, but only `synthetics`, from which playwright deps come transitively
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewvc I am not 100% sure if i understand the PR,
We are using the page object from playwright-core
for typings
synthetics/examples/todos/helpers.ts
Line 4 in 0851cb0
import { Page } from 'playwright-core'; |
playwright-core
does not install any browser stuff, So we can still keep it as its harmless (not attempting to replace any global browser packages) and remove it from our package.json
as its unnecessary module.
@vigneshshanmugam The idea here is to let users have as minimal a Today, the todos folder has its own package.json that explicitly declares If we ask users to specify an |
@@ -40,6 +40,7 @@ | |||
"commander": "^6.0.0", | |||
"http-proxy": "^1.18.1", | |||
"kleur": "^4.1.1", | |||
"playwright-core": "=1.6.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct, the examples works as node_modules are traversed from local -> parent -> root directory.
We can get rid of playwright-core
deps totally and just not use any deps in the example. We are just importing them for making intensense work.
Lets change this to
synthetics/examples/todos/helpers.ts
Line 4 in 73699e0
import { Page } from 'playwright-core'; |
import { Page } from "playwright-chromium"
if we need auto completion or we can even get rid of those and keep the example minimal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vigneshshanmugam well, intellisense working is an important feature. We should discourage users in our examples from using playwright-chromium
because that's not correct for multi-browser support (and confusing).
Additionally, one of the problems with our examples folder is the traversal to the root directory. Users will use the todos
example in their projects, so everything in the todos
folder should work even if it's removed from the context of our synthetics
parent project. In fact, I've been thinking it'd be much better if we could make todos
a sibling folder instead of a subfolder for this very reason.
@andrewvc playwright-core does not install or download any browser versions so we shouldn't even need that in the first place and the versions will not go out of sync. This change feels unnecessary to me, just changing the |
Closing in favor of #239 |
This patch aims to help reduce the number of deps a user's suite would need by:
Page
object fromplaywright-core
instead ofplaywright-chromium
which is more correctpackage.json
to no longer referenceplaywright
as a dep, but onlysynthetics
, from which playwright depscome transitively
This is a prereq for improving the docs for elastic/observability-docs#284