jreijn / spring-comparing-template-engines

Demo project to show different Java templating engines in combination with Spring MVC
Apache License 2.0
422 stars 116 forks source link

Bump htmlflow from 3.5 to 4.0 #93

Closed dependabot[bot] closed 1 year ago

dependabot[bot] commented 1 year ago

Bumps htmlflow from 3.5 to 4.0.

Release notes

Sourced from htmlflow's releases.

HtmlFlow-4.0

  • Replace DynamicHtml and StaticHtml by new HtmlView and HtmlDoc. Both inherit from new HtmlPage type.

  • The factory methods DynamicHtml.view() and StaticHtml.view() are now part of the class HtmlFlow corresponding to its methods HtmlFlow.view() and HtmlFlow.doc().

  • Removed the HtmlWriter interface which defined the standard API (methods write and render) to any kind of HTML page in the context of HtmlFlow. Given the dynamic requirements of DynamicHtml (now called HtmlView) we need an argument model on render(model) and write(model) methods. Yet, those methods were illegal for StaticHtml (now called HtmlDoc) which does not depend on a model object given its static nature. So, the HtmlWriter disappeared and the new HtmlPage base class does not define any write/render method.

  • HtmlPage, HtmlView and HtmlDoc, none of them is no more parametrized (generic) with the type of the model. Now the model is only parametrized on the use of the builder <M> dynamic(BiConsumer<E, M> consumer), where E is the parent HTML element and M is the type of the model.

  • The model object is now passed as parameter of the consumer of a dynamic block (i.e. calling the builder .dynamic((elem, model) -> ...)). There is no more use of closures to capture the model object. Thus, the former 3.x style of dynamic block, such as:

public void template(DynamicHtml<Pet> view, Pet pet) {
    view.div().h2().dynamic(h2 -> pet.getName()).....
    ...

Is now on API 4.x:

public void template(HtmlPage view) {
    view.div().h2().<Pet>dynamic((h2, pet) -> pet.getName()).....
    ...
  • Partial (aka fragments) are the only place where we may use closure to capture a model object that has a different type from the enclosure template. In that case, remember when including that partial to use a dynamic() block to avoid storing it internally as a static HTML block and make it render whenever you call it with a model. Yet, if the partial use the same model as its container, then it should avoid the closure and use the model received on the consumer of its dynamic(cons) builder. For example, for views used inside a layout view.

  • Disappear the addPartial() builder. A partial (aka fragment) is only a consumer function of an HTML element, i.e. Consumer<E extends Element>. Thus, you may simply combine partials through higher-order functions composition. The element is the parent HTML where HtmlFlow will continue to emit HTML. We may also use consumers with additional arguments corresponding to models (i.e. context objects) used in the partial view (i.e. HTML fragment).

HtmlFlow-3.7

Support #75 When parent template is initialized with a PrintStream, any internal use of addPartial() should use implicitly that PrintStream regardless the output approach defined on the partial view instantiation.

This feature implies a couple of new internal methods including a newby() in HtmlVisitor that creates a new instance of same type and keeping indentation.

HtmlFlow-3.6

Fix code Smells on Generics and other uses cases. Update Junit release to suppress reported vulnerability. #68

Commits
  • 4cd7f0f [maven-release-plugin] prepare release htmlflow-4.0
  • 3e931f9 Replace HtmlApiFaster snapshot by release dependency.
  • 3e24b0f Prepare for 4.0
  • 132707c Merge branch 'development'
  • f1eedfb Add missing asynchronous-html-views on TOC
  • 00822d2 Update Table of Contents
  • 9a3664b Update conform to new XsdAsmFaster version 10.
  • c1d8720 Merge pull request #88 from Raidline/task/improve-html-flow-architecture
  • 8daf990 Minor Fix miss System.
  • e978ff5 Fix text and samples for new HtmlFlow, HtmlPage and HtmView. New sample for H...
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Vest commented 1 year ago

Don't accept this PR, because it introduced the breaking change. The DynamicView class doesn't exist anymore.

jreijn commented 1 year ago

Thanks for the heads-up @Vest the PR build check has also failed. It was one of the reason why I started adding the PR GitHub actions workflow for test for the different template engines.

Vest commented 1 year ago

Closed, because of #96

dependabot[bot] commented 1 year ago

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.