Closed ultraq closed 7 years ago
Note that, even if you are implementing a very simplified version of the expression engine for now, you might want to take into account how Thymeleaf generally evaluates objects as boolean
for th:if
, th:unless
(you can add it to your list, it will be almost free once you have th:if
) and so.
For this, have a look at org.thymeleaf.util.EvaluationUtils#evaluateAsBoolean(...)
. And the EvaluationUtils
class in general.
Also, another suggestion: IMHO for this to be useful from the beginning, th:each
would be important. And this brings the topic of how to evaluate objects as iterables, for which you'd have to have a look at org.thymeleaf.engine.IteratedModelGatheredProcessable#computeIteratedObjectIterator(...)
th:each
is definitely useful - it just wasn't one of the tags I was using in my other project 😄
I think we need to come up with what a "minimum feature set" that we'll be happy with before we open this up to further experimentation.
Re: iterating an object and evaluating what is true/false - would we want to have the JS use the same semantics as the original Thymeleaf, or rather use the semantics that exist in the JS world already? eg: JS already has a concept of truthy/falsey, as well as what counts as iterable.
th:text
th:utext
th:if
th:attr
After implementing the above, it's time to work on getting a proper architecture going to support it being super-configurable much like how Thymeleaf is. An example app would also be useful.