Running an RWW app on an iframe?

Hi


Imagine the following scenario:
- User is using a browser
- User receives an RDF resource URL
- User opens the RDF resource in its browser
- This makes a request to our server
(rww-play<https://github.com/stample/rww-play>)
with a header "Accept: text/html, */*" or something similar...



In rww-play <https://github.com/stample/rww-play> we are using some generic
platform code. We don't serve RDF data to a browser unless he explicitly
ask for it. So in this case we load an html file and js code that will
refetch the same url again, this time asking for RDF format.
By looking at what's inside the RDF we can choose through a mapping an
appropriate RWW application that can decently render the RDF graph.
Idealy it would be nice that an user could store in its own data which is
app is the most appropriate for him to render this kind of graph. This is
what Andrei has also done in ld-cal
<https://github.com/rww-apps/ld-cal>for exemple.
Like on a regular filesystem/OS, one can choose to open a .doc with
OpenOffice or Word, and can make the opening with Word the default...



This RWW application is loaded dynamically and has its own kind of
libraries.
The problem I see here is that as we have generic html / js code that
fetches the graph in RDF form, then when loading dynamically the app there
may be library conflicts or things like that.

For exemple if the generic HTML code is using RDFLib 2.0 and the RWW app is
using RDFLib 1.0 it may (?) be a problem to execute this in the same html
page.

Do you think it could be a good idea to launch the RWW app in its own
full-screen iframe so that there's no possible conflict? What would be the
problems?
Some don't like iframes for good reasons like bookmarks or things like
that.  But as we already have discussed there are already open questions
related to bookmarks specific to RWW and they may need to be handled in the
application directly instead of the browser address bar


Is there another way, without using iframes, to provide a clean env to the
RWW app?
We are currently trying to use requirejs for that. But what I don't like
with using require in the RWW app is that it's not the platform that
guarantees a clean execution context (I mean, no JS lib loaded in the
page), it is rather the RWW app that knows that the execution context can
be dirty and try to bypass this.


Also, maybe it's not such a big problem because once the RWW app libs are
loaded dynamically, the generic code doesn't need to run again. I think the
last loaded js libs override the previous ones so the RWW app may be able
to execute correctly in any case.


What do you think?

Received on Monday, 3 February 2014 10:38:41 UTC