Releases: canjs/can-stache-element
Releases · canjs/can-stache-element
Test organization for CanJS production
This release hasn't a new feature, just tests organization in order to make canjs
production tests.
Observable class fields support
- Add observable class fields support:
class MyElement extends StacheElement {
greetings = 'Hello';
static get view() { return `{{ greetings }}` }
static get props() {
}
}
customElements.define('my-element', MyElement);
const el = new MyElement().initialize();
el.on('greeting', (ev, newVal, oldVal) => {
// it should be observable, handle change here
});
el.greeting = 'Hola';
- Observable class fields support documentation
Import `can` package in docs
Use can
package in documentation instead of can/everything
:
import { StacheElement } from "can/everything";
-> import { StacheElement } from "can";
1.0.1
New package makes it easy to build web components
This is the first major release of can-stache-element, a library for building web components. StacheElement
is like a new, better, version of can-component with an ES6 backed API.
import { StacheElement } from "can";
class HelloWorld extends StacheElement {
static view = `Hello {{name}}`;
static props = {
name: "world"
};
}
customElements.define("hello-world", HelloWorld);
Fixed some links in the docs
Initial Release
class Basic extends StacheElement {
static view = `
<in-put inputValue:bind="this.first" handler:from="this.setFirst"></in-put>
<in-put inputValue:bind="this.last" handler:from="this.setLast"></in-put>
<p>{{this.fullName}}</p>
`;
static props = {
first: { type: String, default: "Kevin" },
last: { type: String, default: "McCallister" }
};
get fullName() {
return `${this.first} ${this.last}`;
}
setFirst(val) {
this.first = val;
}
setLast(val) {
this.last = val;
}
}
customElements.define("basic-app", Basic);
v0.7.5
Properties with DOM events warnings fix
v0.7.4 0.7.4
Fixes uses of listenTo
listenTo
was breaking due to the change to have addEventListener
register real DOM events. This fixes it so that both DOM events and canjs' internal event handler system are registered.