numtel / meteor-webcomponent

WebComponent integration for Meteor templates
MIT License
38 stars 1 forks source link

Context vs Attributes #1

Closed samhatoum closed 9 years ago

samhatoum commented 9 years ago

Awesome work!

Question: would attributes be better named data context?

numtel commented 9 years ago

Thank you

I don't understand why context would be a better description of this property.

My reasoning for the name of the option:

  1. The registerComponent method exists to build a new element.
  2. The new element may accept attributes.
  3. Unable to be gleaned from the template itself, the attributes option enables their definition. Element attributes may only be of one type (string). Therefore, a simple array of their names is sufficient for declaration.

I have added some notes to the readme to further explain how the template context is handled when loaded inside of a WebComponent. I hope that helps make more sense of it.

numtel commented 9 years ago

I have rewritten this package to use Polymer's webcomponents.js for greater compatibility. In the process, the element's attributes no longer need to be defined when registering the element. The readme has been updated with the new details.