Live data from Hacker News

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

github.com

31–40 of 169 posts

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

#33

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"}?

Objects in JavaScript are references so internally it's just a pointer being passed around.

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

#34

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"}?

It's doubtful that state changes are the bottleneck for application performance, for most applications. Rendering and managing the lifecycle of your components usually yields much more tangible perf. gains.

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

#35
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.count}
         actions.down(1)}>-
         actions.up(1)}>+
      
    `;
Nearly identical. lit-html uses ``s and cloning, so that it doesn't have to do any expensive VDOM diffs.

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

#36

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.…

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?

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

#38
post #36

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.…

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 likely HyperApp.

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

#39

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.…

Loving Polymer 3.0 and the new lit-element (which I believe just straight up used lit-html behind).

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

#40

Wow, there's an overwhelming total of 2 comments in the source file. The first indicates a constant value. The second lacks all context. Looks like typical JavaScript code.

Maybe there's simply nothing else to say.

There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies.
Post reply on HN