-
Task
-
Resolution: Done
-
Neutral
-
None
-
None
-
None
-
None
-
-
Empty show more show less
-
Empty show more show less
-
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:
- 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
- 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)
- 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