Live data from Hacker News

Show HN: HyperApp – 1k JavaScript framework for building web applications

github.com

41–50 of 169 posts

Re: Show HN: HyperApp – 1k JavaScript framework for building web applications

#43
post #36

Earlier quoted context omitted.

Then you need to send lit-html over to the client also. This would be a great alternative if one doesn't already use Babel, but what's the selling point otherwise? Is there an easy way to combine lit-html's render with the HyperApp one?

IMO, the problem of composing renderers is solved at the component level. Each component should be able to freely choose its rendering library and control its own encapsulated DOM without interfering with other components, or leaking it's choice of template library to the outside. Web Components and Shadow DOM make this possible. You can mix and match components that use lit-html, Polymer, Preact, etc., and mostly li…

But mixing and matching causes your page to bloat due to needing to download all the different libraries, right?

Re: Show HN: HyperApp – 1k JavaScript framework for building web applications

#44

If you're interesting in a reactive template library that doesn't require a compiler for non-standard JavaScript syntax, check out a library I've been working on for a little while now, lit-html: https://github.com/Polymer/lit-html Where JSX would look like this: const view = (state, actions) => ( {state.count} actions.down(1)}>- actions.up(1)}>+ ) The lit-html would be: const view = (state, actions) => html` {state.…

Also check out https://viperhtml.js.org/hyper.html, original inspiration for lit-html.

Same principle, different implementation, takes advantage of special string literal properties to achieve impressive speeds.

Re: Show HN: HyperApp – 1k JavaScript framework for building web applications

#45

If you're interesting in a reactive template library that doesn't require a compiler for non-standard JavaScript syntax, check out a library I've been working on for a little while now, lit-html: https://github.com/Polymer/lit-html Where JSX would look like this: const view = (state, actions) => ( {state.count} actions.down(1)}>- actions.up(1)}>+ ) The lit-html would be: const view = (state, actions) => html` {state.…

> ... expensive VDOM diffs

Wait, I thought VDOMs were supposed to be fast(er).

Note: I'm not a FE Dev, so I'm only going by stuff I (think I) read, not write.

Re: Show HN: HyperApp – 1k JavaScript framework for building web applications

#46
post #21

I love hyperapp! As someone who thinks Elm’s architecture is ideal for building webapps, it’s great to be able to almost replicate it in JS. It’s simple enough to get started quickly but still robust enough to build actual apps and not just toys.

You might be interested in this: https://github.com/pakx/the-mithril-diaries/wiki/Coming-From...

Re: Show HN: HyperApp – 1k JavaScript framework for building web applications

#49

Side question: Isn't it grossly inefficient that in Redux, you have reducers that return an entirely new state object? Wouldn't it be better to return some kind of data that represents just the diff you intend to make, like {op: INCREMENT, arg: 1, key: "Foo"}?

You might be interested in skipping Redux and just using a state pattern like this http://meiosis.js.org

Re: Show HN: HyperApp – 1k JavaScript framework for building web applications

#50
post #19

This is an exceptionally simple library to use in place of React. Both its performance and the development experience have been great. My company's been using it in production for more than a year now without any issues. Highly recommend giving it a look.

Just out of curiosity, what was your use case that you deemed this a better option than react for?
Post reply on HN