Better HN
topnewbestaskshowjobs
Log inSign up

hyperapp

217 karma · joined Jan 30, 2017 (9y ago) · 120 submissions

Submissions

91.

Show HN: 1 KB VDOM library with focus on minimalism and user friendliness(github.com ↗)

4 points · by jbucaran · 9y ago · discuss

92.

Show HN: D3.js/HyperApp-powered interactive fractals(codepen.io ↗)

5 points · by jbucaran · 9y ago · discuss

comment 9y ago · link · parent

This is great. Let me say it again, great!

My feedback would be to make it easier to discover fonts. Right now I only have a few fonts to choose from the select box.

Another issue is that once a font is selected, I must erase the text in the select to get the select items drop down again.

comment 9y ago · link · parent

This is helpful to me because I want to learn how to explain (complex) systems.

Incidentally, this complexity is what led me to build my own little vdom utility <https://github.com/hyperapp/hyperapp>.

I'll be drawing inspiration from this chart to explain it.

comment 9y ago · link · parent

Same here. Flow is great though and you can use it without annotations too, just not as useful.

See: http://thejameskyle.com/adopting-flow-and-typescript.html

comment 9y ago · link · parent

Thanks! I love Elm too. Elm is functional programming for the masses! Recently I'm kind of more curious about ClojureScript.

That said, you can totally use Flow or TypeScript with hyperapp.

comment 9y ago · link · parent

tl;dr Yes.

Originally it was just hyperapp, but many people asked for only the virtual DOM, so picodom was born.

comment 9y ago · link · parent

If you grab hyperapp from the CDN https://unpkg.com/hyperapp@latest, you'd use it like this:

> const { h, app } = hyperapp

If you setup a simple build pipeline using npm/yarn + browserify you would instead:

> const { h, app } = require("hyperapp")

And if you compile your app with babel using babel-preset-es2015, etc., then you can use the ES6 import syntax.

===

Here are some gists to help you on your journey:

- hyperapp + hyperx + rollup minimal boilerplate https://gist.github.com/jbucaran/fac2c3de24e5171596fb189f9c1...

- hyperapp + hyperx + webpack minimal boilerplate https://gist.github.com/jbucaran/c6a6bdb5383a985cec6b0ae4ebe...

- hyperapp + jsx + rollup + buble minimal boilerplate https://gist.github.com/jbucaran/f714dd6d64041591e5e53dbff85...

- hyperapp + jsx + rollup minimal boilerplate https://gist.github.com/jbucaran/0c0da8f1256a0a66090151cfda7...

- hyperapp + jsx + webpack minimal boilerplate https://gist.github.com/jbucaran/6010a83891043a6e0c37a3cec68...

- hyperapp + hyperx + browserify minimal boilerplate https://gist.github.com/jbucaran/48c1edb4fb0ea1aa5415b6686cc...

- hyperapp + jsx + browserify minimal boilerplate https://gist.github.com/jbucaran/21bbf0bbb0fe973455056648831...

comment 9y ago · link · parent

>=IE10

comment 9y ago · link · parent

Thanks! You can find more examples on CodePen.

- https://codepen.io/hyperapp

comment 9y ago · link · parent

> What are the target developers for your library?

Anyone. Big app devs, small app devs. For the record, you can user hyperapp with any of the following technologies:

- JSX

- A string template literal based solution like hyperx or t7.

- The built-in hyperscript-style `h` function (https://goo.gl/da3U3P).

comment 9y ago · link · parent

Yes.

http://www.stefankrause.net/js-frameworks-benchmark6/webdriv...

comment 9y ago · link · parent

Yes. It supports JSX and also ES6 template literals via hyperx or t7:

- https://github.com/substack/hyperx - https://github.com/trueadm/t7

comment 9y ago · link · parent

> How does this compare to Mithril etc?

I am the author of HyperApp and also a big fan of Mithril. I'll try to compare both as fairly as I can. This is not a full or even adequate comparison, I'm just adding to the thread.

Mithril has something called auto-redrawing, that IIRC re-renders the application after DOM events by default. This can be seen as inefficient, but Mithril throttles rerenders, which ameliorate any issues caused by it.

Mithril has no state management solution out of the box.

This may be desirable if you want to experiment with different state management architectures until you find one that you like.

HyperApp has its own built-in state management solution which is inspired and draws a lot from the Elm Architecture. In this way, it's a lot like React and Redux, but since everything is built-in, there's essentially 0 boilerplate.

The drawback is that there's no other state management available for HyperApp.

Mithril has stateful components, which is a simple and useful way to reuse code across your app and easily port to other apps.

HyperApp has custom tags, which are pure functions and stateless. They only accept props and know how to render themselves. If you are coming from React, Backbone, Angular (basically everywhere else), scaling applications will seem difficult at first, but it's not, it's just different.

We are currently working on a component abstraction which is based on the idea of a fragmented state. We'll release 1.0.0 when that's done.

Mithril is bundled with m.request, which simplifies making HTTP requests.

HyperApp has no built-in facilities to help you make HTTP requests. I am not interested in a custom xhttp solution when there is a `fetch` standard.

105.

Show HN: 1kb JavaScript library for building front end applications(github.com ↗)

187 points · by jbucaran · 9y ago · 40 comments

106.

Show HN: picodom – 1 KB Virtual DOM builder and patch algorithm(github.com ↗)

2 points · by jbucaran · 9y ago · discuss

107.

Show HN: 1kb JavaScript library for building front end applications(github.com ↗)

4 points · by jbucaran · 9y ago · discuss

comment 9y ago · link · parent

So, that's what "Show HN" was for. Thanks!

109.

JavaScript meets Elm(github.com ↗)

2 points · by jbucaran · 9y ago · discuss

comment 9y ago · link · parent

Depending on the application needs, I'd try something new:

- https://github.com/hyperapp/hyperapp

- https://github.com/KingPixil/moon

- https://github.com/pakastin/redom

And, if you must use React, then I'd choose Preact instead.

111.

Build your own next generation view library: 1kb vDOM builder and patch function(github.com ↗)

2 points · by jbucaran · 9y ago · 1 comment

112.

Blog: Pure functional programming with HyperApp(glebbahmutov.com ↗)

2 points · by jbucaran · 9y ago · discuss

113.

HyperApp takes functional JavaScript to Web applications(infoworld.com ↗)

3 points · by jbucaran · 9y ago · discuss

114.

1kb JavaScript UI Library HyperApp Benchmarks on par with InfernoJS(github.com ↗)

3 points · by jbucaran · 9y ago · discuss

comment 9y ago · link · parent

Redux is an opinionated implementation of the SAM pattern for React. The same pattern can be seen in the Elm Architecture.

• http://sam.js.org

Now, I don't know how old this pattern is, or whether it was already commonplace 15 years ago. I was introduced to these ideas first through Redux, then learned Elm, the found SAM.

116.

The fish-shell Cookbook: Tips and recipes for fish, from shell to plate(github.com ↗)

2 points · by hyperapp · 9y ago · discuss

comment 9y ago · link · parent

Thanks. I'm glad you ask. The motivation was a web client for a research project at work. My first choice was React+Redux, since that's what we already use for our service Qiita, but I wanted something more lightweight.

I made the first prototype using Elm, but it was too painful to integrate with third party components, like CodeMirror[1].

I made the next prototype using yo-yo, but yo-yo is agnostic about state management, lacks inline CSS styles (by choice) and it's based in morphodom (which updates DOM nodes directly) whereas I preferred a virtual DOM approach like Snabbdom or Vidom.

I also considered choo.js, a framework based on yo-yo, but it has the same limitations as yo-yo. It was also very difficult to integrate third party components with it, e.g, CodeMirror, involving the creation of a portal[2], reminiscent of Elm ports.

I also couldn't agree with some of its API choices like namespaces, router design and models as containers for state objects.

HyperApp is ~1kb, and takes inspiration from several sources: the Elm architecture[3], yo-yo/choo's API, the SAM pattern[4], Snabbdom and Vidom.

[1]: https://codemirror.net

[2]: https://github.com/trainyard/choo-codemirror#choo-codemirror)

[3]: https://github.com/evancz/elm-architecture-tutorial/#the-elm...

[4]: http://sam.js.org

118.

1kb functional JavaScript library for building UI applications(github.com ↗)

3 points · by jbucaran · 9y ago · 2 comments

1234