Live data from Hacker News

Show HN: 1 KB JavaScript framework for building front-end applications

github.com

11–20 of 44 posts

Re: Show HN: 1 KB JavaScript framework for building front-end applications

#11
post #9
post #8

Dupe: https://news.ycombinator.com/item?id=14629414

We've come a long way since then. We are super close to 1.0 now and while the API hasn't changed much, there have been numerous breaking changes and we've also added new features, documentation, examples and seen the ecosystem grow too.

For next time: consider sharing a link to a release notes/announcement/update page with all of that information, instead of reposting the main project page URL.

(Great project, BTW!)

Re: Show HN: 1 KB JavaScript framework for building front-end applications

#12
post #11
post #9

Earlier quoted context omitted.

We've come a long way since then. We are super close to 1.0 now and while the API hasn't changed much, there have been numerous breaking changes and we've also added new features, documentation, examples and seen the ecosystem grow too.

For next time: consider sharing a link to a release notes/announcement/update page with all of that information, instead of reposting the main project page URL. (Great project, BTW!)

Thanks! Here is the release notes page of the last dozen of versions for now.

https://github.com/hyperapp/hyperapp/releases

Re: Show HN: 1 KB JavaScript framework for building front-end applications

#13
post #4

So I'm looking at the example JS snippet and suddenly it embeds HTML in the middle. Can someone who knows current JS explain how this even parses?

It's JSX which is basically PHP reborn as a front end technology.

Everything old is new again...

Re: Show HN: 1 KB JavaScript framework for building front-end applications

#14
I am happy after the React fiasco these libraries are finally getting lime light. I have personally used DIO.js (https://dio.js.org), Vue.js and Inferno, but not Hyperapp. So far I have seen DIO outperform almost every library in heavy view cases (table with ~ 1k rows and rows itself having deep nesting). I am curious however how does hyperapp perform.

Re: Show HN: 1 KB JavaScript framework for building front-end applications

#15
post #13
post #4

So I'm looking at the example JS snippet and suddenly it embeds HTML in the middle. Can someone who knows current JS explain how this even parses?

It's JSX which is basically PHP reborn as a front end technology. Everything old is new again...

JSX is more like Cold Fusion, I think.

Re: Show HN: 1 KB JavaScript framework for building front-end applications

#16
post #14

I am happy after the React fiasco these libraries are finally getting lime light. I have personally used DIO.js ( https://dio.js.org ), Vue.js and Inferno, but not Hyperapp. So far I have seen DIO outperform almost every library in heavy view cases (table with ~ 1k rows and rows itself having deep nesting). I am curious however how does hyperapp perform.

I tried Vue.js and thought it was pretty nice. As someone who only dabbles in modern front end in their spare time, it'd be great to see someone with more experience do a good comparison write-up of all the "post-React" alternatives.

Re: Show HN: 1 KB JavaScript framework for building front-end applications

#17
post #14

I am happy after the React fiasco these libraries are finally getting lime light. I have personally used DIO.js ( https://dio.js.org ), Vue.js and Inferno, but not Hyperapp. So far I have seen DIO outperform almost every library in heavy view cases (table with ~ 1k rows and rows itself having deep nesting). I am curious however how does hyperapp perform.

Thanks for the comment :)

Hyperapp doesn't outperform DIO.js, but that was never the mission I embarked on with this project. You can see it benchmarked " rel="nofollow">https://rawgit.com/krausest/js-framework-benchmark/master/> among many other frameworks and you can see it's on the same ballpark as React.

The goal of this project is to minimize the concepts you need to learn to write a modern frontend app while staying on par with what other libraries can do; deliver good performance, but not at the sake of a clumsy or awkward API; reduce the boilerplate and still follow our "simplified" take on Flux or the Elm architecture if you prefer.

Hyperapp is unreservedly functional, we don't have stateful components, use `this`, classes or have more than one way to do the same thing.

We are not just about saving bytes either, but size and our brutally small code base is important for a few reasons. The idea behind the entire thing being 300 LOC is that _anyone_ can understand how everything works within a few hours. It's genuinely possible to understand not just what it does, but how it does it.

IMHO a normal person can't do that with React, or DIO, or most of the other large-ish frameworks out there. Even Preact, I found it too large for my taste. Yes, minified and gzipped is like 3.4 KB, but that translates to almost 800 LOC. It's an outstanding achievement considering it's just a fraction of React, but you are only getting React+ReactDOM.

Hyperapp is not perfect, but you are getting React+ReactDOM+Redux+ReduxThunk out of the box.

Just for a light (and harmless) comparison, this is a +/- counter in DIO.js:

    class Counter {
      getInitialState () {
        return {
          count: 0
        }
      }
      increment () {
        return {
          count: this.state.count + 1
        }
      }
      decrement () {
        return {
          count: this.state.count - 1
        }
      }
      render () {
        return [
          this.state.count,
          h('button', {onClick: this.increment}, '+'),
          h('button', {onClick: this.decrement}, '-')
        ]
      }
    }

    dio.render(Counter);

And here is the same in Hyperapp:

    app({
      state: 0,
      actions: {
        add: state => state + 1,
        sub: state => state - 1
      },
      view: (state, actions) =>
        
          +
          {state}
          -
        
    })

Re: Show HN: 1 KB JavaScript framework for building front-end applications

#18
post #14

I am happy after the React fiasco these libraries are finally getting lime light. I have personally used DIO.js ( https://dio.js.org ), Vue.js and Inferno, but not Hyperapp. So far I have seen DIO outperform almost every library in heavy view cases (table with ~ 1k rows and rows itself having deep nesting). I am curious however how does hyperapp perform.

I honestly love that these libraries keep getting smaller and faster. People have really started to hate these newer libraries, but as long as they are getting better, I'm fine with experimenting with them.

Vue even has a lighter alternative called Moon[1], which was on HN a while back. I'm curious as well about the performance of HyperApp. Looking at the JS frameworks benchmark[2], it's not the best, but not the worst either (pretty good for squeezing it all into 1kb).

[1] http://moonjs.ga

[2] https://github.com/krausest/js-framework-benchmark

Re: Show HN: 1 KB JavaScript framework for building front-end applications

#19
I started using HyperApp in my company's admin dashboard to render a complex diagram.

In my experience over the past few months, HyperApp works very well, the documentation is solid, the performance is great, and we've encountered no bugs so far.

If I had to do it over again, I would choose HyperApp again. Great work, folks.

Re: Show HN: 1 KB JavaScript framework for building front-end applications

#20

I want to see the trend of maximal libraries in javascript now. Show HN: 2 MB JavaScript library for building front end applications with a lot of useful interactive ui components. like https://github.com/nlp-compromise/compromise

I agree. The fight for really small frameworks is most relevant for consumer apps, especially ones consumed on mobile. But even on mobile, it's primarily relevant because customers get minimal value from your app or are bad at accurately assessing the value they get. In my day job, I work on a system where business users spend several hours a day using it. Loading a MB of minified JS has such a limited effect on the…

I used to need to use a large web app like that at work. You'd get a login page. Submitting your login caused the app to load, which was many MB. Once that was all downloaded, the page would finally display, and you could do what you needed to. (In our case, you usually only needed to look something up quickly and be done, which is a bit different than your case.) But the real kicker is... the company VPN was slow. Really slow. In fact, most of the time, as soon as the app finally loaded, the first thing it did was pop up a dialog telling you your session had expired due to inactivity and send you back to the login page to start over from scratch.

I sure missed the simple, small, usable, multi page site we used before the "upgrade" to the single page app competitor! (On top of that, the old one worked fine on mobile. The new one, not at all.)

Post reply on HN