W3C home > Mailing lists > Public > public-csv-wg@w3.org > June 2014

Re: Web Component templates (and Polymer)

From: Ivan Herman <ivan@w3.org>
Date: Mon, 30 Jun 2014 14:05:42 +0200
Cc: Dan Brickley <danbri@google.com>, W3C CSV on the Web Working Group <public-csv-wg@w3.org>
Message-Id: <46733F63-3E79-4EF4-8277-525AB66AD371@w3.org>
To: "Tandy, Jeremy" <jeremy.tandy@metoffice.gov.uk>

On 30 Jun 2014, at 13:57 , Tandy, Jeremy <jeremy.tandy@metoffice.gov.uk> wrote:

> Hi Dan - it certainly seems like the HTML5 <template> element & Polymer are running in the same direction as us; although whether we're on the same track is hard to tell from the docs :-)
> 
> What's obvious is that they use a {{...}} syntax compared to our {...} which is borrowed from URI templates.

I had an ugly idea last night...

The problem with the '{' syntax is that it does not goes well with JSON. But it works well with turtle and/or XML. Maybe we will have to have an 'abstract' template language specification with two different concrete syntaxes, one with '{...}' and the other with, say, '<...>' to work with Turtle/XML and JSON, respectively...

It is ugly. But I am not sure what else we would do...

Ivan

> 
> I guess that the next step would be to try to apply the HTML5 template / Polymer model to one of the example scenarios you're creating?
> 
> Jeremy
> 
>> -----Original Message-----
>> From: Dan Brickley [mailto:danbri@google.com]
>> Sent: 27 June 2014 23:39
>> To: public-csv-wg@w3.org
>> Subject: Web Component templates (and Polymer)
>> 
>> Just to bookmark a thought, while watching
>> https://www.youtube.com/watch?v=8OJ7ih8EE7s
>> 
>> Web Components (a browser-based Web standards effort) has a data
>> binding / templates aspect.
>> 
>> http://webcomponents.org/
>> http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-
>> 1.html#the-template-element
>> 
>> Polymer adds a layer over the base specs, http://www.polymer-
>> project.org/docs/polymer/databinding.html
>> 
>> Here's an example:
>> 
>> <polymer-element name="greeting-tag">
>>  <!-- outermost template defines the element's shadow DOM -->
>>  <template>
>>    <ul>
>>      <template repeat="{{s in salutations}}">
>>        <li>{{s.what}}: <input type="text" value="{{s.who}}"></li>
>>      </template>
>>    </ul>
>>  </template>
>>  <script>
>>    Polymer('greeting-tag', {
>>      ready: function() {
>>        // populate the elementís data model
>>        // (the salutations array)
>>        this.salutations = [
>>          {what: 'Hello', who: 'World'},
>>          {what: 'GoodBye', who: 'DOM APIs'},
>>          {what: 'Hello', who: 'Declarative'},
>>          {what: 'GoodBye', who: 'Imperative'}
>>        ];
>>      }
>>    });
>>  </script>
>> </polymer-element>
>> 
>> 
>> I'm not sure what to conclude from this, but thought I'd pass this
>> along as a start.
>> 
>> Dan
> 


----
Ivan Herman, W3C 
Digital Publishing Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
GPG: 0x343F1A3D
WebID: http://www.ivan-herman.net/foaf#me






Received on Monday, 30 June 2014 12:06:13 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:40 UTC