I'd like to use JavaScript features such as optional chaining in my code, but some features like that don't appear to be available. I also usually write the code in an IDE like VS Code, maintain class definitions in separate files, and keep copies of scripts in a git repo for better source control.
Is it possible to get more information about what the JavaScript engine and version are so we know what features are available? Are there any plans on upgrading the existing JavaScript engine? Maybe even TypeScript support?
The current JavaScript engine used for processing hooks is V8 7.7.299.14, which aligns roughly with ECMAScript 6 in terms of supported features.
We're planning to upgrade to V8 12.4.254.21, which will bring support for additional modern JavaScript features. That said, V8 versions don’t map exactly to specific ECMAScript versions — support varies feature by feature.
Curious — aside from optional chaining, are there other modern JS features you're hoping to use?
Thanks for the quick reply. I'm looking forward to that upgrade!
I can't think of specific features at the moment, I just know that the optional chaining one would be a great help to avoid long logic checks for nested objects.
I agree optional chaining would be great! Whenever ChatGPT gives me code it uses optional chaining and I have to tell it to remove it . Some others I would like are replaceAll, groupBy, and nullish coalescing.
Hi Tyler, are you able to provide any update about when this upgrade will be available? I'd also find modern JavaScript features like optional chaining, nullish coalescing, object destructuring and spreading very useful.
Oh that's great. Thanks for highlighting the plans and that some of those features are already functional. The script editor does still show a warning when using the spread operator, so that's what threw me off, but the result does work.
Since we don’t exactly follow ES version, it must be a disconnect between what we have support for and what the UI code editor thinks we have support for. We’ll take note of this and get the UI updated as well.