Re #2, for me this is interesting for performance than anything else. Ie
loading only what is needed, when needed.

David, do you have a link or anything for closure modules by any chance?
Despite being a search company, I've found it difficult to turn up much in
the way of documentation. I did see goog.module.* especially
goog.module.ModuleLoader and goog.module.ModuleManager in the reference,
but I find references alone difficult to use to figure out how to actually
use something.
It looks like this should enable #2, but I don't know how to actually do it.

On Mon, 12 Jan 2015 01:32 David Nolen <[email protected]> wrote:

> 2 is out of scope wrt. compiler support. But as far as I know this is
> something that should be solvable on your own with Closure Modules.
>
> On Sunday, January 11, 2015, Mike Haney <[email protected]> wrote:
>
>> There are 2 use cases I would like to see supported by this:
>>
>> 1) generating multiple apps from the same code base.  For my current
>> project, there is the main web app, an admin interface, and a mobile
>> (Cordova) version.  There is a lot of shared code, and currently I am just
>> cheating and building one big app with 3 different entry points.  This
>> isn't sustainable, particularly on mobile where I'm loading a ton of
>> unnecessary code.  Currently, the only ways I know to address this are a)
>> split the shared code out to libraries, which is less convenient for
>> development or b) switch to shadow-build, which requires learning yet
>> another build tool.
>>
>> 2) it would also be nice to dynamically load modules as needed, such as
>> the first time the user navigates to a particular section of the app.
>> Another application of this would be loading modules based on user
>> permissions.  I can hide restricted areas and do runtime checks, but if the
>> code is there for stuff the user isn't allowed to do, then there is always
>> a risk of hacking.  It would be better to only load the code if the user is
>> authorized.
>>
>> From your short description, #1 seems very plausible.  I'm not sure if #2
>> can be done, even with what you are describing.  I remember some time ago
>> reading about limitations in Closure itself not being able to dynamically
>> load modules after the page had loaded.  Maybe that has been fixed in later
>> versions, not sure.
>>
>> --
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "ClojureScript" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/clojurescript.
>>
>  --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/clojurescript.
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to