[Neos] Why no iframe in the "backend" editing mode?

Stefan R. rumzucker at gmail.com
Sat May 10 00:51:22 CEST 2014


> Anyway it has to be based on a messaging approach between the main and content windows instead of the current data-binding. But also that would be beneficial to decouple the UI components in a better way.

I wouldn't actually say that there has to me a messaging approach. Data binding with a shared scope among parent window and iframe is still a good option I guess. Unless there would be some good reason why messages are needed.

I created a little example using AngularJS which demonstrates how I imagine this could work.

h_ttp://jsfiddle.net/stefanr/v37F7/1/

(Please remove the "_" -> You cannot use links until you have posted more than 3 messages.)

(Tested in Chrome, Firefox and IE 11)

> I have made some bad experiences with restrictions of IFrames (even on the same origin) in the past.
> That's a while ago already and the support is probably much better today.

I'm aware that there may arise several problems but I still think that the benefits of this method would certainly be worth trying something in that direction.

> I just want to field another idea anyways:
> With Web Components most of the drawbacks you correctly observed would be obsolete (especially with Shadow DOM and encapsulated CSS/JS) and it would probably be easier to migrate to WC than to IFrames.

Of course web components are a cool thing and definitely something worth using in the future but as far as I know web components do not encapsulate JS but only CSS and events coming from the shadow DOM.

Anyway I still think that this is a different use case and an iframe would be the better approach to solve this. Web components are great for building something out of several pieces that are reusable but having all that problems I mentioned above and considering the current specification of web components an iframe is the better choice I would say.

In iframes you can (which web components can't, if I'm correct):
- separate JS and at the same time share scopes/objects
- load external JS and CSS
- use media queries
- no need to adapt original CSS written for the frontend style

> Maybe talk to the guys from TYPO3 CMS about the problems with iframes in 
> the backend interface. Of course there are more iframes in CMS, but 
> nonetheless there are plenty of issues with cross frame scripting, 
> multiple loading of libraries, etcetera.

I'd really like to hear of their encountered problems. But I think that this is a different use case. In TYPO3 CMS the iframes belong to the same user interface building the backend, whereas in Neos the iframe would just give a view to the acutal frontend and extend it with functionality bound to the backend.

Loading libraries and stuff wouldn't be such a big problem I would say.

I'm sure there are still plenty of issues with cross frame scripting but shouldn't it be at least worth trying? ;)

Stefan


More information about the Neos mailing list