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 bump
Created with
brew bump-formula-pr
.release notes
goja
namedsobek
.k6/browser
has graduated from an experimental module, and now has a fully Async API.Breaking changes
Switch
goja
to our own fork namedsobek
#3775To accelerate the development speed and bring ECMAScript Modules (ESM) support to k6 earlier (grafana/k6#3265),
we have decided to create a fork of the
goja
project under the Grafana GitHub organization,named
sobek
.Starting on this release, k6 (and its extensions) now use
sobek
instead of the originalgoja
, for all (of thepublicly exposed parts of the API) except for a couple of packages that are only used internally by k6.
All k6 extensions linked in the docs have had a PR for this transition opened, as explained in this comment. Any extension author who hasn't gotten a PR can follow the same steps.
Find further details in #3772 and #3773.
Panics are no longer being captured #3777
Since this release, Go panics are no longer being captured by k6. This means that if a panic occurs while running a test,
the k6 process will crash, and the panic stack trace will be printed to the console.
We decided to change this behavior because it's something that was left from the past as a safeguard, but it's not as
good as it might seem. For most cases with multiple goroutines/async, it's not enough and also makes a bunch of potential
bugs seem like less of an issue.
Thus, this will help us to identify and fix bugs earlier, improve the overall stability of k6, and
most likely make the experience of developing k6 extensions friendlier.
lib.State
no longer hasGroup
#3750As the result of refactoring the implementation of
group
andcheck
methods, in order to decouple them, and thusenable other future improvements, the
lib.State
object no longer has aGroup
field.This change should not affect most users, except for a couple of extensions, for which the use of
Group
wasalready questionable:
xk6-fasthttp
xk6-g0
Other breaking changes
-
as a special value for--archive-out
to output the archive to stdout.Mouse.up
andMouse.down
methods no longer take x and y coordinates. Instead, they dispatch events on the current mouse position.New features
Experimental support for TypeScript and ES6+ using esbuild #3738
This release of k6 introduces experimental support for TypeScript and ES6+ using esbuild, thanks to a new
compatibility mode named
experimental_enhanced
.With this new compatibility mode, the test source code is transformed using esbuild instead of Babel, which also means
that source files with the extension ".ts" are loaded by esbuild's TypeScript loader, which results in partial
TypeScript support: it removes the type information but doesn't provide type safety.
k6/browser
has graduated from an experimental module #3793The browser module is now available as
k6/browser
instead ofk6/experimental/browser
. The previousk6/experimental/browser
module will be removed on September 23rd, 2024. Refer to the migration guide for more information on how to update your scripts.k6/browser
has now a fully Async API browser#428This release introduces a fully Async API for the
k6/browser
module. This means that nearly all the methods in the module now return promises. This change is part of the ongoing effort to make the browser module more user-friendly and easier to use. Please see the browser documentation for more information on how to use the new Async API.Related Changes:
Browser
,BrowserContext
,ElementHandle
,Frame
,JSHandle
,Keyboard
,Locator
,Mouse
,Page
,Request
,Response
APIs to async.UX improvements and enhancements
ReadableStream
objects from Go code (io.Reader
).warn
todebug
for cases when k6 can't detect the terminal's size.-
as the--archive-out
. Thanks to @roobre! :bow: :tada:GetAttribute
method now returnfalse
when the attribute is missing, making it easier to check for the presence of an attribute.TextContent
method now returnfalse
when the element's text content cannot be grabbed (like a JSdocument
), making it easier to check for the presence of text content.Request.headerValue
andResponse.headerValue
to be case-insensitive.await
usage in Javascript examples.BrowserContext.browser
andPage.context
mappings.Browser
,BrowserContext
,ElementHandle
,JSHandle
,Keyboard
,Mouse
,Locator
, andPage
types' panics into errors for stability and better error handling.Bug fixes
require
warning for those tests using the stdin.valueFromRemoteObject
null
detection by returning a Gonil
instead of"null"
as astring
.JSHandle.evaluate
andJSHandle.evaluateHandle
both set themselves as the first argument.Request
mappings.Mouse.move
to correctly dispatch adown
event.Maintenance and internal improvements
goja
stack traces on panics, which has been empty since a while.Group
andTag
usage for the latest k6.version
anduserAgent
methods are called. This change allows the browser module to expose these methods as a sync API to be consistent with the Playwright's API.goja
fork calledsobek
in the browser module.Roadmap
Native ECMAScript modules
As mentioned above, the k6 team has forked
goja
intosobek
and is currently working on native ECMAScript modules support. The current work in progress can be found in this PR and any feedback is welcome.As part of that there likely will be some breaking changes due to the current not native support allowing stuff that shouldn't work. Like for example mixing CommonJS and ESM in the same file. Which is for example why we have added a warning that it won't work.
Support across multiple files is also not standard but due to amount of users that seems to be mixing them across files a lot of work has been done to support it. It is still likely that in the future warnings and potentially at some point future breaking changes will be enacted.
OpenTelemetry metrics output
We're also happy to share that this release cycle, we've been working on xk6-output-opentelemetry, a k6 output extension that allows you to send k6 metrics to OpenTelemetry-compatible backends. We're looking for feedback from the community. If you're interested, please try it and let us know via the extension repository!
Depending on the feedback, we plan to include this extension as an experimental output in the next k6 release.