Uploaded image for project: 'Magnolia pages module'
  1. Magnolia pages module
  2. PAGES-211

Investigate: Extract GWT page-editor for standalone inclusion

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Neutral Neutral
    • None
    • None
    • None
    • None
    • HL & LD 25, HL & LD 26, HL & LD 27
    • 8

      TODO:

      Evaluate the extracted GWT page editor. 

      • What additional tasks woudl be required to take this approach?
      • What is the estimated effort for these tasks?

       

      This proposal aims at reusing the GWT Page Editor purely from the client-side, i.e. decoupling it from the Vaadin connector and RPC communication (aka Magnolia 4.5 style).

      This way the current Page Editor can be shipped and included as an NPM module.

      Cross-domain interaction with the Pages app goes through postMessage to communicate first with Vaadin's client-side connector, itself relaying interaction to Magnolia server-side components.

      Motivation

      We foresee external SPAs will be the most common case for editing SPAs from Magnolia, either pointing to a local development server, or a production environment.

      Reasoning

      The proper way to move forward with cross-domain iframe communication is to leverage the postMessage mechanism.

      Re-implementing the whole page-editor according to this bore too much uncertainty, mostly about the logic for green bar creation/injection and focus model.
      This approach preserves these two parts, and only introduces post-message communication for server-side/Vaadin interaction, such as opening dialogs, adding/moving/deleting components, etc.

      So far, without this, we have a couple approaches, all of them with certain caveats:

      1. serving SPA internally from Magnolia web-resources itself:
        • "poor man's" solution for static content (pull everything from resources servlet)
        • implies synchronization overhead/copy-pasta
        • enforces magnolia light-module structure onto the frontend project
      2. serving SPA with the SPA renderer
        • needs to provide local JS/CSS bundle(s)
        • for local development, same as #1 (copy most of the project to webresources)
      3. serving SPA with Magnolia acting as a proxy
        • unreliable and cumbersome to set up, especially when project already fetches resources from multiple domains/sub-domains, or already has CSPs in place. See DEV-1353.

      Prototype Implementation

      Successful PoC for the standalone page-editor part, pending implementation for communication part.
      Check with Mika directly

        Acceptance criteria

              rsiska Robert Šiška
              mgeljic Mikaël Geljić
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoR