Open mhsdesign opened 2 years ago
I think I removed already all content scripts tags in a PR as they were not needed anymore since I refactored the content tree. Have to check again.
Thanks for writing this up @mhsdesign :rocket: . I always have all this stuff floating around in my head and I never get around to writing it down :sweat_smile: .
Some additions:
RE @mhsdesign:
html comments for marking content elements and inline editables
This is what I call "minimally invasive content element wrapping". I'm planning on creating an experimental PR for this soonish. It can be done independently from the other ones and would imho be a huge improvement.
RE @mhsdesign:
why should the ckeditor live inline in the iframe and the structured https://github.com/Flowpack/Flowpack.StructuredEditing inline editor be in the host -> where is the line
@mficzel and @dfeyer both have played with the idea of providing our editors (as in @neos-project/neos-ui-editors
) as web components for general use. This is primarily meant for integration with backend modules, but I think it could be designed in a way that covers inline editing as well.
Strictly speaking, all inline editors would live in the guest frame, but all would be built from one code base and isolated from other guest frame contents.
RE @Sebobo:
I think I removed already all content scripts tags in a PR as they were not needed anymore since I refactored the content tree. Have to check again.
I think so too.
However, the guest frame still contains a global window['@Neos.Neos.Ui:DocumentInformation']
object that is being evaluated as plain JavaScript atm. A slight performance improvement could be achieved by reading this as plain JSON instead, because as it turns out JSON.parse
can be up to 2x faster than parsing the same chunk of text as JavaScript (see: https://v8.dev/blog/cost-of-javascript-2019#json).
Iframe post-message communication
this initial goal of mine doesnt seem to be easily reachable as we initialize the ckeditor from the host. This is important as we can easily register plugins. So for a headless approach we require the use of a proxy to avoid cross origin domain problems.
We would feel more confortable with a html comment based api between host and iframe which should also become documented api for the usecase of headless cms.
Regarding "Minimally Invasive Content Element Wrapping": I've started working on this a while ago (though I'm stuck). In the end there are supposed to be 2 PRs. One's for neos-development-collection
:
https://github.com/neos/neos-development-collection/compare/8.3...grebaldi:neos-de[…]on:proof-of-concept/minimally-invasive-content-element-wrapping
This one changes the way in which Fusion handles Content Collections. It also creates a basis for a slightly better integration of Content Element Wrapping in general, so that this is no longer done via an Aspect in neos-ui
.
The second PR's for neos-ui
:
https://github.com/neos/neos-ui/compare/8.3...grebaldi:PackageFactory.Guevara:proof-of-concept/minimally-invasive-content-element-wrapping
This one is supposed to handle the parsing of HTML comments and initialization of content element DOM nodes. I've been working in an explorative manner around this, and still haven't settled the overall approach and architecture, but the basic principle is probably visible in the code.
I'm currently working on dropping the script tags for content nodes completely in https://github.com/neos/neos-ui/pull/3770
This is @grebaldi idea - im just trying to document it ^^
the current state of inline communication could be improved.
currently
Currently, a div is wrapped around the CE to tell the UI which node it came from, and also attaches a script tag that is used for details of the node for the UI.
proposed
3 major improvements which are:
the content element wrapping will consist of gt l comment start and en markers (and doesnt need to wrap a div element if there are multiple roots) The content element outline will be done in the host frame with javascript positioning (where we can calculate the total height of an component)
pro
see what storyblok does
copied from the docs at https://www.storyblok.com/docs/guide/essentials/visual-editor#enabling-click-events-on-your-html-elements:
... wip
contra