thymeleaf icon indicating copy to clipboard operation
thymeleaf copied to clipboard

Supporting fragments in static mode

Open xtianus opened this issue 5 years ago • 0 comments

Feature Request

Summary: I'd like "natural templates" to be fully supported

One of the main selling points of Thymeleaf is the "natural templates" feature: someone can open an html page directly in the browser and see it completely rendered. I never cared about this feature until my last project where I had to work with a remote client-side developer: he didn't need to run the server, he didn't even need to have the java sources.

There I found that in reality "natural templates" can't be used properly if your html has a bit of structure, which means using th:replace and its sisters.

In the docs you suggest the use of community tools to make fragment replacement work in static mode but I feel that, for such a strong claim as "supporting natural templates", the community tool should be integrated and officially supported.

As of now, someone willing to use natural templates has to find a working community tool that doesn't add useless code to the project and hope that it will keep working on new Thymeleaf releases. He also has to find workarounds for missing features or add them himself.

Some problems of the tool I'm using:

  • javascript in html fragments is stripped off
  • I don't think fragment parameters work at all
  • I have the feeling that markup selector syntax isn't supported
  • some more that I forgot

So please add support for static fragment replacement and make Thymeleaf an even more powerful tool.

xtianus avatar Apr 07 '19 12:04 xtianus