-
Notifications
You must be signed in to change notification settings - Fork 225
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
Update compatibility mode docs #1855
Conversation
docs/sources/k6/next/using-k6/javascript-typescript-compatibility-mode.md
Outdated
Show resolved
Hide resolved
@@ -40,40 +40,40 @@ $ k6 run script.js | |||
|
|||
{{< /code >}} | |||
|
|||
After v0.53.0 the only difference with base is that `global` (node's global variable) is aliased to the value of `globalThis`. | |||
After v0.53.0, the only difference from the base mode is that `global`, the Node.js global variable, is aliased to the value of `globalThis`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would merge this sentence with the previous k6 offers two JavaScript compatibility modes:
. In this way, the reader can join the list of available modes already having the context about the different.
Otherwise, if someone isn't aware of this concept, while it reads the list then they won't get most of it.
…ity-mode.md Co-authored-by: Ivan <[email protected]>
k6 offers two JavaScript compatibility modes: | ||
|
||
- [Extended mode](#extended-mode): The default option. That is `base` + aliasing `global` to `globalThis` - a nodejs compatibility. | ||
- [Base mode](#base-mode): Only using native support in k6 and the underlying JS engine. After v0.53.0 it has the same functionality as `extended` apart from the `global` aliasing. | ||
- [Base mode](#base-mode): Only uses native support in k6 and the underlying JavaScript runtime. For k6 v0.53.0 or higher, it has the same functionality as `extended` apart from the `global` aliasing. | ||
- [Extended mode](#extended-mode): Similar to base mode, with an additional alias from `global` to `globalThis` for Node.js compatibility. This is the default mode. | ||
|
||
After k6 v0.53.0, the only difference between the base and extended modes is that `global`, the Node.js global variable, is aliased to the value of `globalThis`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codebien do you think this is better? I'm wondering if it's a little repetitive. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion was to have it early but in a single place. I think it is useful to have this additional context already before starting to read the list. Except if we put it directly on the specific item. But still, it should be only once in total.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. I think I'm gonna leave it as is then, there is some repetition but I don't think it's necessarily bad. And we should be able to hide/delete this page in the near future.
What?
Edits to the compatibility mode page for the k6 v0.57 release.
Checklist
npm start
command locally and verified that the changes look good.docs/sources/k6/next
folder of the documentation.Related PR(s)/Issue(s)
Related to #1853.