Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created by
brew bumpCreated with
brew bump-formula-pr.Details
release notes
Breaking changes
Transition browser APIs to Async
In the last release notes we mentioned this breaking change, and we wanted to remind and update you on the plan. In the next release (v0.52.0), most of the synchronous browser APIs will be migrated to be asynchronous (promisifying them). We expect this will affect most if not all of our users.
This breaking change will require you to add
awaitin front of most of the browser module APIs. Without thisawaityou will witness undocumented and unknown behavior during the runtime. To make the migration simpler we advise that you work with the latest k6 type definitions.You can find a list of all the APIs that we expect to convert to async in a comment in issue browser#428.
Awaiting on something that’s not a thenable just returns that value, which means you can add the
awaitkeyword today on the APIs that will become async to future proof your test scripts.Here are the reasons for making this large breaking change:
As a starting point, we have migrated a single API (the
tapmethod), which you can find the details below that will help visualize the upcoming breaking changes.Browser
Tapis now an async method grafana/xk6-browser#1268This release converts the
Tapmethod in thebrowsermodule into an asynchronous method. This change is necessary to ensure that the method can be used in async contexts and to align with the rest of the browser module's planned asynchronous API. To use theTapmethod, you must now add theawaitkeyword before the method call.Affected components:
locator.tappage.tapframe.tapelementHandle.tapSee the following example for how to use the
Tapmethod after this change:Before:
After:
k6/experimental/websocketswill not defaultbinaryTypeto `"arraybuffer"'As part of the stabilization of the API it needs to become as close to the specification.
Early in the development the idea of adding
Blobsupport as part was deemed feature creep and was dropped in favor of going with only"arraybuffer". But the specification defaults to returning binary responses asBlob- which was another thing that was changed.While adding
Blobis still on our radar, moving the default is always going to be a breaking change that we need to do to align with the specification.For this release there is now a warning that will be printed if
binaryTypeis not set to"arraybuffer"and a binary response is received. The warning will go away whenbinaryTypeis set to"arraybuffer".In the next release the warning will become an error.
More info and place for discussion can be found in an this issue.
k6/experimental/grpcis no longer available #3530As the last step of the graduation process for the experimental gRPC module, we completely removed the module. It is now fully integrated into the stable
k6/net/grpcmodule. So, if you haven't done this yet, replace your imports fromk6/experimental/grpctok6/net/grpc.Deprecations
The following pull requests start the process to introduce breaking changes. They are currently starting to emit warning if their condition is hit, but they will turn to return errors in the future release.
It is recommended to use the suggested alternative, or to fix the script if you see the warning message.
requireexpressions.New features
Introduction of
k6/experimental/streamsmodule #3696This release of k6 introduces the new
k6/experimental/streamsmodule, which partially supports the JavaScriptStreams API, focusing initially on the
ReadableStreamconstruct.With the
ReadableStream, users can define and consume data streams within k6 scripts. This is particularly useful forefficiently handling large datasets or for processing data sequentially in a controlled flow.
Expand to see an example of stream's usage
The following example demonstrates creating and consuming a simple stream that emits numbers until it reaches a predefined limit:
For more advanced examples, please head to the MDN Web Docs on the Streams API.
Limitations
Currently, users can define and consume readable streams. However, this release does not include support for byte readers
and controllers, nor does it include support the
tee,pipeTo, andpipeThroughmethods of theReadableStreamobject.New features and updates of WebCrypto API support #3714
This release brings support for asymmetric cryptography to the
k6/experimental/webcryptomodule. We added support of the elliptic curves algorithms ECDH (xk6-webcrypto#67) and ECDSA (xk6-webcrypto#69) algorithms along with new import/export key formats likespkiandpkcs8.One of the newly added operations is
deriveBits, which allows parties to generate a unique shared secret by using shared public and non-shared private keys.Expand to see an example of generating a shared secret for Alice and Bob.
The
signandverifyoperations got support for ECDSA algorithm. Thesignoperation allows you to sign a message with a private key, while theverifyoperation allows you to verify the signature with a public key.Other notable updates and fixes:
See webcrypto's module documentation for more details.
Timers globally available #3589
setTimeout,setIntervaland related clear functions have been part of the JavaScript ecosystem, probably for as long as it has existed.In the previous releases we stabilized and made them available through
k6/timersmodule. While the module isn't going anywhere and might get more identifiers,setTimeoutis usually used without importing it. For this reason it is now globally available alongclearTimeout,setIntervalandclearInterval.No code needs to be changed, but you no longer need to import
k6/timersto use this functionality.UX improvements and enhancements
asyncInvokemethod to thek6/net/grpcmodule. It's a non-blocking version of theinvokemethod.Bug fixes
execution.test.optionsfrom Init context.k6_SYSTEM_TAGSenvironment variable.mappingsfield is empty in the provided SourceMap.Maintenance and internal improvements
golangci-lintin the contribution guide. Thanks @yomek33 for your contribution!Future plans
Use Blob as default value for WebSocket.binaryType
As the changes in documentation mention,
binaryTypewas by default set toarraybuffer, now instead it is""(empty string).In a not so remote future, instead, we expect to introduce and use Blob object.
WebCrypto graduation
WebCrypto got more features in the current release, and we expect to continue its expansion in the next iterations. Reaching a wider coverage will push WebCrypto module to being graduated as a stable module.
Streams API
In the not so distant future, we have plans to start using the Streams API in existing modules. Our first iteration being adding a
.readableproperty to the already existing fs.File object.Improve user experience for Cloud related commands
In the near future, we intend to reiterate on
k6 cloudand related commands to create a simplified and more ergonomic user experience.Remove experimental timers module
The
k6/experimental/timersmodule is now part of the stable k6 API ask6/timersand via the globally available functions. The next release will make the experimental import no longer available.