xk6-browser
xk6-browser copied to clipboard
Type definitions
Any plans to get type definitions for xk6?
Thanks, Diogo
Hi Diogo, thanks for opening this issue.
There are currently no plans to add type definitions for xk6-browser, but the team is definitely interested in adding them in the future. Note that these would be only for xk6-browser; other k6 JS extensions would have to add their own.
There are a couple of points worth discussing before tackling this:
-
Currently the extension is very much in early beta stages, and the JS API will change a lot in the upcoming months. For example, we now have the capability of using event loops in extensions, so the API will be transitioning to and using more async functionality. Having to update type definitions manually everytime the API changes is a lot of work for both maintainers and users. It might make more sense to have type definitions once the API is more stable.
-
We are having some internal discussions of going a different route and using an LSP server for both k6 and any popular extensions. This would have more benefits than just type definitions, but it's also a much larger project that we haven't even begun scoping out.
We'll discuss these topics internally over the upcoming weeks and will update this issue once we have more information to share.
When this is going to be done?
I think k6 needs to make an exception for xk6-browser extension as the web browser testing is what makes k6 stands out from the others. If you need to maintain type definitions for on-going changes, it's worth making the efforts because the adaption of xk6-browser testing is going to excel.
Hi, As an update for this issue, we have retaken conversations around generating TS Type declarations and will start doing so soon. It will be a progressive effort starting with the more stable APIs first. You can track the progress through issue #791.
Closed by #791.