I’ve been building plugins with the help of ai and it’s been amazing tbh, learning loads and enhancing the capabilities of my app. For some reasons I always thought bubble plugins needed to be ES5 so that is what I have been using, however today I decided to create a test plugin that tries out all modern JS features up to ES2025 level (results below if anybody is interested).
However the reason for this post is that at one point the plugin editor broke due to syntax issue. When isolating the issue it appears to be:
”Linter Bug: The Bubble plugin editor’s syntax checker incorrectly flags an error when the ES12 logical assignment operators (||=, &&=, ??=) are immediately followed by a template literal.
For example:
The workaround given was “To bypass this bug, encapsulate the code inside a string and execute it with the new Function() constructor. This hides the syntax from the linter while allowing the browser to execute it correctly.”
Is that workaround safe to do? Feels a bit dodgy to me but I am not an expert.
Can I also just ask if there are any other known issues with using newer JS standards? Or would it be better for me to continue to tell it to stick to ES5 as I was?
Thanks
Here are the results from the tests just incase it’s helpful to anyone:
| Feature | ES Version | Result |
|---|---|---|
| Arrow Functions | ES6 (2015) | |
| Object Destructuring | ES6 (2015) | |
| Template Literals | ES6 (2015) | |
| const and let | ES6 (2015) | |
| Array.prototype.includes() | ES7 (2016) | |
| Exponentiation Operator (**) | ES7 (2016) | |
| Object.values() / Object.entries() | ES8 (2017) | |
| async/await | ES8 (2017) | |
| Named Capture Groups | ES9 (2018) | |
| Array.prototype.flat() | ES10 (2019) | |
| Optional Chaining (?.) | ES11 (2020) | |
| Nullish Coalescing (??) | ES11 (2020) | |
| Promise.allSettled() | ES11 (2020) | |
| BigInt | ES11 (2020) | |
| String.prototype.replaceAll() | ES12 (2021) | |
| Error Cause | ES13 (2022) | |
| Private Class Fields (#) | ES13 (2022) | |
| Array.prototype.findLast() | ES14 (2023) | |
| .toReversed() / .toSorted() | ES14 (2023) | |
| Set.intersection() | ES2025 |
ES12 Logical Assignment + Template Literal |
Failed | The editor’s parser fails when this specific sequence is used.
