Is k6 looking to be updated inline with ES6 ECMAScript 2020

Hi there, I’ve been evaluating k6 as load testing solution and one of the questions that I’ve been asked is if k6 was going to be moved inline with ES6 ECMAScript 2020? My understanding is that k6 is currently ES6 ECMAScript 2015?


Hi @chrismclellanatsta, welcome to the forum

k6 is effectively above es6[1] in some places, specifically:

  1. async/await syntax is actually ES2017
  2. k6 does support all of the class syntax AFAIK
  3. other places where we have features up to ES2022.

There is a slight curveball and that k6 supports JS through two stages:

  1. We use a JS VM called goja which supports a lot of stuff post ES6 but not modules
  2. At this point very old version of babel internally in k6 to support modules specifically.

Due to how this works any syntax that babel does not support mean that you can not use modules as babel will not be parse it. And goja does not support modules.

On the other hand goja does support a bunch of the stuff I listed above.

Is there a particular syntax that you are looking for? You can see previous discussion here

  1. ES6 is what ECMAScript 2015 used to be called. That is the version they decided to start having a yearly release of the standard. People still sometimes use ES11 to mean ES2020, but that is rare. ES6 mostly stuck as is one of the biggest release practically making JS the language that most people know. ↩︎

1 Like