Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-4793

WYSIWYG preparation: decide on the rendering approach


    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Should have Should have
    • None
    • None
    • 2
    • Gutenberg
    • Sprint #124, Sprint #125, Sprint #126, Sprint #139

      As WYSIWYG editing happens in React components, we need to render the blocks in React as they currently look. Converting from Twig to JSX to render the WYSIWYG blocks in the editor is not a big deal, but we need to decide on how to render the blocks on the site.

      We need to evaluate the options:

      The obvious one is just porting the Twig templates to their React counterparts. This is the "nearest" iteration so to speak, GPNL is already doing it, see: https://github.com/greenpeace/planet4-gpnl-plugin-gutenberg-blocks/blob/master/templates/blocks/quote.twig

      and https://github.com/greenpeace/planet4-gpnl-plugin-gutenberg-blocks/blob/master/assets/src/blocks/Quote/js/Quote.js

      I think it's safe to go this way for now, mentioning other options just in case:

      • Shipping React to the site?
      • What about something smaller like Preact, HTM...?
      • How about just saving the static content through the save() method where possible?
      • Running a React server side renderer in the back (e.g. a Node server)? 
      • Other options...

      Document the approach in an ADR.



      • Organise a meeting to discuss approach - invite Oscar and Drik from GPNL, Cristoph from GPCH
      • Document approach in epic ticket (PLANET-4762)


            pcuadrad Pablo Cuadrado (Inactive)
            pcuadrad Pablo Cuadrado (Inactive)
            0 Vote for this issue
            0 Start watching this issue