Enable Optional Chaining

When I ask AI to write a script to use in a fibery automation, it ALWAYS, like 100% of the cases, uses OptionalChaining, and then I have to explain not to use that.

Please:

Options to Enable Optional Chaining:

  1. Upgrade JavaScript version to ES2020 or higher (this enables native support for optional chaining).
  2. Configure Babel with the plugin @babel/plugin-proposal-optional-chaining (if using Babel to transpile the code).
  3. Upgrade TypeScript to target ES2020 or higher (in tsconfig.json) to enable optional chaining.
  4. Use a polyfill (if targeting older environments that do not support optional chaining natively).
1 Like

Hello.
We got same issue ourselves, that’s why some time ago I worked on upgrading Script Engine to Nodejs22.

I’ve released it to production just now. Editor on UI is not yet familiar with some recent Nodejs apis (like Array.flatMap for example), so you may see them underlined with red. But it should work okay.

2 Likes