Skip to content

WebComponents and JS API

Compare
Choose a tag to compare
@mbasso mbasso released this 05 Jan 13:13
· 102 commits to master since this release
ddf9810

This release allows you to use asm-dom to render WebComponents from both Javascript and C++

// C++
VNode* vnode = h("hello-component",
  Data(
    Attrs {
      {"name", "World"}
    }
  )
);

// javascript
const vnode = h("hello-component", {
  name: 'World',
});

Also, there are some improvement to the JS APIs, now you don't need to use the special raw prop to set value, checked or callbacks anymore. asm-dom is now able to automatically recognize them:

// asm-dom >= 0.5.0
const vnode = h('input', {
  className: 'input-class',
  value: 'foo',
  onchange: onChange,
});

// asm-dom < 0.5.0
const vnode = h('input', {
  className: 'input-class',
  raw: {
    value: 'foo',
    onchange: onChange,
  },
});

Bugfixes

  • asm-dom can now be used as a Javascript module without an arraybuffer-loader

Breaking changes

None