Review main Abandoned

56857[WIP][FEATURE] Introduce JavaScript templating engine

Oliver Hader CR 0 V 0 Hard +341 −129 updated 10/26/18, 10:15

Commit message

Most client side processing in TYPO3 use jQuery to build new DOM
elements dynamically. While this is fine for tiny adjustments it
becomes pretty difficult for applications that required much more
templating and logic such as conditional rendering or iterations.

In order to improve transparency of templating and easy the possibility
to adjust that behavior on the client side a new JavaScript templating
engine shall be introduced. Handlebars.js provides a slim and extensible
API to just provide template rendering.

Rich application frameworks (e.g. Angular, Vue, Polymer, React, ...)
would simply be too much for the first step, besides that it would
raise requirements on the build chain and lower the possibility of
extensibility through extensions at the same time. For the future it
could be considered to introduce a lightweight data-binding framework
as well - e.g. Rivet.js or similar solutions.

Besides introducing the templating engine it is already applied in the
maintenance section of the install tool to demonstrate behavior and usage.

@todo
+ structure & extend helpers
+ provide RST file explaining behavior in detail
+ adjust more Fluid/HTML templates to be based on Handlebars

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 14

Review log 913

  1. Oliver Hader uploaded patch set 1 05/04/18, 08:36

  2. TYPO3com voted on patch set 1 V -1 05/04/18, 08:45 Completed build in 08m 59s on Fri, 4 May, 10:45 AM Test Summary: 31064 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23031

  3. Oliver Hader uploaded patch set 2 05/04/18, 08:56

  4. TYPO3com voted on patch set 2 V -1 05/04/18, 09:06 Completed build in 09m 43s on Fri, 4 May, 11:06 AM Test Summary: 31064 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23032

  5. Oliver Hader uploaded patch set 3 05/04/18, 17:04

  6. Oliver Hader updated the commit message in patch set 4 05/04/18, 17:15

  7. Susi Moog uploaded patch set 5 05/05/18, 13:52

  8. TYPO3com voted on patch set 5 V -1 05/05/18, 13:52 Completed build in 07s on Sat, 5 May, 03:52 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23069

  9. Susi Moog uploaded patch set 6 05/05/18, 14:05

  10. TYPO3com voted on patch set 6 V +1 05/05/18, 14:13 Completed build in 07m 49s on Sat, 5 May, 04:13 PM Test Summary: 31154 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23070

  11. Tymoteusz Motylewski commented on patch set 6 05/08/18, 14:09

    you have made a point. indeed the code is much more readable after introducing the handlebars. Question is whether we need client side rendering at all in these places? I would prefer to go into direction of vue.js to benefit from variable binding (angular and react are too heavy and hard to glue together with other stuff we have in BE). But we would need to create a similar proof of concept first to see if vue can play nicely with require js.

    DatabaseAnalyzer.js:96

    what is the point of fetching template source code and variables via ajax and render template client side? Why not render the whole stuff in fluid server side?
  12. Oliver Hader commented on patch set 6 05/10/18, 09:12

    Tymek, thank for your feedback. I'd recommend not to use Vue.js with the scope of having (more or less) independent components. Vue.js requires an application wrapper to provide the according scope. Thus, I'd recommend to checkout Polymer and the basic W3C web components stack.
  13. Benni Mack abandoned the change 10/26/18, 10:15

    no activity for 6 months, will abandon this PoC for now.