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

Reduce dependency usage #729

Closed
ka3de opened this issue Jan 25, 2023 · 2 comments · Fixed by #734
Closed

Reduce dependency usage #729

ka3de opened this issue Jan 25, 2023 · 2 comments · Fixed by #734
Assignees
Labels
compatibility k6 core compatibility optimization
Milestone

Comments

@ka3de
Copy link
Collaborator

ka3de commented Jan 25, 2023

Some dependencies currently required by the project are marginally used and could potentially be removed. This acquires more relevance with the upcoming merge with k6 core due to the importance that is placed in this project to minimize the dependencies usage and limit its heterogeneity in order to prevent malfunctions between extensions code.

Some examples for dependencies that could potentially be reevaluated are:

Other dependencies such as:

  • golang.org/x/exp
  • golang.org/x/net
  • golang.org/x/sync -> Only used in tests pkg
  • gopkg.in/guregu/null.v3
    Are marginally used but are required as transitive dependencies by other modules.

Additionally this is in interest of reducing the xk6-browser / k6 binary size.

@ka3de ka3de added optimization compatibility k6 core compatibility labels Jan 25, 2023
@ka3de ka3de added this to the v0.8.0 milestone Jan 26, 2023
@ka3de ka3de self-assigned this Jan 26, 2023
@ka3de
Copy link
Collaborator Author

ka3de commented Jan 26, 2023

In regards of github.com/fatih/color usage:

A couple of points of view.
From one side, color library is only used in the logger implementation, and only when the "inner logger" is nil. See here.
But in practice this never happens, as in our implementation, every time that a logger is created, we pass the vu.State().Logger as the inner logger. See references 1, 2(also it's a test), 3, 4.
So we could probably replace this by a simpler implementation from our side.

On the other hand this library is already being used by k6 core, so probably there's no need to remove it as it'll be included in the final binary anyway?

@ankur22
Copy link
Collaborator

ankur22 commented Jan 26, 2023

Re. github.com/fatih/color

color library is only used in the logger implementation, and only when the "inner logger" is nil

Based on how k6 works with dependencies, we should remove it, which would be my preference too.

@ankur22 ankur22 mentioned this issue Jan 27, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility k6 core compatibility optimization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants