github cyclejs/cyclejs v0.11.0
v0.11.0 - Simple breaking change to custom elements

latest releases: unified-tag, v7.0.0, v7.0.0-rc8...
pre-release9 years ago

To conform better with web components (such as in the Polymer framework), the API for custom elements in Cycle has been changed from:

h('my-element', {attributes: {age: 30}});

to

h('my-element', {age: 30});

Where the definition of my-element used to be:

var MyElementComponent = Cycle.createView(function (Attributes) {
  // do something with Attributes.get('age')
};

it should now be (this is not part of the breaking change, just a rename of the argument in order to express better the new change in semantics):

var MyElementComponent = Cycle.createView(function (Properties) {
  // do something with Properties.get('age')
};

The reason for this breaking change is that: you might want to specify properties that are not under {attributes: ...} but still use them internally in the component implementation. For instance, in v0.10 you had to do {attributes: {style: {color: color}} where style would be translated to Attributes.get('style$') and this doesn't make sense since normal elements in virtual-dom such as div should use the API {attributes: {...}, style: {color: color}} with style outside of attributes.

Don't miss a new cyclejs release

NewReleases is sending notifications on new releases.