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

[🚀 Feature]: Create separate NPM for Selenium Manager #11378

Open
titusfortner opened this issue Dec 7, 2022 · 16 comments
Open

[🚀 Feature]: Create separate NPM for Selenium Manager #11378

titusfortner opened this issue Dec 7, 2022 · 16 comments

Comments

@titusfortner
Copy link
Member

Feature and motivation

Unlike the other bindings, there are various JavaScript projects (like webdriver.io) that can benefit from Selenium Manager being released as a separate package. @harsha509 mentioned it shouldn't be too challenging to figure out how to build it with Bazel. @christian-bromann might be able to provide feedback on requirements for this.

Usage example

n/a

@christian-bromann
Copy link
Contributor

Ideally it would be great if Selenium Manager could package a WASM file and publish it to NPM with a minimal JS interface to run the features of the manager, e.g. install driver etc. I recently was working on a project with similar requirements. Happy to provide support if needed.

@titusfortner
Copy link
Member Author

Would that require putting the Rust code in the package?

@christian-bromann
Copy link
Contributor

Would that require putting the Rust code in the package?

No. I recommend have a prepare script in the package.json that automatically downloads the latest Selenium Manager release with the WASM file included. You can go all fancy and pin NPM release versions to the Selenium Manager release version and have auto-releases. Anyway the code for such NPM package can live totally independent of the original source.

@diemol
Copy link
Member

diemol commented Jun 9, 2023

This assumes that we are going to make Selenium Manager releases, which I would like to. But so far we do not have consensus of that. Are we actually going to make releases or not?

@titusfortner
Copy link
Member Author

If supporting wdio is the primary argument in favor of independent release right now, I'd prefer finding an alternate way to support/distribute, at least until we have full functionality.

Also, this isn't just one binary, but 3 because of different architectures, not sure how that works with npm.

@diemol
Copy link
Member

diemol commented Jun 9, 2023

We have two use cases now, WebdriverIO and Docker images setup.

@christian-bromann
Copy link
Contributor

Also, this isn't just one binary, but 3 because of different architectures, not sure how that works with npm.

It does, example case: https://github.com/webdriverio-community/node-geckodriver - the package downloads the binary from Github when the user uses the driver for the first time. Something similar could be done for an NPM package for Selenium Manager.

@titusfortner
Copy link
Member Author

Docker case is more an optimization(?) than new functionality.

  1. We need an API we can agree to maintain backwards compatible if we release independently. What we have now isn't what we want, and I'm not sure we'll know for sure what we want until browser downloads are implemented.
  2. User confusion. I feel like we're just starting to make progress here 😂
  3. It seems like there are alternatives to separate downloads that are sufficient for now?

@diemol
Copy link
Member

diemol commented Jun 9, 2023

The Docker case is just to use the functionality that already exists in Selenium Manager

@titusfortner
Copy link
Member Author

As I understand it, the Docker use case is to be able to load it as part of the Docker RUN command instead of the first time a session is requested by the entrypoint. There's no missing functionality right now with this scenario; Selenium Manager will just execute the first session request, it's just an optimization to start it at the beginning.

@diemol
Copy link
Member

diemol commented Jun 9, 2023

Ok, yes. Optimization.

@titusfortner
Copy link
Member Author

But along those lines. Maybe we can document how people could execute selenium manager code to cache drivers without starting drivers? Not a use case I'd considered.

@titusfortner
Copy link
Member Author

That last comment would be much more easily done when we implement — #13022

@titusfortner
Copy link
Member Author

I recommend have a prepare script in the package.json

@christian-bromann this is for a new "Selenium Manager" npm? If we release as part of Selenium, we can build / grab it dynamically without needing to have official releases. Can you provide an example file for what we need so we can figure out what it would take to release multiple npm packages with Bazel. (Simon is moving to updated rules which should make that easier)

@christian-bromann
Copy link
Contributor

I recommend a simple wrapper module that downloads the binary if used the first time. See this example of the Geckodriver package. You can also include the binary to the NPM package but it feels like an unnecessary extra payload. I personally prefer NPM packages to be as small as possible.

@diemol
Copy link
Member

diemol commented May 16, 2024

During the May 2024 Selenium Summit, we made the decision to implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Low
Development

No branches or pull requests

3 participants