Hey all.
Answers inline :)
Er, sorry for using the l-word then ;). Not really. Using isLibrary
(maybe "isApp: false" would be more descriptive?) is just a trick to
allow the homescreen to not show apps that are just resource buckets
without having to hardcode on the homescreen app the name of the shared
file.
I still don't know how this is making more divergent the way packaged
apps work versus the rest of the web works. On the rest of the web,
currently, you can link to a shared resource on your same origin/app or
on any other origin/app you can think off. Leaving aside if it's a good
idea or practice, the fact is that you can do a
<script src="
http://code.jquery.com/jquery-1.10.1.min.js"></script> on
your real web app and it will work.
On other words, you can reuse other HTTP resources from a HTTP app just
by linking. You cannot do the same, at all, on a packaged app (that is,
you cannot reuse an app:// resource from another app:// origin). What
I'm proposing is just relaxing that restriction a little bit (we cannot
relax it completely for security reasons). So, if anything, this change
takes the packaged apps a step closer to what a real web developer would
expect.
Someone asked before about versions. For Gaia apps this problem doesn't
actually exist, because everything is packed together at build time, so
a Gaia app will work the same if the shared code is shared-by-copying as
it is now, or if it's shared-by-linking as I propose. For the rest of
the apps, well, there are a bunch of possible solutions. For example,
just prefix the shared data URLs with the version:
app://
sharedresources.gaiamobile.org/v1/js/async-storage.js
Or creating a different package for each version:
app://
sharedresources-v1.gaiamobile.org/js/async-storage.js
Again, both solutions are transparent for Gaia. The advantage for the
second one is that it's easier to selectively add (or not) some old
versions to a build.
In any case, and concerning versions, I think that the best solution
would be just to add a
app://
sharedresources.gaiamobile.org/version_info.json
and let the third party apps decide if they can work or not with
whatever version is included with the OS. Note that in most cases if
your app is designed for a more recent version of the shared resources
(when there has been changes in APIs and such) then it will probably not
work on a OS version that has an older sharedresouce, because probably
the needed underlying changes on Gecko won't exist either.
Best,
Antonio
>
> Expect my other response on the submodule v.s. repo thread.
>
> --
> Tim Guan-tin Chien, Engineering Manager and Front-end Lead, Firefox
> OS, Mozilla Corp. (Taiwan)