This repository has been archived by the owner on Jan 30, 2025. It is now read-only.
Remove the api
package to use concrete common
types
#898
Labels
Feature Description
In Go, generally, interfaces are small and focused, as well as defined where they're being used. This also helps in testing, where we can define smaller focused interfaces which only mock methods that are used by the test, rather than a large interface where everything needs to be mocked even if majority of the methods aren't being used by the test.
The
api
package was useful when we required the concrete types to comply with the interface since we were returning the interfaces to the goja layer directly. E.g.:Now that we're working with the mapping layer which explicitly maps the implementation to a goja type, this api compliance requirement is no longer required.
When working on recent investigative issues, we've found that this interface api compliance has become a hinderance.
This issue is too explore whether we can remove the
api
package and what the consequences of that would be. Something to consider are:POC
https://github.com/grafana/xk6-browser/commits/refactor/api-package-poc
Primary tasks
#1055: Remove the
api
package#1057: Refactor the
common
API types to concreteAlready existing or connected issues / PRs (optional)
Related issues:
The text was updated successfully, but these errors were encountered: