Skip to content

Releases: redom/redom

dispatch

29 May 17:42
Compare
Choose a tag to compare

Added simple helper for creating bubbling CustomEvents (trigger events that bubble components upstream)

import { el, dispatch, mount } from 'redom';

class Component {
  constructor () {
    this.el = el('.component');

    this.el.onclick = () => {
      dispatch(this, { componentClicked: true });
    };
  }
}

const component = new Component();
mount(document.body, component);
document.body.addEventListener('redom', e => console.log(e.detail)); // { componentClicked: true }
component.el.onclick();

You can also define custom event name:

dispatch(this, { hello: 'RE:DOM' }, 'custom-event');

Also modernized and simplified tests with Teston

viewFactory + tree shaking

13 Dec 11:01
Compare
Choose a tag to compare
  • Tree shaking finally enabled! (as npm module)
  • viewFactory added:
import { list, viewFactory } from 'redom';

class A {
  constructor () {
    this.el = el('a');
  }
  update () {
    ...
  }
}
class B {
  constructor () {
    this.el = el('b');
  }
  update () {
    ...
  }
}

const items = list('items', viewFactory({ a: A, b: B }, 'type'), 'id');

items.update([{ id: 1, type: 'a' }, { id: 2, type: 'b' }]);

––>

<items>
  <a></a>
  <b></b>
</items>

Don't use DOM memoization

07 Jun 10:33
Compare
Choose a tag to compare

v3.28.0

31 May 11:20
Compare
Choose a tag to compare
  • Fix lifecycle events when mounting with replace option #339 (patch)
  • Update dependencies (minor)

Type issue fixed

14 Apr 06:13
Compare
Choose a tag to compare

Type issue fixed

20 Mar 04:45
Compare
Choose a tag to compare

Type issue fixed, thank you @flery and @joona!

v3.24.0

30 Jun 11:09
Compare
Choose a tag to compare

Added support for plain element and component instance children in Router and Place

Updated dependencies

30 May 10:26
Compare
Choose a tag to compare

Added sideEffects flag for Webpack

30 May 10:25
Compare
Choose a tag to compare