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

Deprecate common.Bind() and relatives #2344

Closed
5 tasks done
codebien opened this issue Jan 18, 2022 · 0 comments · Fixed by #2384
Closed
5 tasks done

Deprecate common.Bind() and relatives #2344

codebien opened this issue Jan 18, 2022 · 0 comments · Fixed by #2384
Assignees
Labels
Milestone

Comments

@codebien
Copy link
Collaborator

codebien commented Jan 18, 2022

Problem statement

Now that k6 has a new and cleaner API for JS modules and most of the internal modules had been migrated we can consider deprecating the common.Bind() method for having a unique and consistent way of extending the k6's JS API.

Proposed change

v0.36.0

  • Mention that we plan to deprecate them in the release notes

v0.37.0

  • Submit and merge a PR for Migrate js/grpc to ModuleV2 #2343
  • Add a deprecation comment and relative log warning for common.Bind()
  • Add a deprecation comment for connected APIs

Below a list of the connected methods to deprecate:

$ rg '\bWith.*context.Context' -g '!vendor'
api/common/context.go
33:func WithEngine(ctx context.Context, engine *core.Engine) context.Context {

js/common/context.go
37:func WithRuntime(ctx context.Context, rt *goja.Runtime) context.Context {
51:func WithInitEnv(ctx context.Context, initEnv *InitEnvironment) context.Context {

lib/context.go
34:func WithState(ctx context.Context, state *State) context.Context {
48:func WithExecutionState(ctx context.Context, s *ExecutionState) context.Context {
62:func WithScenarioState(ctx context.Context, s *ScenarioState) context.Context {

From an internal discussion:

Removing WithExecutionState and WithScenarioState might not be needed or will need more methods on the modules.VU interface

v0.38.0 or v0.39.0

@codebien codebien added this to the v0.37.0 milestone Jan 18, 2022
mstoykov added a commit to grafana/xk6-loki that referenced this issue Feb 10, 2022
mstoykov added a commit to grafana/xk6-client-prometheus-remote that referenced this issue Feb 10, 2022
mstoykov added a commit to grafana/xk6-client-prometheus-remote that referenced this issue Feb 11, 2022
mstoykov added a commit to grafana/xk6-loki that referenced this issue Feb 15, 2022
mstoykov added a commit to grafana/xk6-loki that referenced this issue Feb 15, 2022
maxaudron pushed a commit to maxaudron/xk6-harbor that referenced this issue Jun 21, 2023
Some work around getting the goja Runtime was required see
grafana/k6#2344
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants