k6 icon indicating copy to clipboard operation
k6 copied to clipboard

Support top-level-await

Open mstoykov opened this issue 1 year ago • 1 comments

Feature Description

Support top-level-await

This lets await being called in the top scope of a module (not a commonjs script).

Allowing users to use k6/experimental/fs.open and others in the init context more ergonomically

Suggested Solution (optional)

This was skipped in #3456 as it required even more changes to the initial loading as it now needs to be 100% asynchronous.

Sobek already supports this, so this will likely mostly be changing signatures inside k6 in js and js/modules

Already existing or connected issues / PRs (optional)

No response

mstoykov avatar Jul 18 '24 11:07 mstoykov

Mentioning it for context: https://github.com/grafana/k6/pull/3743#discussion_r1611326469

oleiade avatar Aug 01 '24 13:08 oleiade