<div dir="ltr"><div><div><div>I think there is a pretty fundamental issue we need to figure out, the solution to several of the issues you pointed out depends on this.<br><br>Should activities be each a separate web application or should all the part of the Sugar web application? Or more technically, should they have the same origin or each a different one?<br>
<br></div>That has major consequences. For example a different origin gives each a separate LocalStorage, which is great for security and namespacing but makes, for example, communicating the xo color more complicated. A lot of others standard web APIs are affected by the origin.<br>
<br></div>Security aside, this also affects how activities are "deployed". Do we want to be able to run activities from a different web server or must everything come from the same? If we want different web servers than I guess we are sort of forced into multiple origins (though you could still download a bundle from a different server and install on the main one).<br>
<br></div>For what it's worth in Sugar 0.100 each web activity has a different origin.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 14 November 2013 10:03, Lionel Laské <span dir="ltr"><<a href="mailto:lionel@olpc-france.org" target="_blank">lionel@olpc-france.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US">Hi all,</p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US"> </p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US">Thanks a
lot for your messages regarding my work. Very appreciate to see enthusiasm
here.</p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US">I'm
opening a different thread to talk about technical issues.</p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US"> </p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US">Technically
speaking my prototype is three things:</p>
<ul style="margin-left:0.375in;direction:ltr;margin-top:0in;margin-bottom:0in" type="disc"><li style="margin-top:0px;margin-bottom:0px;vertical-align:middle" lang="en-US"><span style="font-family:Calibri;font-size:11pt">A Sugar Web Activities that
mimic the desktop. This "activity" use the Sugar Web Framework
(toolbar, xocolor, …) and is written using Enyo Framework (not the better
JavaScript framework but it's my favorite one :-). The framework is
"dynamic" so adding new activities is very easy (see here [4]).
In fact, I hope to integrate a mechanism to install new activity from the
desktop.</span></li><li style="margin-top:0px;margin-bottom:0px;vertical-align:middle" lang="en-US"><span style="font-family:Calibri;font-size:11pt">A directory name
"activities" where I've unzip the content of .XO files for all
web activities currently on Sugar App Store. The desktop activity just
switch from an activity to another [5].</span></li><li style="margin-top:0px;margin-bottom:0px;vertical-align:middle" lang="en-US"><span style="font-family:Calibri;font-size:11pt">A PhoneGap encapsulation that
allow to generate the Android APK. BTW because I'm using PhoneGap Build
[1], it will also generate other platforms (iOS, webOS, …).</span></li></ul>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US"> </p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US">Here are
the major issues I've faced building the prototype (all source code is here
[2]):</p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US"> </p>
<ul style="margin-left:0.375in;direction:ltr;margin-top:0in;margin-bottom:0in" type="disc"><li style="margin-top:0px;margin-bottom:0px;vertical-align:middle" lang="en-US"><span style="font-family:Calibri;font-size:11pt">Multiple copy of Sugar
Framework in each activity. My work was mostly a way to group existing
Sugar Web activities. BTW I need to upgrade a part of the Sugar Web
Framework to implement few features (Stop button, XO Colors, …). This
upgrade concern today the bus.js file (most of the hack is here [3]) but
this file is copied in each web activities :-( So I had to upgrade this
file in each activity directory. I think we must find a way to allow the
Sugar Web Framework to be deployed/referenced one time only.</span></li><li style="margin-top:0px;margin-bottom:0px;vertical-align:middle" lang="en-US"><span style="font-family:Calibri;font-size:11pt">Server side stuff. Today the
Sugar Web Framework use Web Sockets to communicate with the system layer.
It's good when running on Sugar but it's not a good idea in a Web-Browser
only world because you can't have a process to listen Web Sockets. I think
we should imagine a way to have a Sugar Web Framework that could work in
stand-alone mode (without any server side). For example by using directly
LocalStorage instead of waiting for a bus call. It's what I've done to
retrieve xocolor [6]</span></li><li style="margin-top:0px;margin-bottom:0px;vertical-align:middle"><span style="font-family:Calibri;font-size:11pt" lang="en-US">HTML5
compatibility issues. Running existing Sugar Web Activities on tablets (XO
Tablet and Samsung GalaxyTab) raise some issues regarding HTML5
compatibility. Specifically some features (CustomEvent object, Blob
object, </span><span style="font-family:Calibri;font-size:11pt" lang="fr">window.webkitRequestAnimationFrame,
…) </span><span style="font-family:Calibri;font-size:11pt" lang="en-US">used
by the framework or by activities don't work everywhere due to WebKit
compatibility. I think we should isolate these features (or avoid using
it). Of course one another major issue is that the screen size could be
very different from a device to another. Unfortunately activities are
often linked to the XO screen size.</span></li><li style="margin-top:0px;margin-bottom:0px;vertical-align:middle" lang="en-US"><span style="font-family:Calibri;font-size:11pt">Environment. The Sugar Web
Framework use an environment object (env.js), it seems to be used to
detect the current platform but that I don't understand exactly how it
works. Any explication regarding this point will be appreciate.</span></li></ul>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US"> </p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US">Hope to
have your proposal or feedbacks.</p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US">Do not
hesitate to ask me for more.</p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US"> </p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US"><span> </span>Lionel.</p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US"><span> </span></p>
<p style="margin:0in;font-family:Calibri;font-size:11pt" lang="en-US"> </p>
<p style="margin:0in;font-family:Calibri;font-size:11pt"><span lang="en-US">[1]
</span><a href="https://build.phonegap.com/" target="_blank"><span lang="fr">https://build.phonegap.com/</span></a></p>
<p style="margin:0in;font-family:Calibri;font-size:11pt"><span lang="en-US">[2]
</span><a href="https://github.com/llaske/SugarWebUI" target="_blank"><span lang="fr">https://github.com/llaske/SugarWebUI</span></a></p>
<p style="margin:0in;font-family:Calibri;font-size:11pt"><span lang="en-US">[3]
</span><a href="https://github.com/llaske/SugarWebUI/blob/master/lib/sugar-web/bus.js#L150" target="_blank"><span lang="fr">https://github.com/llaske/SugarWebUI/blob/master/lib/sugar-web/bus.js#L150</span></a></p>
<p style="margin:0in;font-family:Calibri;font-size:11pt">[4] <a href="https://github.com/llaske/SugarWebUI/blob/master/js/settings.js#L5" target="_blank">https://github.com/llaske/SugarWebUI/blob/master/js/settings.js#L5</a></p>
<p style="margin:0in;font-family:Calibri;font-size:11pt">[5] <a href="https://github.com/llaske/SugarWebUI/blob/master/js/settings.js#L65" target="_blank">https://github.com/llaske/SugarWebUI/blob/master/js/settings.js#L65</a></p>
<p style="margin:0in;font-family:Calibri;font-size:11pt">[6] <a href="https://github.com/llaske/SugarWebUI/blob/master/lib/sugar-web/bus.js#L168" target="_blank">https://github.com/llaske/SugarWebUI/blob/master/lib/sugar-web/bus.js#L168</a></p>
<br></div>
<br>_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Daniel Narvaez<br>
</div>