Oh please no! NO!!!
I’ve used C#, VB4, VB6, Quick Basic, VB Script, C++, X++, PHP, Python, ,Java, Power Shell, Jinja2…
JavaScript or EMAScript is the only one that I feel like I need a secret decoder ring to understand!
I HATE JavaScript!
I think the only really annoying thing I’ve run into with Jinja is variable scope with for, where you need namespace workarounds to extract anything out of the loop.
Also don’t quite understand why almost every function is available as a filter, but some are not. For example dict would be useful as a filter.
Executing object methods as filters would also be useful, for example string methods like removeprefix or startswith. (Even though yes I know those particular methods can be accomplished with regex filters…)
At least there is now a fairly new as_function feature which let you turn a macro into a function/filter, but has to be declared every single time you need them.
Because it creates/mutates memory on the fly, which is what the restrictions in place are for.
Make a global macro for it and import it.
I’m not a huge fan of Jinja either
What bothers me in particular is the inability to easily map or transform objects, like collection|map(construct_new_object_from_properties) - or to compare two properties of the same object, such as collection|selectattr(attribute1='x', '<', attribute2='y'). But oh well, I know for a fact that Jinja is here to stay, so there’s no point yelling at clouds ![]()
Javascript replacing Jinja, hell no. I can do simple JS, however see my sig ![]()
I enjoy using Jinja, and I’ve happily moved tasks from custom integrations to just using standard automations and templates and plenty of Jinja. So, I wouldn’t want to change.
Unless it’s to Perl. ![]()