The recent issues with JSONata have highlighted a long-standing mismatch between the projects. JSONata is focussed on the strict subset of what the JSON format supports. We were early adopters and straight-away took advantage of it for working with more general JavaScript Objects.
The recent fixes they have applied are very much skewed to their own focus (rightly so, no complaints here from that perspective), but have exposed the mismatch.
Thinking about the future, we want to avoid these mismatches impacting our end users who shouldn't need to know or care about the subtle distinctions between pure JSON compatible objects and everything else JavaScript can throw at you.
So I'm currently contemplating a future where we move on from JSONata.... ![]()
That isn't an overnight change for sure, but I want to think about a path to get us there.
In the comments on the current JSONata issue, the idea of allowing general JavaScript expressions in the change node resurfaced (I'm not sure of their identify on the forum - no matching username I can find.. apologies uncle-fed for not tagging you)
First up - this is not a new idea. It has come up before from others and had amount of discussion, but not got further than that.
Some threads from the past:
- Change node enhancement idea: Add JavaScript function as a change option
- [Feature Request]Allow one-liner JavaScript as well as JSONata - #40 by ralphwetzel
What has further triggered me to write this post is some of the additional leg work uncle-fed did, in particular, linking to Bonsai — Safe Expressions for Rules, Filters, and Templates
At first glance, that looks very interesting for us. It's a currently maintained library for exactly the sort of purpose we are looking for. It is extensible, and, whilst not a complete sandbox, it does provide some protections against unsafe expressions.
So now I'm playing the 'what if' game.
Such as:
- What if we can spot if an expression is jsonata or not - and pass it to the corresponding evaluation engine.
- Then we wouldn't need to add a new expression type for end users to get confused by
- We could deprecate JSONata usage and begin a migration to a new thing
Its late on a Friday afternoon. I don't know if this is sensible or not, but wanted to get it shared here for others to comment.

