Skip to content

Support JavaScript Templating [SPR-12266] #16871

Closed
@spring-projects-issues

Description

@spring-projects-issues

marc schipperheyn opened SPR-12266 and commented

These days platforms like react.js, webcomponents, angular.js and Node.js are pushing the boundaries of our conception of what a web client is to new levels.

In recent years, web clients have gotten more and more powerful and consequently pushed more functionality to that frontend.

Json has become the defacto standard for interacting with a backend such as provided by Spring.

With Node.js, javascript moved to the serverside offering some significant advantages in performance and the use of identical content templates for both frontend and serverside processing.

Micro templates have also become relevant. One challenge that we are dealing with is that our freemarker heavy backend is lifting a lot of processing weight that we also want to happen on the javascript frontend, requiring in essence: duplication of logic.

If you have a heavy investment in Spring with template languages such as freemarker and JSP, you will find that Spring is not keeping up with this revolution. It's still fully "page oriented". Sure, if we're just talking about json, @ResponseBody and all the supporting infrastructure help you process json excellently.

But when it comes to avoiding duplication in the combination of server-side template code and client side rendering, ie Node.js style processing, and basically: how Spring MVC fits into a heavy Javascript client world, you'll be hard put to find any documentation at all. It's either @ResponseBody or Freemarker/Velocity/JSP/etc.

Spring is not bridging the gap between the raw json response and serverside rendering of the template as Node.js is doing.

I think Spring should offer a strategy and guidance in this respect. IMHO this doesn't mean offering a prescribed technology stack, although an opinionated approach in this area would be a relevant "add-on". But I do think that offering both technology and documentation on server-side processing vs client-side processing, micro template languages (DUST, Handlebars, JSX, etc) would make a lot of sense in order to keep Spring relevant. It could even be documenting how to integrate Node.js with a Spring backoffice.

Spring has always excelled in making complex combinations of technologies easy to use. In this new arena of javascript heavy clients, there's a gap in this aspect. Let's face it, the View technologies part of the Spring documentation is hopelessly outdated and represents a view of the web that is rapidly disappearing.


Affects: 4.1.5

Issue Links:

9 votes, 26 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: documentationA documentation tasktype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions