tipsy / j2html

Java to HTML generator. Enjoy typesafe HTML generation.
https://j2html.com/
Apache License 2.0
765 stars 136 forks source link

Remove manual tags, use only generated tags #187

Closed obecker closed 3 years ago

obecker commented 3 years ago
tipsy commented 3 years ago

restore compatibility with j2html 1.4.0

Nice ! Providing this is merged, should I release 1.5.0 tomorrow?

obecker commented 3 years ago

@tipsy I have no concerns. However, I wonder if there is a CHANGELOG (didn't found one). The new release would not be 100% compatible. For example, I'm using the type ContainerTag, which is now a generic type. So the compiler will show compile warnings, and if you use -Werror as compiler flag (like I do), the compiler will even stop with an error. This is not a big deal and can easily be fixed, but I think it should be documented somewhere. Also the examples in the documentation (https://j2html.com/examples.html) should reflect the new type system (instead of just Tag it should be Tag<?> or more specific InputTag/ButtonTag). And finally the example demonstrating the Config class needs an update.

obecker commented 3 years ago

Done. I wonder if it makes sense to remove that generated subpackage altogether and have all classes simply in specialized? Anyway, for a 2.* version I would like to turn code_gen into a maven (or gradle) plugin that generates its code into src/generated/java which is not under git control. Then we might reconsider an appropriate package structure.

sembler commented 3 years ago

It does make sense to discard the extra layer in the package hierarchy, and I'd approve if you wanted to before releasing 1.5. Doing code generation as a build step would be an excellent step forward as well.