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

Release notes v0.52.0 #3805

Merged
merged 21 commits into from
Jun 25, 2024
Merged
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions release notes/v0.52.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
k6 `v0.52.0` is here 🎉! Some special mentions included in this release:

- [We switched from `goja` to our own fork named `sobek`](#switch-goja-to-our-own-fork-named-sobek-3775)
- [Panics are no longer being captured](#panics-are-no-longer-being-captured-3777)
- [The `web-dashboard` built-in output becomes `dashboard`](#the-web-dashboard-built-in-output-becomes-dashboard-xk6-dashboard163)
- [We've added experimental support for TypeScript and ES6+](#experimental-support-for-typescript-and-es6-using-esbuild-3738)
joanlopez marked this conversation as resolved.
Show resolved Hide resolved
- [`k6/browser` has graduated from an experimental module](#k6browser-has-graduated-from-an-experimental-module-3793)
- [`k6/browser` has now a fully Async API](#k6browser-has-now-a-fully-async-api-browser428)
joanlopez marked this conversation as resolved.
Show resolved Hide resolved

joanlopez marked this conversation as resolved.
Show resolved Hide resolved
## Breaking changes

### Switch `goja` to our own fork named `sobek` [#3775](https://github.com/grafana/k6/pull/3775)

In order to accelerate the development speed and unblock the support for [Native ESM](https://github.com/grafana/k6/issues/3265),
joanlopez marked this conversation as resolved.
Show resolved Hide resolved
we have decided to create a fork of the [`goja`](https://github.com/dop251/goja/) project under the Grafana GitHub organization,
named [`sobek`](https://github.com/grafana/sobek).

So, since this release, k6 (and its extensions) starts using `sobek` instead of the original `goja`, for all (of the
joanlopez marked this conversation as resolved.
Show resolved Hide resolved
publicly exposed parts of the API) except for a couple of packages that are only used internally by k6.

Find further details in [#3772](https://github.com/grafana/k6/issues/3772) and [#3773](https://github.com/grafana/k6/issues/3773).
olegbespalov marked this conversation as resolved.
Show resolved Hide resolved
joanlopez marked this conversation as resolved.
Show resolved Hide resolved

### Panics are no longer being captured [#3777](https://github.com/grafana/k6/pull/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, as for most cases with multiple goroutines/async it is not enough, and also makes a bunch of potential
bugs seem like less of an issue.
joanlopez marked this conversation as resolved.
Show resolved Hide resolved

Thus, this will help us to identify and fix bugs more easily, to improve the overall stability of k6, and
joanlopez marked this conversation as resolved.
Show resolved Hide resolved
most likely make the experience of developing k6 extensions friendlier.

### `lib.State` no longer has `Group` [#3750](https://github.com/grafana/k6/pull/3750)

As the result of refactoring the implementation of `group` and `check` methods, in order to decouple them, and thus
enable other future improvements, the `lib.State` object no longer has a `Group` field.

This change should not affect most users, except for a couple of extensions, for which the use of `Group` was
already questionable:
- `xk6-fasthttp`
- `xk6-g0`

### The `web-dashboard` built-in output becomes `dashboard` [xk6-dashboard#163](https://github.com/grafana/xk6-dashboard/pull/163)

Since `v0.49.0`, k6 includes [xk6-dashboard](https://github.com/grafana/xk6-dashboard) as a built-in output extension.
The name of the built-in module is the same as was the output name (`web-dashboard`) registered by the extension.
Therefore, if you try to use it as an extension (for example, a newer version), you will get the following error:

```sh
k6 run -o web-dashboard script.js



ERRO[0000] invalid output extension web-dashboard, built-in output with the same type already exists
joanlopez marked this conversation as resolved.
Show resolved Hide resolved
```

So, from now on, the registered name of the extension is again the one previously used: `dashboard`.
joanlopez marked this conversation as resolved.
Show resolved Hide resolved
Thus, it is possible to use a version of the [xk6-dashboard](https://github.com/grafana/xk6-dashboard) that is newer than
the one integrated in k6. In this case, the `dashboard` name must be used as the output name.

### Other breaking changes

- [browser#1318](https://github.com/grafana/xk6-browser/pull/1318) The `Mouse.up` and `Mouse.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](https://github.com/grafana/k6/pull/3738)

This release of k6 introduces experimental support for TypeScript and ES6+ using esbuild, thanks to a new
[compatibility mode](https://grafana.com/docs/k6/latest/using-k6/javascript-compatibility-mode/) named `experimental_enhanced`.
joanlopez marked this conversation as resolved.
Show resolved Hide resolved

```sh
k6 run --compatibility-mode=experimental_enhanced script.js
```

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 does not provide type safety.
joanlopez marked this conversation as resolved.
Show resolved Hide resolved

### `k6/browser` has graduated from an experimental module [#3793](https://github.com/grafana/k6/pull/3793)

The browser module is now available as `k6/browser` instead of `k6/experimental/browser`. The previous `k6/experimental/browser` module will be removed on September 23rd, 2024. Please see [the migration guide](https://grafana.com/docs/k6/latest/using-k6-browser/migrating-to-k6-v0-52/) for more information on how to update your scripts.
joanlopez marked this conversation as resolved.
Show resolved Hide resolved

### `k6/browser` has now a fully Async API [browser#428](https://github.com/grafana/xk6-browser/issues/428)

This 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](https://grafana.com/docs/k6/latest/javascript-api/k6-browser) for more information on how to use the new Async API.

Related Changes:
- [browser#1310](https://github.com/grafana/xk6-browser/pull/1310), [browser#1311](https://github.com/grafana/xk6-browser/pull/1311), [browser#1312](https://github.com/grafana/xk6-browser/pull/1312), [browser#1316](https://github.com/grafana/xk6-browser/pull/1316), [browser#1328](https://github.com/grafana/xk6-browser/pull/1328), [browser#1337](https://github.com/grafana/xk6-browser/pull/1337), [browser#1367](https://github.com/grafana/xk6-browser/pull/1367), [browser#1366](https://github.com/grafana/xk6-browser/pull/1366), [browser#1314](https://github.com/grafana/xk6-browser/pull/1314), [browser#1332](https://github.com/grafana/xk6-browser/pull/1332), [browser#1323](https://github.com/grafana/xk6-browser/pull/1323), [browser#1355](https://github.com/grafana/xk6-browser/pull/1355), [browser#1348](https://github.com/grafana/xk6-browser/pull/1348), [browser#1364](https://github.com/grafana/xk6-browser/pull/1364) Migrates `Browser`, `BrowserContext`, `ElementHandle`, `Frame`, `JSHandle`, `Keyboard`, `Locator`, `Mouse`, `Page`, `Request`, `Response` APIs to async.

## UX improvements and enhancements

- [#3740](https://github.com/grafana/k6/pull/3740) enables k6 extensions to initialize `ReadableStream` objects from Go code (`io.Reader`).
- [#3798](https://github.com/grafana/k6/pull/3798) adjusts a severity level of a log message from `warn` to `debug` for cases when k6 can't detect the terminal's size.
- [#3797](https://github.com/grafana/k6/pull/3797) makes it possible to output the archive to stdout by using `-` as the `--archive-out`.
joanlopez marked this conversation as resolved.
Show resolved Hide resolved
- [browser#1370](https://github.com/grafana/xk6-browser/issues/1370) The `GetAttribute` methods now return `false` when the attribute is missing, making it easier to check for the presence of an attribute.
- [browser#1371](https://github.com/grafana/xk6-browser/issues/1371) The `TextContent` methods now return `false` when the element's text content cannot be grabbed (like a JS `document`), making it easier to check for the presence of text content.
- [browser#1376](https://github.com/grafana/xk6-browser/pull/1376) Makes `Request.headerValue` and `Response.headerValue` to be case insensitive.
- [browser#1368](https://github.com/grafana/xk6-browser/pull/1368) Enhances `await` usage in Javascript examples.
- [browser#1326](https://github.com/grafana/xk6-browser/pull/1326) Adds forgotten `BrowserContext.browser` and `Page.context` mappings.
- [browser#1360](https://github.com/grafana/xk6-browser/pull/1360), [browser#1327](https://github.com/grafana/xk6-browser/pull/1327), [browser#1335](https://github.com/grafana/xk6-browser/pull/1335), [browser#1365](https://github.com/grafana/xk6-browser/pull/1365), [browser#1313](https://github.com/grafana/xk6-browser/pull/1313), [browser#1322](https://github.com/grafana/xk6-browser/pull/1322), [browser#1330](https://github.com/grafana/xk6-browser/pull/1330), [browser#1343](https://github.com/grafana/xk6-browser/pull/1343), [browser#1345](https://github.com/grafana/xk6-browser/pull/1345), [browser#1352](https://github.com/grafana/xk6-browser/pull/1352) Turns the `Browser`, `BrowserContext`, `ElementHandle`, `JSHandle`, `Keyboard`, `Mouse`, `Locator`, and `Page` types' panics into errors for stability and better error handling.
joanlopez marked this conversation as resolved.
Show resolved Hide resolved

## Bug fixes

- [#3774](https://github.com/grafana/k6/pull/3774) fixes a `require` warning for those tests using the stdin.
- [#3776](https://github.com/grafana/k6/pull/3776) fixes a panic caused by passing an undefined handler to timers.
- [#3779](https://github.com/grafana/k6/pull/3779) fixes a panic caused by registering an undefined handler in gRPC streams.
- [xk6-websockets#73](https://github.com/grafana/xk6-websockets/pull/73) fixes a panic caused by registering an undefined handler in WebSockets.
- [browser#1369](https://github.com/grafana/xk6-browser/pull/1369) Improves `valueFromRemoteObject` `null` detection by returning a Go `nil` instead of `"null"` as a `string`.
- [browser#1386](https://github.com/grafana/xk6-browser/pull/1386) Correctly handles empty string flags that don't have a value.
- [browser#1380](https://github.com/grafana/xk6-browser/pull/1380) Ensures that `JSHandle.evaluate` and `JSHandle.evaluateHandle` both set themselves as the first argument.
- [browser#1346](https://github.com/grafana/xk6-browser/pull/1346) Fixes an IFrame panic ("we either navigate top level or have old version of the navigated frame") that happens during navigation.
- [browser#1349](https://github.com/grafana/xk6-browser/pull/1349), [browser#1354](https://github.com/grafana/xk6-browser/pull/1354) Fixes `Request` mappings.
- [browser#1334](https://github.com/grafana/xk6-browser/pull/1334) Fixes an issue where clicking on a link that opens a new tab never navigates to the href link.
- [browser#1318](https://github.com/grafana/xk6-browser/pull/1318) Fixes the `Mouse.move` to correctly dispatch a `down` event.
- [browser#1301](https://github.com/grafana/xk6-browser/pull/1301) Fixes an error that occurs when working with a second tab and navigating to a URL.
- [browser#1387](https://github.com/grafana/xk6-browser/pull/1387) Fixes an NPE when the new document or request is missing.
joanlopez marked this conversation as resolved.
Show resolved Hide resolved

## Maintenance and internal improvements

- [#3752](https://github.com/grafana/k6/pull/3752), [#3767](https://github.com/grafana/k6/pull/3767), [#3770](https://github.com/grafana/k6/pull/3770), [#3780](https://github.com/grafana/k6/pull/3780), [#3782](https://github.com/grafana/k6/pull/3782), [#3795](https://github.com/grafana/k6/pull/3795) updates several dependencies.
- [#3786](https://github.com/grafana/k6/pull/3786), [#3787](https://github.com/grafana/k6/pull/3787), [#3788](https://github.com/grafana/k6/pull/3788), [#3789](https://github.com/grafana/k6/pull/3789), [#3803](https://github.com/grafana/k6/pull/3803) updates experimental modules.
- [#3749](https://github.com/grafana/k6/pull/3749) stops printing `goja` stack traces on panics, which has been empty since a while.
- [#3760](https://github.com/grafana/k6/pull/3760) fixes race conditions in ramping-vus tests.
- [#3769](https://github.com/grafana/k6/pull/3769) removes a linter setting no longer used.
- [#3800](https://github.com/grafana/k6/pull/3800) adds test coverage for outputting the archive to stdout.

joanlopez marked this conversation as resolved.
Show resolved Hide resolved
- [browser#1298](https://github.com/grafana/xk6-browser/pull/1298) Splits browser mappings into separate files for better organization and maintainability.
- [browser#1321](https://github.com/grafana/xk6-browser/pull/1321) Adds test helpers for async VU execution to reduce the boilerplate in the tests.
- [browser#1357](https://github.com/grafana/xk6-browser/pull/1357) Updates `Group` and `Tag` usage for the latest k6.
- [browser#1361](https://github.com/grafana/xk6-browser/pull/1361) Precalculates the browser version information to prevent I/O calls when the `version` and `userAgent` 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.
- [browser#1377](https://github.com/grafana/xk6-browser/pull/1377) Uses the Goja fork called Sobek in the browser module.
- [browser#1373](https://github.com/grafana/xk6-browser/pull/1373) Provides sync and async APIs within the browser module for making the migration to the async API easier.
joanlopez marked this conversation as resolved.
Show resolved Hide resolved

## Roadmap

joanlopez marked this conversation as resolved.
Show resolved Hide resolved
### OpenTelemetry metrics output

We're also happy to share that this release cycle, we've been working on [xk6-output-opentelemetry](https://grafana.com/docs/k6/latest/results-output/real-time/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](https://github.com/grafana/xk6-output-opentelemetry/issues)!

Depending on the feedback, we plan to include this extension as an experimental output in the next K6 release.
joanlopez marked this conversation as resolved.
Show resolved Hide resolved
Loading