Live data from Hacker News

Hyperapp – A tiny framework for building web interfaces

hyperapp.dev

91–100 of 198 posts

Re: Hyperapp – A tiny framework for building web interfaces

#91

Earlier quoted context omitted.

Do you know why?

Oooh, I see. It ( https://hyperapp.dev/ecosystem ) is broken if you've never been to https://hyperapp.dev before.

I am on macOS / Safari 13.2.1 and I can not visit hyperapp.dev/ecosystem after visiting hyperapp.dev

Re: Hyperapp – A tiny framework for building web interfaces

#92
post #19

Earlier quoted context omitted.

I resisted the change to v2 for a long time. In the end I found that v2's state management is much better, so it might be worth a look for that alone.

I read about it but it just did not click as V1 did. Also I will not rewrite old code just for sake of change and I want all system to be on same framework if possible. I may actually do my own fork where only difference will be passing root state and root actions in addition to partial ones, which will fix great amount of issues I have.

Agreed.

The lack of lifecycle events in v2 complicates things a great deal for seemingly no reason. Subscriptions and Events are similar enough that they could have become a single thing, instead of having two highly similar but not-quite-the-same things to grok. The tuple syntax it uses is very strange coming from v1.

I wish I could call it a strict upgrade instead of saying "some things are worse, but other things are better."

Re: Hyperapp – A tiny framework for building web interfaces

#93

Earlier quoted context omitted.

The same is true of JSX. You can abstract and generalize its components with equal ease. I agree with another commenter that a lot of the common objections to JSX and React more generally, especially on HN, sound like things that people who've never used it but only seen a few examples would say. It's a shame, because with a little more experience those people could complain about stuff like how the complex form logi…

I personally never found much inherent value to JSX outside of making it easier to onboard other developers who are already familiar with HTML, or have seen React before. Otherwise, I found Hyperscript easy to read after about a day of using it, and there's no extra toolchain or compile-step required to use it. Plus it's "just JavaScript."

I do rather like JSX, but I agree Hyperscript isn't difficult to read. As I noted in another comment, though, it also isn't difficult to set up a build step, and being able to use JSX is far from the only benefit of doing so.

The point about onboarding deserves more consideration than it receives, too. I'd have an easier time finding good devs to work on a React/JSX project than one in Hyperapp, just because of the latter being unusual.

The syntax isn't so much at issue here; Hyperscript could as well be sugar over React.createElement calls, just as JSX is. Anyone familiar with the DOM can look at it and see what it's doing quickly enough.

What would concern me more would be the underpinnings; Hyperapp brings its own VDOM and ancillaries, parallel to React's, that anyone wishing to work on a Hyperapp project needs to learn to reason about - and that will have their own bugs, infelicities, and performance issues, just as React's does. But React's are generally very well known and not too hard to design around, even if actually designing around them can be a pain on occasion.

No shade on the team, and I'm not trying to turn anyone off the project - I used to be much more of an early adopter until I got badly burned that way a few times, and these are the sorts of considerations that result from that kind of experience. I'll definitely be interested to see how Hyperapp holds up, and what kind of profile it achieves, over the next year or so.

Re: Hyperapp – A tiny framework for building web interfaces

#94
post #20

Haven't been using react because of the JSX, but is this really where we are heading? https://hyperapp.dev/tutorial#rendering-to-the-dom Looks like som obfuscated JS-code..

Elm defines separate functions for each element type which in js would look like

    view: () => div({id: "app", class: "container"}, [
      div({class: "filter"}, [
      " Filter: ",
      span({class: "filter-word"}, "ocean"),
      button({}, "\u270E")
    ]),

I'm admittedly used to this from years using Elm but to my eye I'd far rather use this than JSX.

Re: Hyperapp – A tiny framework for building web interfaces

#98
Dang, I registered hyperapp domain because I thought it was a good name and wanted to build something cool there. Like all side projects it’s not about the idea but the execution. I’ll put this in my bin together with slackday (Should have registered slack:)

On topic: This looks interesting and I Will be giving it a try. Well done!

Re: Hyperapp – A tiny framework for building web interfaces

#99
post #20

Haven't been using react because of the JSX, but is this really where we are heading? https://hyperapp.dev/tutorial#rendering-to-the-dom Looks like som obfuscated JS-code..

Mithril was doing this exact thing before React became big - it's what we're moving away from (with JSX), not where we're heading.

I wouldn't necessarily say we're moving one way or another. React technically released before Mithril. It just so happens React became more popular and JSX is idiomatic in React. But hyperscript is usually compatible w/ JSX (in fact, in Mithril you can choose whether you want to use JSX or hyperscript)

Personally, I think indentation w/ hyperscript tends to look more natural for large sets of props, e.g.

    h('div', {
      id: 'hello',
      title: 'hello'
      onclick: () => {
        console.log('hello')
      },
    }, [
      // hi
      'hello'
    ])

    // vs

     {
        console.log('hello')
      }}      
    >
      {/*hi*/}
      hello
    
With Mithril's variety of hyperscript in particular there are also some other neat features, such as the ability to pass css selectors as the first argument, e.g. `h('input[type=password].password')` or `const TailwindComponent = '.rounded-lg.md:w-56'; const element = `.

Re: Hyperapp – A tiny framework for building web interfaces

#100
post #20

Haven't been using react because of the JSX, but is this really where we are heading? https://hyperapp.dev/tutorial#rendering-to-the-dom Looks like som obfuscated JS-code..

> obfuscated

I’ve heard this reaction before when people see hyperscript-like APIs. I don’t understand it. Isn’t it abundantly clear what is going on if you know DOM and JS? What is your suggestion if you don’t like hyperscript and don’t like JSX? Parsing string templates at run-time?

Post reply on HN