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

Provide both Sync and Async JS APIs #1373

Merged
merged 20 commits into from
Jun 6, 2024
Merged

Provide both Sync and Async JS APIs #1373

merged 20 commits into from
Jun 6, 2024

Conversation

inancgumus
Copy link
Member

@inancgumus inancgumus commented Jun 6, 2024

What?

Provides sync and async APIs within the same module.

  • k6/x/browser -> maps to sync JS API
  • k6/x/browser/async -> maps to async JS API

Why?

  • To give headroom to users to easily switch to the new async API
  • To graduate from the non-experimental module

Plan

  • We'll remove the sync API after ~two cycles.
  • We'll also register these from the k6-core side.

I'll create issues for this.

Checklist

  • I have performed a self-review of my code
  • I have added tests for my changes
  • I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

#1117 #428

@inancgumus inancgumus added async supports async (promises) compatibility k6 core compatibility labels Jun 6, 2024
@inancgumus inancgumus self-assigned this Jun 6, 2024
@inancgumus inancgumus changed the title Provide both sync and async API Provide both Sync and Async JS APIs Jun 6, 2024
Copy link
Collaborator

@ankur22 ankur22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this quick turnaround on this. Generally LGTM.

I do think it's worth keeping the sync examples too 👍 Looks like you're still working on the workflow for them so I'll rereview it once you've resolved the issue.

browser/module.go Show resolved Hide resolved
register_sync.go Outdated Show resolved Hide resolved
@inancgumus inancgumus force-pushed the sync/api branch 2 times, most recently from 1ecf50c to 48e4dee Compare June 6, 2024 14:49
@inancgumus inancgumus requested a review from ankur22 June 6, 2024 15:17
@inancgumus inancgumus force-pushed the improve/text-content-null-detection branch 2 times, most recently from b987414 to 770f2ae Compare June 6, 2024 15:23
Base automatically changed from improve/text-content-null-detection to main-async June 6, 2024 15:24
The reason behind this is that the E2E tests take huge resource on
Github and become more flaky when run together both with sync and async
examples. Since we're using a weak Github runner.
Copy link
Collaborator

@ankur22 ankur22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Thanks! LGTM 🚀

@inancgumus inancgumus merged commit 7883921 into main-async Jun 6, 2024
20 checks passed
@inancgumus inancgumus deleted the sync/api branch June 6, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async supports async (promises) compatibility k6 core compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants