Replies: 6 comments 4 replies
-
I would probably vote yes, but since you are pretty serious about 1.0 guarantees, I've made a quick pass through API and here are some unsorted comments that I've got after reading.
MoreJStashioFilterI'm not really a user of jstachio, but from reading the docs I'm not sure what exactly Escaper::applyI'm not sure what
But I'm not sure where the |
Beta Was this translation helpful? Give feedback.
-
I always forget to annotate functional interfaces. I will add that.
The reason they are that way is to support zero dependency mode. See https://jstach.io/jstachio/io.jstach.jstache/io/jstach/jstache/JStacheType.html#STACHE
Then if no time is found it would have to be nullable. Currently -1 is used for that case. Secondly File returns long: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/File.html#lastModified() Normally I would agree though.
It is not a pure function. That is the point. It mutates an appendable. However an Escaper can act like a pure function. See: https://jstach.io/jstachio/io.jstach.jstache/io/jstach/jstache/JStacheContentType.html as well as: I will say I have been back and forth on the fence whether Your original implementation IIRC was decorating an Appendable which would have required a new Escaper being created on every call. That is part of the reason why I originally didn't plan on making JStachio focused on performance but the reality is being super fast and crushing benchmarks draws attention particularly since I think good amount of folks using this library might target native (graal vm native).
It basically is. Because of the ServiceLoader mechanism needing public access there wasn't a clean way to do hide this. Ultimately this is to support dynamic changes to the template. See: https://jstach.io/jstachio/io.jstach.opt.jmustache/module-summary.html See in normal web development you keep the server running and modify the template over and over. Ideally we would run a compiler and compile the template and have a special class loader similar to how JSP and various others work to support such. However this is non trivial in part because of annotation processing. Luckily Mustache is a pretty simple language and JMustache happens to almost be equivalent to JStachio when setup correctly including even whitespace handling (which btw was the biggest pain in the ass). In the long run I plan on rewriting the tokenizer and separating it out so that we can implement our own reflection based jstachio that mirrors all the functionality in static generated jstachio. Anyway I have purposely kept JStachioFilter pretty vague at the moment. I suppose I could go into more detail with it but I doubt most will use it. I chose its name because its analogous to a servlet filter. That being said it could be useful for caching or perhaps whitespace removal (ie make rendered HTML smaller). The other option was decorating a |
Beta Was this translation helpful? Give feedback.
-
Maybe we should add a Javadoc comment on the class that says that it is internal API that is required for SPI implementation, so that people are less likely to rely on it for now... |
Beta Was this translation helpful? Give feedback.
-
"Modern API" uses |
Beta Was this translation helpful? Give feedback.
-
maybe merge
|
Beta Was this translation helpful? Give feedback.
-
@sviperll I have improved some of the doc on Escaper and Formatters as well as Appender. Appender is sealed now so it really doesn't matter that it is exposed. I know why I did not make I don't think it is good idea for longevity of the API to allow:
Instead they should always:
As for |
Beta Was this translation helpful? Give feedback.
-
@dsyer @sviperll
I would like to release 1.0.0.
I think it is finally ready to seal the API. Once 1.0.0 is released changes will be done through a more PR model including even myself.
Please kick the tires if you can particularly the documentation. I'm sure there are typos but one I'm most concerned with is glaring API issues.
The documentation is here:
https://jstach.io/jstachio/
It's entirely Javadoc driven.
Regardless thank you guys for all the help.
0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions