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

Top level await #4007

Merged
merged 3 commits into from
Oct 28, 2024
Merged

Top level await #4007

merged 3 commits into from
Oct 28, 2024

Conversation

mstoykov
Copy link
Contributor

@mstoykov mstoykov commented Oct 22, 2024

What?

top-level-await support

Why?

It is part of the specification and it is hepful if you have async APIs ... which k6 starts to get more and more off.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

@mstoykov mstoykov added this to the v0.55.0 milestone Oct 22, 2024
@mstoykov mstoykov requested a review from a team as a code owner October 22, 2024 17:00
@mstoykov mstoykov requested review from oleiade and joanlopez and removed request for a team October 22, 2024 17:00
@mstoykov mstoykov linked an issue Oct 23, 2024 that may be closed by this pull request
oleiade
oleiade previously approved these changes Oct 23, 2024
Copy link
Member

@oleiade oleiade left a comment

Choose a reason for hiding this comment

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

Took it for a spin locally, and you have no idea how having the ability to do this:

import { open, SeekMode } from 'k6/experimental/fs'

const file = await open('package.json')

export default async function () {
  // ...
}

Makes me happy! Great job @mstoykov, thanks a lot for making this happen, much appreciated! 🙇🏻 🎉 🚀

olegbespalov
olegbespalov previously approved these changes Oct 23, 2024
Base automatically changed from tc39TypeErasureTestFixes to master October 25, 2024 15:14
@mstoykov mstoykov dismissed stale reviews from olegbespalov and oleiade October 25, 2024 15:14

The base branch was changed.

joanlopez
joanlopez previously approved these changes Oct 25, 2024
Co-authored-by: Joan López de la Franca Beltran <[email protected]>
@mstoykov mstoykov merged commit 3c56028 into master Oct 28, 2024
23 checks passed
@mstoykov mstoykov deleted the top-level-await branch October 28, 2024 11:15
@olegbespalov
Copy link
Contributor

It's worth updating also examples (like experimental/fs) and documentation to reflect the change 👍

@oleiade
Copy link
Member

oleiade commented Nov 5, 2024

@olegbespalov 👍🏻 I'm on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support top-level-await
4 participants