You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by David Mark Byttow <da...@google.com> on 2008/07/01 21:42:09 UTC

Feedback requested: Initial design ideas for OpenSocial Templates implementation

Hi,

My colleague, Lev Epshteyn, and I have been following the spec discussions
on the OpenSocial Templates proposal (
http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates).
We think it's great how this is coming together and we have discussed some
ideas for implementing the spec on the client-side. In fact, we have also
made some good headway in coding up a prototype around one of them. We'd
like to get broader input from shindig-dev and discuss next steps.

At the core of our design is an open source technology called JSTemplate (
http://code.google.com/p/google-jstemplate/). This technology has been used
for a few years in various parts of Google Maps, and is pretty mature. It
has been released by Google under the Apache 2.0 license recently. To sum it
up, JSTemplate uses special attributes on the DOM nodes to process
instructions. For example:

The following HTML:
  <a jsvalues="href:url" jscontent="anchor"></a>

Supplied the following JSON data:
  { url: "http://foo.com", anchor: "bar" }

Becomes:
   <a href="http://foo.com">Bar</a>

One primary, but easily overlooked advantage of JSTemplate is that it has
been heavily optimized for performing well in different browser environments
and operates purely on the browser's DOM. Its disadvantage is that the
library syntax is much less accessible than the spec developed for
OpenSocial.

Our idea has been to create a "compiler" which will transform templates
written in OpenSocial format into DOM trees that can be used by JSTemplate.
This way, once a template is "compiled", it can be rendered any number of
times by the mature rendering core of JSTemplate.

A simple example of such compilation would transform:
  <a href="${url}">${anchor}</a>
Into the DOM snippet shown above when supplied with the same JSON data.

Our initial prototype has shown this to be a fairly straightforward process,
and we look forward to getting your thoughts and proposing some patches to
shindig.

Any thoughts?

Thanks.
David Byttow

Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by Leonardo Foderaro <st...@gmail.com>.
Hello
it seems an interesting idea.
I wrote something similar (a basic client side search-and-replace
engine) for my company.
and, for a funny coincidence, it has been used in our "maps" platform lol.
could make sense a server side version? (like a flex-bison tool..) or
would it be just another template engine?






On Tue, Jul 1, 2008 at 9:42 PM, David Mark Byttow
<da...@google.com> wrote:
> Hi,
>
> My colleague, Lev Epshteyn, and I have been following the spec discussions
> on the OpenSocial Templates proposal (
> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates).
> We think it's great how this is coming together and we have discussed some
> ideas for implementing the spec on the client-side. In fact, we have also
> made some good headway in coding up a prototype around one of them. We'd
> like to get broader input from shindig-dev and discuss next steps.
>
> At the core of our design is an open source technology called JSTemplate (
> http://code.google.com/p/google-jstemplate/). This technology has been used
> for a few years in various parts of Google Maps, and is pretty mature. It
> has been released by Google under the Apache 2.0 license recently. To sum it
> up, JSTemplate uses special attributes on the DOM nodes to process
> instructions. For example:
>
> The following HTML:
>  <a jsvalues="href:url" jscontent="anchor"></a>
>
> Supplied the following JSON data:
>  { url: "http://foo.com", anchor: "bar" }
>
> Becomes:
>   <a href="http://foo.com">Bar</a>
>
> One primary, but easily overlooked advantage of JSTemplate is that it has
> been heavily optimized for performing well in different browser environments
> and operates purely on the browser's DOM. Its disadvantage is that the
> library syntax is much less accessible than the spec developed for
> OpenSocial.
>
> Our idea has been to create a "compiler" which will transform templates
> written in OpenSocial format into DOM trees that can be used by JSTemplate.
> This way, once a template is "compiled", it can be rendered any number of
> times by the mature rendering core of JSTemplate.
>
> A simple example of such compilation would transform:
>  <a href="${url}">${anchor}</a>
> Into the DOM snippet shown above when supplied with the same JSON data.
>
> Our initial prototype has shown this to be a fairly straightforward process,
> and we look forward to getting your thoughts and proposing some patches to
> shindig.
>
> Any thoughts?
>
> Thanks.
> David Byttow
>

Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by David Byttow <da...@google.com>.
Hi all,

JS implementation of OpenSocial Templates has been submitted as a JIRA
issue. (https://issues.apache.org/jira/browse/SHINDIG-478)

David

On Wed, Jul 16, 2008 at 2:49 PM, Chris Chabot <ch...@xs4all.nl> wrote:

> Unfortunately i haven't had a lot of time to delve to deeply into it, but
> what i did look at looked good.
>
> Since this part of the template spec is already backed & voted for i'd say
> go ahead and submit the patch to Jira.
>
>        -- Chris
>
>
> On Jul 16, 2008, at 7:37 AM, David Byttow wrote:
>
>  Hi everyone,
>>
>> Quick update -- IE6 and IE7 are now supported on the OpenSocial Templates
>> proposal demo (http://ostemplates-demo.appspot.com)!
>>
>> Shall I send a patch via JIRA? Any objections to this?
>>
>> Thanks.
>> David
>>
>> On Thu, Jul 10, 2008 at 2:22 AM, David Mark Byttow <
>> davidbyttow@google.com>
>> wrote:
>>
>>  Thanks Chris!
>>>
>>> Any chance you (or anyone else) have been able to take a detailed look?
>>> I'm
>>> looking into the IE issues, but I'd also love to hear everyone's
>>> feedback.
>>>
>>> David
>>>
>>>
>>> On Fri, Jul 4, 2008 at 12:09 PM, Chris Chabot <ch...@xs4all.nl> wrote:
>>>
>>>  I'll have more detailed feedback early next week, but for now i'll stick
>>>> to: That's really impressive work!
>>>>
>>>>      -- Chris
>>>>
>>>> On Jul 4, 2008, at 8:56 PM, David Mark Byttow wrote:
>>>>
>>>> Hi all,
>>>>
>>>>>
>>>>> Here is a link to our most recent progress:
>>>>> http://ostemplates-demo.appspot.com. Currently, both Firefox and
>>>>> Safari
>>>>> are
>>>>> supported, not IE.
>>>>>
>>>>> This site contains the following:
>>>>>
>>>>> - Demonstration of templates throughout the site. In fact, the content
>>>>> is
>>>>> served via templating.
>>>>> - Sample OpenSocial reusable tags as mentioned in the OpenSocial
>>>>> Templates spec
>>>>> proposal<
>>>>>
>>>>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
>>>>>
>>>>>>
>>>>>>  .
>>>>> - Sample "friends list" gadget which can be deployed in any OpenSocial
>>>>>
>>>>> container.
>>>>> - Examples of using "template libraries".
>>>>> - Source code, including a single, minimized JavaScript file for use.
>>>>>
>>>>> In addition to the source, please take a look at the HTML source as
>>>>> well.
>>>>>
>>>>> Currently the source code is broken into 8 files.
>>>>>
>>>>> - *base.js* - Contains public API methods and anything else core and
>>>>> used
>>>>> throughout the library.
>>>>> - *compiler.js* - Parsing/compiling system. Functionality for parsing
>>>>> XML
>>>>> templates down to jstemplate structure and compiling the result.
>>>>> - *container.js* - Provides methods that bootstrap and hide the details
>>>>> of templates through a simpler interface with methods such as
>>>>> "processDocument", which compiles and registers all templates in the
>>>>> current
>>>>> document.
>>>>> - *loader.js* - Implements the "template library" functionality with
>>>>> XHR.
>>>>> - namespaces.js - Implements support for tag namespaces.
>>>>> - *os.js* - Provides the functionality to map properties onto
>>>>> OpenSocial
>>>>> object methods.
>>>>> - *template.js* - Implements the Template class and
>>>>> caching/registration
>>>>> mechanism.
>>>>> - *util.js* - Small utility methods used throughout the code.
>>>>>
>>>>> The readable source does not include jstemplate, the underlying library
>>>>> we
>>>>> used, though the full source code and more information can be found
>>>>> here:
>>>>> http://code.google.com/p/google-jstemplate/.
>>>>>
>>>>> We are hoping to get feedback on the approach, so please respond with
>>>>> your
>>>>> questions and comments.
>>>>>
>>>>> Thanks.
>>>>> David
>>>>>
>>>>> On Wed, Jul 2, 2008 at 5:57 PM, David Mark Byttow <
>>>>> davidbyttow@google.com>
>>>>> wrote:
>>>>>
>>>>> Hey guys,
>>>>>
>>>>>>
>>>>>> Thanks for the responses. I'm currently putting together a demo with
>>>>>> source
>>>>>> and will be sending out a link.
>>>>>>
>>>>>> David
>>>>>>
>>>>>>
>>>>>> On Tue, Jul 1, 2008 at 1:58 PM, Kevin Brown <et...@google.com> wrote:
>>>>>>
>>>>>> On Tue, Jul 1, 2008 at 12:42 PM, David Mark Byttow <
>>>>>>
>>>>>>> davidbyttow@google.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>>
>>>>>>>> My colleague, Lev Epshteyn, and I have been following the spec
>>>>>>>>
>>>>>>>>  discussions
>>>>>>>
>>>>>>>  on the OpenSocial Templates proposal (
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
>>>>>>>
>>>>>>>  ).
>>>>>>>> We think it's great how this is coming together and we have
>>>>>>>> discussed
>>>>>>>>
>>>>>>>>  some
>>>>>>>
>>>>>>>  ideas for implementing the spec on the client-side. In fact, we have
>>>>>>>>
>>>>>>>>  also
>>>>>>>
>>>>>>>  made some good headway in coding up a prototype around one of them.
>>>>>>>> We'd
>>>>>>>> like to get broader input from shindig-dev and discuss next steps.
>>>>>>>>
>>>>>>>> At the core of our design is an open source technology called
>>>>>>>> JSTemplate
>>>>>>>>
>>>>>>>>  (
>>>>>>>
>>>>>>>  http://code.google.com/p/google-jstemplate/). This technology has
>>>>>>>> been
>>>>>>>> used
>>>>>>>> for a few years in various parts of Google Maps, and is pretty
>>>>>>>> mature.
>>>>>>>>
>>>>>>>>  It
>>>>>>>
>>>>>>>  has been released by Google under the Apache 2.0 license recently.
>>>>>>>> To
>>>>>>>>
>>>>>>>>  sum
>>>>>>>
>>>>>>>  it
>>>>>>>> up, JSTemplate uses special attributes on the DOM nodes to process
>>>>>>>> instructions. For example:
>>>>>>>>
>>>>>>>> The following HTML:
>>>>>>>> <a jsvalues="href:url" jscontent="anchor"></a>
>>>>>>>>
>>>>>>>> Supplied the following JSON data:
>>>>>>>> { url: "http://foo.com", anchor: "bar" }
>>>>>>>>
>>>>>>>> Becomes:
>>>>>>>> <a href="http://foo.com">Bar</a>
>>>>>>>>
>>>>>>>> One primary, but easily overlooked advantage of JSTemplate is that
>>>>>>>> it
>>>>>>>>
>>>>>>>>  has
>>>>>>>
>>>>>>>  been heavily optimized for performing well in different browser
>>>>>>>> environments
>>>>>>>> and operates purely on the browser's DOM. Its disadvantage is that
>>>>>>>> the
>>>>>>>> library syntax is much less accessible than the spec developed for
>>>>>>>> OpenSocial.
>>>>>>>>
>>>>>>>> Our idea has been to create a "compiler" which will transform
>>>>>>>> templates
>>>>>>>> written in OpenSocial format into DOM trees that can be used by
>>>>>>>>
>>>>>>>>  JSTemplate.
>>>>>>>
>>>>>>>  This way, once a template is "compiled", it can be rendered any
>>>>>>>> number
>>>>>>>>
>>>>>>>>  of
>>>>>>>
>>>>>>>  times by the mature rendering core of JSTemplate.
>>>>>>>>
>>>>>>>> A simple example of such compilation would transform:
>>>>>>>> <a href="${url}">${anchor}</a>
>>>>>>>> Into the DOM snippet shown above when supplied with the same JSON
>>>>>>>> data.
>>>>>>>>
>>>>>>>> Our initial prototype has shown this to be a fairly straightforward
>>>>>>>> process,
>>>>>>>> and we look forward to getting your thoughts and proposing some
>>>>>>>> patches
>>>>>>>>
>>>>>>>>  to
>>>>>>>
>>>>>>>  shindig.
>>>>>>>>
>>>>>>>> Any thoughts?
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> Yes, send us the prototype :)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Thanks.
>>>>>>>> David Byttow
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>
>

Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by Chris Chabot <ch...@xs4all.nl>.
Unfortunately i haven't had a lot of time to delve to deeply into it,  
but what i did look at looked good.

Since this part of the template spec is already backed & voted for i'd  
say go ahead and submit the patch to Jira.

	-- Chris

On Jul 16, 2008, at 7:37 AM, David Byttow wrote:

> Hi everyone,
>
> Quick update -- IE6 and IE7 are now supported on the OpenSocial  
> Templates
> proposal demo (http://ostemplates-demo.appspot.com)!
>
> Shall I send a patch via JIRA? Any objections to this?
>
> Thanks.
> David
>
> On Thu, Jul 10, 2008 at 2:22 AM, David Mark Byttow <davidbyttow@google.com 
> >
> wrote:
>
>> Thanks Chris!
>>
>> Any chance you (or anyone else) have been able to take a detailed  
>> look? I'm
>> looking into the IE issues, but I'd also love to hear everyone's  
>> feedback.
>>
>> David
>>
>>
>> On Fri, Jul 4, 2008 at 12:09 PM, Chris Chabot <ch...@xs4all.nl>  
>> wrote:
>>
>>> I'll have more detailed feedback early next week, but for now i'll  
>>> stick
>>> to: That's really impressive work!
>>>
>>>       -- Chris
>>>
>>> On Jul 4, 2008, at 8:56 PM, David Mark Byttow wrote:
>>>
>>> Hi all,
>>>>
>>>> Here is a link to our most recent progress:
>>>> http://ostemplates-demo.appspot.com. Currently, both Firefox and  
>>>> Safari
>>>> are
>>>> supported, not IE.
>>>>
>>>> This site contains the following:
>>>>
>>>> - Demonstration of templates throughout the site. In fact, the  
>>>> content
>>>> is
>>>> served via templating.
>>>> - Sample OpenSocial reusable tags as mentioned in the OpenSocial
>>>> Templates spec
>>>> proposal<
>>>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
>>>>>
>>>> .
>>>> - Sample "friends list" gadget which can be deployed in any  
>>>> OpenSocial
>>>>
>>>> container.
>>>> - Examples of using "template libraries".
>>>> - Source code, including a single, minimized JavaScript file for  
>>>> use.
>>>>
>>>> In addition to the source, please take a look at the HTML source  
>>>> as well.
>>>>
>>>> Currently the source code is broken into 8 files.
>>>>
>>>> - *base.js* - Contains public API methods and anything else core  
>>>> and
>>>> used
>>>> throughout the library.
>>>> - *compiler.js* - Parsing/compiling system. Functionality for  
>>>> parsing
>>>> XML
>>>> templates down to jstemplate structure and compiling the result.
>>>> - *container.js* - Provides methods that bootstrap and hide the  
>>>> details
>>>> of templates through a simpler interface with methods such as
>>>> "processDocument", which compiles and registers all templates in  
>>>> the
>>>> current
>>>> document.
>>>> - *loader.js* - Implements the "template library" functionality  
>>>> with
>>>> XHR.
>>>> - namespaces.js - Implements support for tag namespaces.
>>>> - *os.js* - Provides the functionality to map properties onto  
>>>> OpenSocial
>>>> object methods.
>>>> - *template.js* - Implements the Template class and caching/ 
>>>> registration
>>>> mechanism.
>>>> - *util.js* - Small utility methods used throughout the code.
>>>>
>>>> The readable source does not include jstemplate, the underlying  
>>>> library
>>>> we
>>>> used, though the full source code and more information can be  
>>>> found here:
>>>> http://code.google.com/p/google-jstemplate/.
>>>>
>>>> We are hoping to get feedback on the approach, so please respond  
>>>> with
>>>> your
>>>> questions and comments.
>>>>
>>>> Thanks.
>>>> David
>>>>
>>>> On Wed, Jul 2, 2008 at 5:57 PM, David Mark Byttow <
>>>> davidbyttow@google.com>
>>>> wrote:
>>>>
>>>> Hey guys,
>>>>>
>>>>> Thanks for the responses. I'm currently putting together a demo  
>>>>> with
>>>>> source
>>>>> and will be sending out a link.
>>>>>
>>>>> David
>>>>>
>>>>>
>>>>> On Tue, Jul 1, 2008 at 1:58 PM, Kevin Brown <et...@google.com>  
>>>>> wrote:
>>>>>
>>>>> On Tue, Jul 1, 2008 at 12:42 PM, David Mark Byttow <
>>>>>> davidbyttow@google.com>
>>>>>> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>>
>>>>>>> My colleague, Lev Epshteyn, and I have been following the spec
>>>>>>>
>>>>>> discussions
>>>>>>
>>>>>>> on the OpenSocial Templates proposal (
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
>>>>>>
>>>>>>> ).
>>>>>>> We think it's great how this is coming together and we have  
>>>>>>> discussed
>>>>>>>
>>>>>> some
>>>>>>
>>>>>>> ideas for implementing the spec on the client-side. In fact,  
>>>>>>> we have
>>>>>>>
>>>>>> also
>>>>>>
>>>>>>> made some good headway in coding up a prototype around one of  
>>>>>>> them.
>>>>>>> We'd
>>>>>>> like to get broader input from shindig-dev and discuss next  
>>>>>>> steps.
>>>>>>>
>>>>>>> At the core of our design is an open source technology called
>>>>>>> JSTemplate
>>>>>>>
>>>>>> (
>>>>>>
>>>>>>> http://code.google.com/p/google-jstemplate/). This technology  
>>>>>>> has
>>>>>>> been
>>>>>>> used
>>>>>>> for a few years in various parts of Google Maps, and is pretty  
>>>>>>> mature.
>>>>>>>
>>>>>> It
>>>>>>
>>>>>>> has been released by Google under the Apache 2.0 license  
>>>>>>> recently. To
>>>>>>>
>>>>>> sum
>>>>>>
>>>>>>> it
>>>>>>> up, JSTemplate uses special attributes on the DOM nodes to  
>>>>>>> process
>>>>>>> instructions. For example:
>>>>>>>
>>>>>>> The following HTML:
>>>>>>> <a jsvalues="href:url" jscontent="anchor"></a>
>>>>>>>
>>>>>>> Supplied the following JSON data:
>>>>>>> { url: "http://foo.com", anchor: "bar" }
>>>>>>>
>>>>>>> Becomes:
>>>>>>> <a href="http://foo.com">Bar</a>
>>>>>>>
>>>>>>> One primary, but easily overlooked advantage of JSTemplate is  
>>>>>>> that it
>>>>>>>
>>>>>> has
>>>>>>
>>>>>>> been heavily optimized for performing well in different browser
>>>>>>> environments
>>>>>>> and operates purely on the browser's DOM. Its disadvantage is  
>>>>>>> that the
>>>>>>> library syntax is much less accessible than the spec developed  
>>>>>>> for
>>>>>>> OpenSocial.
>>>>>>>
>>>>>>> Our idea has been to create a "compiler" which will transform
>>>>>>> templates
>>>>>>> written in OpenSocial format into DOM trees that can be used by
>>>>>>>
>>>>>> JSTemplate.
>>>>>>
>>>>>>> This way, once a template is "compiled", it can be rendered  
>>>>>>> any number
>>>>>>>
>>>>>> of
>>>>>>
>>>>>>> times by the mature rendering core of JSTemplate.
>>>>>>>
>>>>>>> A simple example of such compilation would transform:
>>>>>>> <a href="${url}">${anchor}</a>
>>>>>>> Into the DOM snippet shown above when supplied with the same  
>>>>>>> JSON
>>>>>>> data.
>>>>>>>
>>>>>>> Our initial prototype has shown this to be a fairly  
>>>>>>> straightforward
>>>>>>> process,
>>>>>>> and we look forward to getting your thoughts and proposing some
>>>>>>> patches
>>>>>>>
>>>>>> to
>>>>>>
>>>>>>> shindig.
>>>>>>>
>>>>>>> Any thoughts?
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Yes, send us the prototype :)
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> Thanks.
>>>>>>> David Byttow
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>
>>


Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by David Byttow <da...@google.com>.
Hi everyone,

Quick update -- IE6 and IE7 are now supported on the OpenSocial Templates
proposal demo (http://ostemplates-demo.appspot.com)!

Shall I send a patch via JIRA? Any objections to this?

Thanks.
David

On Thu, Jul 10, 2008 at 2:22 AM, David Mark Byttow <da...@google.com>
wrote:

> Thanks Chris!
>
> Any chance you (or anyone else) have been able to take a detailed look? I'm
> looking into the IE issues, but I'd also love to hear everyone's feedback.
>
> David
>
>
> On Fri, Jul 4, 2008 at 12:09 PM, Chris Chabot <ch...@xs4all.nl> wrote:
>
>> I'll have more detailed feedback early next week, but for now i'll stick
>> to: That's really impressive work!
>>
>>        -- Chris
>>
>> On Jul 4, 2008, at 8:56 PM, David Mark Byttow wrote:
>>
>>  Hi all,
>>>
>>> Here is a link to our most recent progress:
>>> http://ostemplates-demo.appspot.com. Currently, both Firefox and Safari
>>> are
>>> supported, not IE.
>>>
>>> This site contains the following:
>>>
>>>  - Demonstration of templates throughout the site. In fact, the content
>>> is
>>>  served via templating.
>>>  - Sample OpenSocial reusable tags as mentioned in the OpenSocial
>>>  Templates spec
>>> proposal<
>>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
>>> >
>>>  .
>>>  - Sample "friends list" gadget which can be deployed in any OpenSocial
>>>
>>>  container.
>>>  - Examples of using "template libraries".
>>>  - Source code, including a single, minimized JavaScript file for use.
>>>
>>> In addition to the source, please take a look at the HTML source as well.
>>>
>>> Currently the source code is broken into 8 files.
>>>
>>>  - *base.js* - Contains public API methods and anything else core and
>>> used
>>>  throughout the library.
>>>  - *compiler.js* - Parsing/compiling system. Functionality for parsing
>>> XML
>>>  templates down to jstemplate structure and compiling the result.
>>>  - *container.js* - Provides methods that bootstrap and hide the details
>>>  of templates through a simpler interface with methods such as
>>>  "processDocument", which compiles and registers all templates in the
>>> current
>>>  document.
>>>  - *loader.js* - Implements the "template library" functionality with
>>> XHR.
>>>  - namespaces.js - Implements support for tag namespaces.
>>>  - *os.js* - Provides the functionality to map properties onto OpenSocial
>>>  object methods.
>>>  - *template.js* - Implements the Template class and caching/registration
>>>  mechanism.
>>>  - *util.js* - Small utility methods used throughout the code.
>>>
>>> The readable source does not include jstemplate, the underlying library
>>> we
>>> used, though the full source code and more information can be found here:
>>> http://code.google.com/p/google-jstemplate/.
>>>
>>> We are hoping to get feedback on the approach, so please respond with
>>> your
>>> questions and comments.
>>>
>>> Thanks.
>>> David
>>>
>>> On Wed, Jul 2, 2008 at 5:57 PM, David Mark Byttow <
>>> davidbyttow@google.com>
>>> wrote:
>>>
>>>  Hey guys,
>>>>
>>>> Thanks for the responses. I'm currently putting together a demo with
>>>> source
>>>> and will be sending out a link.
>>>>
>>>> David
>>>>
>>>>
>>>> On Tue, Jul 1, 2008 at 1:58 PM, Kevin Brown <et...@google.com> wrote:
>>>>
>>>>  On Tue, Jul 1, 2008 at 12:42 PM, David Mark Byttow <
>>>>> davidbyttow@google.com>
>>>>> wrote:
>>>>>
>>>>>  Hi,
>>>>>>
>>>>>> My colleague, Lev Epshteyn, and I have been following the spec
>>>>>>
>>>>> discussions
>>>>>
>>>>>> on the OpenSocial Templates proposal (
>>>>>>
>>>>>>
>>>>>>
>>>>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
>>>>>
>>>>>> ).
>>>>>> We think it's great how this is coming together and we have discussed
>>>>>>
>>>>> some
>>>>>
>>>>>> ideas for implementing the spec on the client-side. In fact, we have
>>>>>>
>>>>> also
>>>>>
>>>>>> made some good headway in coding up a prototype around one of them.
>>>>>> We'd
>>>>>> like to get broader input from shindig-dev and discuss next steps.
>>>>>>
>>>>>> At the core of our design is an open source technology called
>>>>>> JSTemplate
>>>>>>
>>>>> (
>>>>>
>>>>>> http://code.google.com/p/google-jstemplate/). This technology has
>>>>>> been
>>>>>> used
>>>>>> for a few years in various parts of Google Maps, and is pretty mature.
>>>>>>
>>>>> It
>>>>>
>>>>>> has been released by Google under the Apache 2.0 license recently. To
>>>>>>
>>>>> sum
>>>>>
>>>>>> it
>>>>>> up, JSTemplate uses special attributes on the DOM nodes to process
>>>>>> instructions. For example:
>>>>>>
>>>>>> The following HTML:
>>>>>> <a jsvalues="href:url" jscontent="anchor"></a>
>>>>>>
>>>>>> Supplied the following JSON data:
>>>>>> { url: "http://foo.com", anchor: "bar" }
>>>>>>
>>>>>> Becomes:
>>>>>>  <a href="http://foo.com">Bar</a>
>>>>>>
>>>>>> One primary, but easily overlooked advantage of JSTemplate is that it
>>>>>>
>>>>> has
>>>>>
>>>>>> been heavily optimized for performing well in different browser
>>>>>> environments
>>>>>> and operates purely on the browser's DOM. Its disadvantage is that the
>>>>>> library syntax is much less accessible than the spec developed for
>>>>>> OpenSocial.
>>>>>>
>>>>>> Our idea has been to create a "compiler" which will transform
>>>>>> templates
>>>>>> written in OpenSocial format into DOM trees that can be used by
>>>>>>
>>>>> JSTemplate.
>>>>>
>>>>>> This way, once a template is "compiled", it can be rendered any number
>>>>>>
>>>>> of
>>>>>
>>>>>> times by the mature rendering core of JSTemplate.
>>>>>>
>>>>>> A simple example of such compilation would transform:
>>>>>> <a href="${url}">${anchor}</a>
>>>>>> Into the DOM snippet shown above when supplied with the same JSON
>>>>>> data.
>>>>>>
>>>>>> Our initial prototype has shown this to be a fairly straightforward
>>>>>> process,
>>>>>> and we look forward to getting your thoughts and proposing some
>>>>>> patches
>>>>>>
>>>>> to
>>>>>
>>>>>> shindig.
>>>>>>
>>>>>> Any thoughts?
>>>>>>
>>>>>
>>>>>
>>>>> Yes, send us the prototype :)
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> Thanks.
>>>>>> David Byttow
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>
>

Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by David Mark Byttow <da...@google.com>.
Thanks Chris!

Any chance you (or anyone else) have been able to take a detailed look? I'm
looking into the IE issues, but I'd also love to hear everyone's feedback.

David

On Fri, Jul 4, 2008 at 12:09 PM, Chris Chabot <ch...@xs4all.nl> wrote:

> I'll have more detailed feedback early next week, but for now i'll stick
> to: That's really impressive work!
>
>        -- Chris
>
> On Jul 4, 2008, at 8:56 PM, David Mark Byttow wrote:
>
>  Hi all,
>>
>> Here is a link to our most recent progress:
>> http://ostemplates-demo.appspot.com. Currently, both Firefox and Safari
>> are
>> supported, not IE.
>>
>> This site contains the following:
>>
>>  - Demonstration of templates throughout the site. In fact, the content is
>>  served via templating.
>>  - Sample OpenSocial reusable tags as mentioned in the OpenSocial
>>  Templates spec
>> proposal<
>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
>> >
>>  .
>>  - Sample "friends list" gadget which can be deployed in any OpenSocial
>>
>>  container.
>>  - Examples of using "template libraries".
>>  - Source code, including a single, minimized JavaScript file for use.
>>
>> In addition to the source, please take a look at the HTML source as well.
>>
>> Currently the source code is broken into 8 files.
>>
>>  - *base.js* - Contains public API methods and anything else core and used
>>  throughout the library.
>>  - *compiler.js* - Parsing/compiling system. Functionality for parsing XML
>>  templates down to jstemplate structure and compiling the result.
>>  - *container.js* - Provides methods that bootstrap and hide the details
>>  of templates through a simpler interface with methods such as
>>  "processDocument", which compiles and registers all templates in the
>> current
>>  document.
>>  - *loader.js* - Implements the "template library" functionality with XHR.
>>  - namespaces.js - Implements support for tag namespaces.
>>  - *os.js* - Provides the functionality to map properties onto OpenSocial
>>  object methods.
>>  - *template.js* - Implements the Template class and caching/registration
>>  mechanism.
>>  - *util.js* - Small utility methods used throughout the code.
>>
>> The readable source does not include jstemplate, the underlying library we
>> used, though the full source code and more information can be found here:
>> http://code.google.com/p/google-jstemplate/.
>>
>> We are hoping to get feedback on the approach, so please respond with your
>> questions and comments.
>>
>> Thanks.
>> David
>>
>> On Wed, Jul 2, 2008 at 5:57 PM, David Mark Byttow <davidbyttow@google.com
>> >
>> wrote:
>>
>>  Hey guys,
>>>
>>> Thanks for the responses. I'm currently putting together a demo with
>>> source
>>> and will be sending out a link.
>>>
>>> David
>>>
>>>
>>> On Tue, Jul 1, 2008 at 1:58 PM, Kevin Brown <et...@google.com> wrote:
>>>
>>>  On Tue, Jul 1, 2008 at 12:42 PM, David Mark Byttow <
>>>> davidbyttow@google.com>
>>>> wrote:
>>>>
>>>>  Hi,
>>>>>
>>>>> My colleague, Lev Epshteyn, and I have been following the spec
>>>>>
>>>> discussions
>>>>
>>>>> on the OpenSocial Templates proposal (
>>>>>
>>>>>
>>>>>
>>>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
>>>>
>>>>> ).
>>>>> We think it's great how this is coming together and we have discussed
>>>>>
>>>> some
>>>>
>>>>> ideas for implementing the spec on the client-side. In fact, we have
>>>>>
>>>> also
>>>>
>>>>> made some good headway in coding up a prototype around one of them.
>>>>> We'd
>>>>> like to get broader input from shindig-dev and discuss next steps.
>>>>>
>>>>> At the core of our design is an open source technology called
>>>>> JSTemplate
>>>>>
>>>> (
>>>>
>>>>> http://code.google.com/p/google-jstemplate/). This technology has been
>>>>> used
>>>>> for a few years in various parts of Google Maps, and is pretty mature.
>>>>>
>>>> It
>>>>
>>>>> has been released by Google under the Apache 2.0 license recently. To
>>>>>
>>>> sum
>>>>
>>>>> it
>>>>> up, JSTemplate uses special attributes on the DOM nodes to process
>>>>> instructions. For example:
>>>>>
>>>>> The following HTML:
>>>>> <a jsvalues="href:url" jscontent="anchor"></a>
>>>>>
>>>>> Supplied the following JSON data:
>>>>> { url: "http://foo.com", anchor: "bar" }
>>>>>
>>>>> Becomes:
>>>>>  <a href="http://foo.com">Bar</a>
>>>>>
>>>>> One primary, but easily overlooked advantage of JSTemplate is that it
>>>>>
>>>> has
>>>>
>>>>> been heavily optimized for performing well in different browser
>>>>> environments
>>>>> and operates purely on the browser's DOM. Its disadvantage is that the
>>>>> library syntax is much less accessible than the spec developed for
>>>>> OpenSocial.
>>>>>
>>>>> Our idea has been to create a "compiler" which will transform templates
>>>>> written in OpenSocial format into DOM trees that can be used by
>>>>>
>>>> JSTemplate.
>>>>
>>>>> This way, once a template is "compiled", it can be rendered any number
>>>>>
>>>> of
>>>>
>>>>> times by the mature rendering core of JSTemplate.
>>>>>
>>>>> A simple example of such compilation would transform:
>>>>> <a href="${url}">${anchor}</a>
>>>>> Into the DOM snippet shown above when supplied with the same JSON data.
>>>>>
>>>>> Our initial prototype has shown this to be a fairly straightforward
>>>>> process,
>>>>> and we look forward to getting your thoughts and proposing some patches
>>>>>
>>>> to
>>>>
>>>>> shindig.
>>>>>
>>>>> Any thoughts?
>>>>>
>>>>
>>>>
>>>> Yes, send us the prototype :)
>>>>
>>>>
>>>>
>>>>>
>>>>> Thanks.
>>>>> David Byttow
>>>>>
>>>>>
>>>>
>>>
>>>
>

Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by Chris Chabot <ch...@xs4all.nl>.
I'll have more detailed feedback early next week, but for now i'll  
stick to: That's really impressive work!

	-- Chris

On Jul 4, 2008, at 8:56 PM, David Mark Byttow wrote:

> Hi all,
>
> Here is a link to our most recent progress:
> http://ostemplates-demo.appspot.com. Currently, both Firefox and  
> Safari are
> supported, not IE.
>
> This site contains the following:
>
>   - Demonstration of templates throughout the site. In fact, the  
> content is
>   served via templating.
>   - Sample OpenSocial reusable tags as mentioned in the OpenSocial
>   Templates spec
> proposal<http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates 
> >
>   .
>   - Sample "friends list" gadget which can be deployed in any  
> OpenSocial
>   container.
>   - Examples of using "template libraries".
>   - Source code, including a single, minimized JavaScript file for  
> use.
>
> In addition to the source, please take a look at the HTML source as  
> well.
>
> Currently the source code is broken into 8 files.
>
>   - *base.js* - Contains public API methods and anything else core  
> and used
>   throughout the library.
>   - *compiler.js* - Parsing/compiling system. Functionality for  
> parsing XML
>   templates down to jstemplate structure and compiling the result.
>   - *container.js* - Provides methods that bootstrap and hide the  
> details
>   of templates through a simpler interface with methods such as
>   "processDocument", which compiles and registers all templates in  
> the current
>   document.
>   - *loader.js* - Implements the "template library" functionality  
> with XHR.
>   - namespaces.js - Implements support for tag namespaces.
>   - *os.js* - Provides the functionality to map properties onto  
> OpenSocial
>   object methods.
>   - *template.js* - Implements the Template class and caching/ 
> registration
>   mechanism.
>   - *util.js* - Small utility methods used throughout the code.
>
> The readable source does not include jstemplate, the underlying  
> library we
> used, though the full source code and more information can be found  
> here:
> http://code.google.com/p/google-jstemplate/.
>
> We are hoping to get feedback on the approach, so please respond  
> with your
> questions and comments.
>
> Thanks.
> David
>
> On Wed, Jul 2, 2008 at 5:57 PM, David Mark Byttow <davidbyttow@google.com 
> >
> wrote:
>
>> Hey guys,
>>
>> Thanks for the responses. I'm currently putting together a demo  
>> with source
>> and will be sending out a link.
>>
>> David
>>
>>
>> On Tue, Jul 1, 2008 at 1:58 PM, Kevin Brown <et...@google.com> wrote:
>>
>>> On Tue, Jul 1, 2008 at 12:42 PM, David Mark Byttow <
>>> davidbyttow@google.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> My colleague, Lev Epshteyn, and I have been following the spec
>>> discussions
>>>> on the OpenSocial Templates proposal (
>>>>
>>>>
>>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
>>>> ).
>>>> We think it's great how this is coming together and we have  
>>>> discussed
>>> some
>>>> ideas for implementing the spec on the client-side. In fact, we  
>>>> have
>>> also
>>>> made some good headway in coding up a prototype around one of  
>>>> them. We'd
>>>> like to get broader input from shindig-dev and discuss next steps.
>>>>
>>>> At the core of our design is an open source technology called  
>>>> JSTemplate
>>> (
>>>> http://code.google.com/p/google-jstemplate/). This technology has  
>>>> been
>>>> used
>>>> for a few years in various parts of Google Maps, and is pretty  
>>>> mature.
>>> It
>>>> has been released by Google under the Apache 2.0 license  
>>>> recently. To
>>> sum
>>>> it
>>>> up, JSTemplate uses special attributes on the DOM nodes to process
>>>> instructions. For example:
>>>>
>>>> The following HTML:
>>>> <a jsvalues="href:url" jscontent="anchor"></a>
>>>>
>>>> Supplied the following JSON data:
>>>> { url: "http://foo.com", anchor: "bar" }
>>>>
>>>> Becomes:
>>>>  <a href="http://foo.com">Bar</a>
>>>>
>>>> One primary, but easily overlooked advantage of JSTemplate is  
>>>> that it
>>> has
>>>> been heavily optimized for performing well in different browser
>>>> environments
>>>> and operates purely on the browser's DOM. Its disadvantage is  
>>>> that the
>>>> library syntax is much less accessible than the spec developed for
>>>> OpenSocial.
>>>>
>>>> Our idea has been to create a "compiler" which will transform  
>>>> templates
>>>> written in OpenSocial format into DOM trees that can be used by
>>> JSTemplate.
>>>> This way, once a template is "compiled", it can be rendered any  
>>>> number
>>> of
>>>> times by the mature rendering core of JSTemplate.
>>>>
>>>> A simple example of such compilation would transform:
>>>> <a href="${url}">${anchor}</a>
>>>> Into the DOM snippet shown above when supplied with the same JSON  
>>>> data.
>>>>
>>>> Our initial prototype has shown this to be a fairly straightforward
>>>> process,
>>>> and we look forward to getting your thoughts and proposing some  
>>>> patches
>>> to
>>>> shindig.
>>>>
>>>> Any thoughts?
>>>
>>>
>>> Yes, send us the prototype :)
>>>
>>>
>>>>
>>>>
>>>> Thanks.
>>>> David Byttow
>>>>
>>>
>>
>>


Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by David Mark Byttow <da...@google.com>.
Hi all,

Here is a link to our most recent progress:
http://ostemplates-demo.appspot.com. Currently, both Firefox and Safari are
supported, not IE.

This site contains the following:

   - Demonstration of templates throughout the site. In fact, the content is
   served via templating.
   - Sample OpenSocial reusable tags as mentioned in the OpenSocial
   Templates spec
proposal<http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates>
   .
   - Sample "friends list" gadget which can be deployed in any OpenSocial
   container.
   - Examples of using "template libraries".
   - Source code, including a single, minimized JavaScript file for use.

In addition to the source, please take a look at the HTML source as well.

Currently the source code is broken into 8 files.

   - *base.js* - Contains public API methods and anything else core and used
   throughout the library.
   - *compiler.js* - Parsing/compiling system. Functionality for parsing XML
   templates down to jstemplate structure and compiling the result.
   - *container.js* - Provides methods that bootstrap and hide the details
   of templates through a simpler interface with methods such as
   "processDocument", which compiles and registers all templates in the current
   document.
   - *loader.js* - Implements the "template library" functionality with XHR.
   - namespaces.js - Implements support for tag namespaces.
   - *os.js* - Provides the functionality to map properties onto OpenSocial
   object methods.
   - *template.js* - Implements the Template class and caching/registration
   mechanism.
   - *util.js* - Small utility methods used throughout the code.

The readable source does not include jstemplate, the underlying library we
used, though the full source code and more information can be found here:
http://code.google.com/p/google-jstemplate/.

We are hoping to get feedback on the approach, so please respond with your
questions and comments.

Thanks.
David

On Wed, Jul 2, 2008 at 5:57 PM, David Mark Byttow <da...@google.com>
wrote:

> Hey guys,
>
> Thanks for the responses. I'm currently putting together a demo with source
> and will be sending out a link.
>
> David
>
>
> On Tue, Jul 1, 2008 at 1:58 PM, Kevin Brown <et...@google.com> wrote:
>
>> On Tue, Jul 1, 2008 at 12:42 PM, David Mark Byttow <
>> davidbyttow@google.com>
>> wrote:
>>
>> > Hi,
>> >
>> > My colleague, Lev Epshteyn, and I have been following the spec
>> discussions
>> > on the OpenSocial Templates proposal (
>> >
>> >
>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
>> > ).
>> > We think it's great how this is coming together and we have discussed
>> some
>> > ideas for implementing the spec on the client-side. In fact, we have
>> also
>> > made some good headway in coding up a prototype around one of them. We'd
>> > like to get broader input from shindig-dev and discuss next steps.
>> >
>> > At the core of our design is an open source technology called JSTemplate
>> (
>> > http://code.google.com/p/google-jstemplate/). This technology has been
>> > used
>> > for a few years in various parts of Google Maps, and is pretty mature.
>> It
>> > has been released by Google under the Apache 2.0 license recently. To
>> sum
>> > it
>> > up, JSTemplate uses special attributes on the DOM nodes to process
>> > instructions. For example:
>> >
>> > The following HTML:
>> >  <a jsvalues="href:url" jscontent="anchor"></a>
>> >
>> > Supplied the following JSON data:
>> >  { url: "http://foo.com", anchor: "bar" }
>> >
>> > Becomes:
>> >   <a href="http://foo.com">Bar</a>
>> >
>> > One primary, but easily overlooked advantage of JSTemplate is that it
>> has
>> > been heavily optimized for performing well in different browser
>> > environments
>> > and operates purely on the browser's DOM. Its disadvantage is that the
>> > library syntax is much less accessible than the spec developed for
>> > OpenSocial.
>> >
>> > Our idea has been to create a "compiler" which will transform templates
>> > written in OpenSocial format into DOM trees that can be used by
>> JSTemplate.
>> > This way, once a template is "compiled", it can be rendered any number
>> of
>> > times by the mature rendering core of JSTemplate.
>> >
>> > A simple example of such compilation would transform:
>> >  <a href="${url}">${anchor}</a>
>> > Into the DOM snippet shown above when supplied with the same JSON data.
>> >
>> > Our initial prototype has shown this to be a fairly straightforward
>> > process,
>> > and we look forward to getting your thoughts and proposing some patches
>> to
>> > shindig.
>> >
>> > Any thoughts?
>>
>>
>> Yes, send us the prototype :)
>>
>>
>> >
>> >
>> > Thanks.
>> > David Byttow
>> >
>>
>
>

Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by David Mark Byttow <da...@google.com>.
Hey guys,

Thanks for the responses. I'm currently putting together a demo with source
and will be sending out a link.

David

On Tue, Jul 1, 2008 at 1:58 PM, Kevin Brown <et...@google.com> wrote:

> On Tue, Jul 1, 2008 at 12:42 PM, David Mark Byttow <davidbyttow@google.com
> >
> wrote:
>
> > Hi,
> >
> > My colleague, Lev Epshteyn, and I have been following the spec
> discussions
> > on the OpenSocial Templates proposal (
> >
> >
> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
> > ).
> > We think it's great how this is coming together and we have discussed
> some
> > ideas for implementing the spec on the client-side. In fact, we have also
> > made some good headway in coding up a prototype around one of them. We'd
> > like to get broader input from shindig-dev and discuss next steps.
> >
> > At the core of our design is an open source technology called JSTemplate
> (
> > http://code.google.com/p/google-jstemplate/). This technology has been
> > used
> > for a few years in various parts of Google Maps, and is pretty mature. It
> > has been released by Google under the Apache 2.0 license recently. To sum
> > it
> > up, JSTemplate uses special attributes on the DOM nodes to process
> > instructions. For example:
> >
> > The following HTML:
> >  <a jsvalues="href:url" jscontent="anchor"></a>
> >
> > Supplied the following JSON data:
> >  { url: "http://foo.com", anchor: "bar" }
> >
> > Becomes:
> >   <a href="http://foo.com">Bar</a>
> >
> > One primary, but easily overlooked advantage of JSTemplate is that it has
> > been heavily optimized for performing well in different browser
> > environments
> > and operates purely on the browser's DOM. Its disadvantage is that the
> > library syntax is much less accessible than the spec developed for
> > OpenSocial.
> >
> > Our idea has been to create a "compiler" which will transform templates
> > written in OpenSocial format into DOM trees that can be used by
> JSTemplate.
> > This way, once a template is "compiled", it can be rendered any number of
> > times by the mature rendering core of JSTemplate.
> >
> > A simple example of such compilation would transform:
> >  <a href="${url}">${anchor}</a>
> > Into the DOM snippet shown above when supplied with the same JSON data.
> >
> > Our initial prototype has shown this to be a fairly straightforward
> > process,
> > and we look forward to getting your thoughts and proposing some patches
> to
> > shindig.
> >
> > Any thoughts?
>
>
> Yes, send us the prototype :)
>
>
> >
> >
> > Thanks.
> > David Byttow
> >
>

Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by Kevin Brown <et...@google.com>.
On Tue, Jul 1, 2008 at 12:42 PM, David Mark Byttow <da...@google.com>
wrote:

> Hi,
>
> My colleague, Lev Epshteyn, and I have been following the spec discussions
> on the OpenSocial Templates proposal (
>
> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates
> ).
> We think it's great how this is coming together and we have discussed some
> ideas for implementing the spec on the client-side. In fact, we have also
> made some good headway in coding up a prototype around one of them. We'd
> like to get broader input from shindig-dev and discuss next steps.
>
> At the core of our design is an open source technology called JSTemplate (
> http://code.google.com/p/google-jstemplate/). This technology has been
> used
> for a few years in various parts of Google Maps, and is pretty mature. It
> has been released by Google under the Apache 2.0 license recently. To sum
> it
> up, JSTemplate uses special attributes on the DOM nodes to process
> instructions. For example:
>
> The following HTML:
>  <a jsvalues="href:url" jscontent="anchor"></a>
>
> Supplied the following JSON data:
>  { url: "http://foo.com", anchor: "bar" }
>
> Becomes:
>   <a href="http://foo.com">Bar</a>
>
> One primary, but easily overlooked advantage of JSTemplate is that it has
> been heavily optimized for performing well in different browser
> environments
> and operates purely on the browser's DOM. Its disadvantage is that the
> library syntax is much less accessible than the spec developed for
> OpenSocial.
>
> Our idea has been to create a "compiler" which will transform templates
> written in OpenSocial format into DOM trees that can be used by JSTemplate.
> This way, once a template is "compiled", it can be rendered any number of
> times by the mature rendering core of JSTemplate.
>
> A simple example of such compilation would transform:
>  <a href="${url}">${anchor}</a>
> Into the DOM snippet shown above when supplied with the same JSON data.
>
> Our initial prototype has shown this to be a fairly straightforward
> process,
> and we look forward to getting your thoughts and proposing some patches to
> shindig.
>
> Any thoughts?


Yes, send us the prototype :)


>
>
> Thanks.
> David Byttow
>

Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by Ian Boston <ie...@tfd.co.uk>.
A correction on a11y comments/concern.

I asked again, and was told that DOM injection is just fine now, as  
long as it happens in bursts. The assistive technologies like JAWS  
wont notice rapid changes on page load, what puts them and the user  
off track is random DOM changes after load when the screen reader is  
reading... which makes sense.

So ignore my comments on a11y.

Ian


On 2 Jul 2008, at 10:27, Ian Boston wrote:

> Hi,
>
> I would be interested in the DOM processing techniques, not least
> because when we (we being University of Cambridge not shindig)
> selected a client side templating script a few months ago and found
> that those that compiled the template into a single java script
> function, that generated a string that was injected into the dom in a
> single operation outperformed the the DOM based template engines by
> varying but significant amounts. IE6 was particularly slow as each dom
> operation cased a re-render, IE7 and others appear to have lazy dom
> rendering. IMHO the processing performance is critical as in an app
> with many templates is consumes CPU headroom that would be available
> for application logic.
>
> We did a bunch of comparative tests and found that it was hard to beat
> the execution speed of a single function execution, with one DOM
> injection.
>
> There are 2 other aspects that are of concern to me, Accessibility and
> ease of use for an HTML developer. The ease of use for an HTML
> developer is debatable with arguments on all sides, I feel I am too
> much of a programmer with xml/xpath etc knowledge to give an unbiased
> view.
>
> However accessibility does worry me when it comes to DOM manipulation.
> From what I have been told by the Fluid project if the DOM is
> manipulated each manipulation event makes assistive devices (eg JAWS.
> http://www.w3.org/TR/wai-aria-roadmap/) believe the screen has
> changed, and starts a re-read of the screen. So, apparently large dom
> modifications that occur in a single injection cause fewer problems
> that modifications to the DOM on a node by node basis. I believe this
> is why the advice and examples from illinos
> (http://test.cita.uiuc.edu/aria/) suggest that modification of dom
> node attributes is acceptable in a rich web application environment,
> but large scale DOM node modification stats become dangerous.
>
>
> None of these views are strongly held, and I am only relaying the
> advice we have received from others, and the evidence of the in
> browser tests we performed, In the end we (at Cambridge) chose
> trimpath..... (not a recommendation for shindig :) )
>
> but I really would like to understand the DOM optimizations present in
> jstempate, because they will offer more insight into this area.
>
>
> Ian
>
>
> 2008/7/1 David Mark Byttow <da...@google.com>:
>> Hi,
>>
>> My colleague, Lev Epshteyn, and I have been following the spec  
>> discussions
>> on the OpenSocial Templates proposal (
>> http://groups.google.com/group/opensocial-and-gadgets-spec/web/ 
>> opensocial-templates).
>> We think it's great how this is coming together and we have  
>> discussed some
>> ideas for implementing the spec on the client-side. In fact, we  
>> have also
>> made some good headway in coding up a prototype around one of  
>> them. We'd
>> like to get broader input from shindig-dev and discuss next steps.
>>
>> At the core of our design is an open source technology called  
>> JSTemplate (
>> http://code.google.com/p/google-jstemplate/). This technology has  
>> been used
>> for a few years in various parts of Google Maps, and is pretty  
>> mature. It
>> has been released by Google under the Apache 2.0 license recently.  
>> To sum it
>> up, JSTemplate uses special attributes on the DOM nodes to process
>> instructions. For example:
>>
>> The following HTML:
>>  <a jsvalues="href:url" jscontent="anchor"></a>
>>
>> Supplied the following JSON data:
>>  { url: "http://foo.com", anchor: "bar" }
>>
>> Becomes:
>>   <a href="http://foo.com">Bar</a>
>>
>> One primary, but easily overlooked advantage of JSTemplate is that  
>> it has
>> been heavily optimized for performing well in different browser  
>> environments
>> and operates purely on the browser's DOM. Its disadvantage is that  
>> the
>> library syntax is much less accessible than the spec developed for
>> OpenSocial.
>>
>> Our idea has been to create a "compiler" which will transform  
>> templates
>> written in OpenSocial format into DOM trees that can be used by  
>> JSTemplate.
>> This way, once a template is "compiled", it can be rendered any  
>> number of
>> times by the mature rendering core of JSTemplate.
>>
>> A simple example of such compilation would transform:
>>  <a href="${url}">${anchor}</a>
>> Into the DOM snippet shown above when supplied with the same JSON  
>> data.
>>
>> Our initial prototype has shown this to be a fairly  
>> straightforward process,
>> and we look forward to getting your thoughts and proposing some  
>> patches to
>> shindig.
>>
>> Any thoughts?
>>
>> Thanks.
>> David Byttow
>>


Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by Ian Boston <ie...@tfd.co.uk>.
Hi,

I would be interested in the DOM processing techniques, not least
because when we (we being University of Cambridge not shindig)
selected a client side templating script a few months ago and found
that those that compiled the template into a single java script
function, that generated a string that was injected into the dom in a
single operation outperformed the the DOM based template engines by
varying but significant amounts. IE6 was particularly slow as each dom
operation cased a re-render, IE7 and others appear to have lazy dom
rendering. IMHO the processing performance is critical as in an app
with many templates is consumes CPU headroom that would be available
for application logic.

We did a bunch of comparative tests and found that it was hard to beat
the execution speed of a single function execution, with one DOM
injection.

There are 2 other aspects that are of concern to me, Accessibility and
ease of use for an HTML developer. The ease of use for an HTML
developer is debatable with arguments on all sides, I feel I am too
much of a programmer with xml/xpath etc knowledge to give an unbiased
view.

However accessibility does worry me when it comes to DOM manipulation.
>From what I have been told by the Fluid project if the DOM is
manipulated each manipulation event makes assistive devices (eg JAWS.
http://www.w3.org/TR/wai-aria-roadmap/) believe the screen has
changed, and starts a re-read of the screen. So, apparently large dom
modifications that occur in a single injection cause fewer problems
that modifications to the DOM on a node by node basis. I believe this
is why the advice and examples from illinos
(http://test.cita.uiuc.edu/aria/) suggest that modification of dom
node attributes is acceptable in a rich web application environment,
but large scale DOM node modification stats become dangerous.


None of these views are strongly held, and I am only relaying the
advice we have received from others, and the evidence of the in
browser tests we performed, In the end we (at Cambridge) chose
trimpath..... (not a recommendation for shindig :) )

but I really would like to understand the DOM optimizations present in
jstempate, because they will offer more insight into this area.


Ian


2008/7/1 David Mark Byttow <da...@google.com>:
> Hi,
>
> My colleague, Lev Epshteyn, and I have been following the spec discussions
> on the OpenSocial Templates proposal (
> http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates).
> We think it's great how this is coming together and we have discussed some
> ideas for implementing the spec on the client-side. In fact, we have also
> made some good headway in coding up a prototype around one of them. We'd
> like to get broader input from shindig-dev and discuss next steps.
>
> At the core of our design is an open source technology called JSTemplate (
> http://code.google.com/p/google-jstemplate/). This technology has been used
> for a few years in various parts of Google Maps, and is pretty mature. It
> has been released by Google under the Apache 2.0 license recently. To sum it
> up, JSTemplate uses special attributes on the DOM nodes to process
> instructions. For example:
>
> The following HTML:
>  <a jsvalues="href:url" jscontent="anchor"></a>
>
> Supplied the following JSON data:
>  { url: "http://foo.com", anchor: "bar" }
>
> Becomes:
>   <a href="http://foo.com">Bar</a>
>
> One primary, but easily overlooked advantage of JSTemplate is that it has
> been heavily optimized for performing well in different browser environments
> and operates purely on the browser's DOM. Its disadvantage is that the
> library syntax is much less accessible than the spec developed for
> OpenSocial.
>
> Our idea has been to create a "compiler" which will transform templates
> written in OpenSocial format into DOM trees that can be used by JSTemplate.
> This way, once a template is "compiled", it can be rendered any number of
> times by the mature rendering core of JSTemplate.
>
> A simple example of such compilation would transform:
>  <a href="${url}">${anchor}</a>
> Into the DOM snippet shown above when supplied with the same JSON data.
>
> Our initial prototype has shown this to be a fairly straightforward process,
> and we look forward to getting your thoughts and proposing some patches to
> shindig.
>
> Any thoughts?
>
> Thanks.
> David Byttow
>

Re: Feedback requested: Initial design ideas for OpenSocial Templates implementation

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"David Mark Byttow" <da...@google.com> writes:

>Our initial prototype has shown this to be a fairly straightforward process,
>and we look forward to getting your thoughts and proposing some patches to
>shindig.

Where is that prototype and how can we review it?

      Ciao
	Henning

-- 
Henning P. Schmiedehausen  -- hps@intermeta.de | J2EE, Linux,
91054 Buckenhof, Germany   -- +49 9131 506540  | Apache person
Open Source Consulting, Development, Design    | Velocity - Turbine guy

INTERMETA - Gesellschaft fuer Mehrwertdienste mbH - RG Fuerth, HRB 7350
Sitz der Gesellschaft: Buckenhof. Geschaeftsfuehrer: Henning Schmiedehausen

   "Professor Peach in the library with the lead piping!" -- Donna