On Wed, Jan 20, 2010 at 1:11 AM, Paul Lindner <plind...@linkedin.com> wrote:

> I've been looking into the javascript code lately so we can get it ready to
> be processed by the closure compiler.  I have some changes I'd like to put
> in place that I believe would be useful:
>
> * Create a globals and/or base feature that holds the global variables,
> gadgets (for gadgets) and shindig (for internal shindig namespace).  Most
> modules would then add a dependency to this feature.  This would then allow
> for us to remove many of the duplicated lines like this:
>
>  var gadgets = gadgets || {};
>

Sounds fine. All core.* should depend on core.globals then.


>
> etc.
>
> * Try to make features 1-1 with the javascript namespace they define.
>   core.prefs -> gadgets.prefs
>   core.util -> gadgets.util
>   core.auth -> shindig.Auth
>   core.json -> gadgets.json
>   pubsub -> gadgets.pubsub
>   core.io -> gadgets.io
>   flash -> gadgets.flash
>   core.prefs -> gadgets.Prefs?
>

That was the intent w/ my previous changes, and with the exception of
core.legacy it seems this is largely done. Which one(s) am I missing?


>
> * move xmlutil from opensocial.xmlutil to shindig.xmlutil  (and any other
> pollution of the opensocial namespace)
>

+1.


>
> * Somehow maintain a closure compiler externs file  (could go hand-in-hand
> with the taming.js maintenance?)
>

taming.js's semantics are somewhat different in that they should only be
included when processing content w/ Caja. Jasvir and I have a TODO on our
plates to add that filtering.

Is your proposal to maintain a "master" externs file? Typically externs are
managed on a per-bundle basis (eg. per-feature).


>
> * To assist with exporting symbols use nomenclature like this:
>
>  gadgets.log['INFO'] = 1;
>
>  instead of gadgets.log.INFO = 1;
>
>  This signifies a namespace that should not be renamed
>
> Thoughts on any of this?  I have some patches I'm testing, more to come...
>

Sounds great, thanks for taking this up! Your thoughts on plugging Closure
Compiler dynamically into the rendering pipeline? I've long been interested
in doing so and plan to get to it if ever I can clear my current plate ;)

--j

Reply via email to