Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PROPOSAL: Integrate with other emerging templates #4169

Open
justinbmeyer opened this Issue May 31, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@justinbmeyer
Copy link
Contributor

justinbmeyer commented May 31, 2018

tldr; Template literals have created some new cool view engines. Lets integrate our observables with them!

This was discussed on a recent live stream (9:37).

Problem

CanJS's observable layer is awesome. Everyone should use it.

Solution

Lets create bindings like can-react for some of the following:

import canHyper from "can-hyper"

class Counter extends hyper.Component {
  get defaultState() {
    return {count: 0};
  }
  constructor(count) {
    super();
    this.setState({count});
  }
  render() {
    return this.html`
      <button style=${this.state.css} onclick=${ e => this.count++; }>
        ${this.state.count}
      </button>`;
  }
}
@janat08

This comment has been minimized.

Copy link

janat08 commented Jun 1, 2018

You might be interested in integrating atop https://github.com/codemeasandwich/hyper-element , that tries to hook reactive engines like mobx. It was pretty raw last I used it half a year ago with lacking context or something (preventing reusable templates, each>template), but it was fixed since, but it's still possible there're pieces missing.

@janat08

This comment has been minimized.

Copy link

janat08 commented Jun 1, 2018

there's some doc place where hyperhtml compares against lit-html and summarily lit-html is pretty trashy last I looked.

@janat08

This comment has been minimized.

Copy link

janat08 commented Jun 1, 2018

I like hyperhtml, but the sad part is that it doesn't readily accept third party libraries that manipulate DOM, unlike other view engines that are much more precise.

@janat08

This comment has been minimized.

Copy link

janat08 commented Jun 1, 2018

Would be cool if you could fall back to mustache for when there're other libraries doing DOM and then back, if mustache handles that. Otherwise, you're supposed to cordon off the area where 3rd library operates with hyperhtml and get imperative about things there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.