News for hackers. Stuff that matters.
Re:Show HN: HyperApp – 1k JavaScript framework for building ... by gandreani on Tuesday May 22, 2018 @01:49PM (#17127920)
In the same vein there's Mithril. It's 8kb but includes a router and a fetch polyfill!

I love these little JS frameworks :)

https://mithril.js.org/

Re:Show HN: HyperApp – 1k JavaScript framework for building ... by dsego on Tuesday May 22, 2018 @03:16PM (#17128613)
Mithril is nice. One downside is it doesn't lend itself really well to compound components. Everything has to be passed down through attributes.
Re:Show HN: HyperApp – 1k JavaScript framework for building ... by elbear on Wednesday May 23, 2018 @04:05AM (#17132191)
You can define components as simple functions and avoid passing things down through attributes. If you use TypeScript with it, the compiler will always make sure you pass the right arguments to the component, so it's very easy to compose your UI.

I also avoid keeping state on components. I know this is controversial and it requires a bit of overheard. However, the simplicity offered by having all state in a single object is worth it for me.

Re:Show HN: HyperApp – 1k JavaScript framework for building ... by davegauer on Tuesday May 22, 2018 @08:58PM (#17130749)
True, but by passing the same object as an attribute to a pair of Mithril components, I can have them share state. (Can be restricted to the scope of a parent component if desired.) Is there an additional requirement for compound components?
Re:Show HN: HyperApp – 1k JavaScript framework for building ... by dsego on Wednesday May 23, 2018 @03:26AM (#17132000)
There isn't a built-in way to detect type of component. It would be useful when you want a parent component to encapsulate certain logic/behavior but not hard-code the presentation. I know there's name() but it only works if my component is a function. Otherwise I think I need to assign some special identifier, which sucks.

You can see a great presentation of the technique in this video: https://youtu.be/hEGg-3pIHlE

Re:Show HN: HyperApp – 1k JavaScript framework for building ... by soapdog on Tuesday May 22, 2018 @02:05PM (#17128054)
Just want to second Mithril here. It is an awesome and refreshing approach. I love it too.
Re:Show HN: HyperApp – 1k JavaScript framework for building ... by starbuzz on Tuesday May 22, 2018 @07:42PM (#17130404)
Oh, Mithril! All folk desired it. This one is great too.