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

WYSIWYG preparation: decide on the rendering approach

    XporterXMLWordPrintable

    Details

    • Type: Task
    • Status: CLOSED
    • Priority: Should have
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Story Points:
      2
    • Sprint:
      Sprint #124, Sprint #125, Sprint #126, Sprint #139
    • Section:
      Gutenberg
    • Track:
      Development
    • Epic Link:
    • Repositories:
      planet4-master-theme, planet4-plugin-gutenberg-blocks, planet4-plugin-gutenberg-engagingnetworks

      Description

      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.

       

      Tasks

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

       

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                pcuadrad Pablo Cuadrado
                Reporter:
                pcuadrad Pablo Cuadrado
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: