-
Notifications
You must be signed in to change notification settings - Fork 209
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
[Feature] Consider splitting driver dependencies #1196
Comments
We contemplated having some filters for the driver deps in the past but were not satisfied with the mechanisms that Maven provides for defining platform-specific modules. Using Note also that we only bundle driver binaries which include node executable and relevant playwright node.js code. All browsers are downloaded separately and only include those that are required for the host platform. See this page for more information on how playwright manages browser downloads. For the time being you have to options to mitigate the proble:
|
Thanks, I am overall happy with how Playwright works. If you add the dependencies in "driver-bundle" as follows, then nothing changes for the users. "driver-bundle" is still sufficient as dependency and the new platform-specific dependencies are automatically loaded as transitive dependencies. The only difference is that now you have the possibility to exclude the unnecessary platform-specific dependencies. This would also be interesting for Node.js, where you have the possibility to use your own pre-installed version of Node.js since #1016. Especially in CI environments, where the images may already have Node.js, browser and drivers installed, this is a useful feature to save traffic and time. <project>
<parent>
<groupId>com.microsoft.playwright</groupId>
<artifactId>parent-pom</artifactId>
<version>x.y.z</version>
</parent>
<artifactId>driver-bundle</artifactId>
<dependencies>
<dependency>
<groupId>com.microsoft.playwright</groupId>
<artifactId>driver</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<!-- new platform specific stuff comes here -->
<dependency>
<groupId>com.microsoft.playwright</groupId>
<artifactId>driver-node-mac</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<!-- new platform specific stuff ends here -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
</dependencies>
</project> |
The current docker image is too large, and we only need to use chrome. |
I have multimodule project. Createed module without java code. Added playwright dependency and Added
Excluded what I do not need. Added new module to main module dependencies list. My final jar file reduced size from 200 MB to 60 MB |
The driver bundle is one big jar containing all the drivers for every supported platform. This makes it quite large, roughly 117 MB for v1.29.0.
The "driver-bundle" artifact could be changed to be only a very small artifact with runtime dependencies for each driver and platform. This would allow users to exclude drivers and platforms they don't need. For example, if someone only needs Chromium on Windows x86-64, Maven's method of excluding dependencies could be used to reduce the download size.
So, in the future, one could have a variant of "driver-bundle" that includes only the shared parts for all drivers and depends on "driver-chromium" (with shared parts for each platform), "driver-chromium-linux" (Linux parts only), and "driver-chromium-windows" (Windows parts only). "driver-chromium-linux" may also depend on "chromium-linux-x86-64" and "chromium-linux-arm64".
The text was updated successfully, but these errors were encountered: