Live data from Hacker News

Ask HN: Best tiny JavaScript framework?

news.ycombinator.com

31–40 of 46 posts

Re: Ask HN: Best tiny JavaScript framework?

#31

Earlier quoted context omitted.

I need a footprint that works well with mobile devices, slow internet connections, etc. Also, I prefer smaller frameworks as they have less cognitive load - I usually am more able to read the source code, understand the API, and so on.

I posted the suggestion above before reading this. I don't think you can get smaller than JavaScript + Handlebars. This is the route I took for pages that need to run in slow mobile devices. You can even precompile your Handlebars templates as an optimization and include a smaller subset of the Handlebars library that is just the runtime without the compiler.

Yeah handlebars is not a bad thought. And that's cool about the runtime optimization, I didn't know that.

Re: Ask HN: Best tiny JavaScript framework?

#34

Do you need a framework at all? I think you could get away with just plain JavaScript and include Handlebars if you want a templating engine. Maybe add Jquery if you want something just above plain JavaScript. Edit: Another benefit of Handlebars is that if you ever do decide you need a full framework, you can use Ember and leverage your Handlebars templates.

Yes, I am definitely considering just using plain Javascript. I just have a fear of maintaining plain Javascript applications - the hacks just seem to build up. Then again, maybe I should just put the time in to make a well architecture and maintainable plain vanilla Javascript application. I'm definitely a fan of minimalism.

What "hacks" do you expect from using plain JavaScript? The biggest hack in plain JS is usually in my experience creating HTML elements dynamically based on data. That's where Handlebars would come in.

Re: Ask HN: Best tiny JavaScript framework?

#35
post #16

http://mithril.js.org/ Size < 8kb gzipped (includes routing and ajax)

Do you know of any good mithril projects out in the wild?

https://voyager.cancoin.co/ is a bitcoin block explorer using Mithril with Websockets (and an Elixir/ZMQ backend). https://github.com/cancoin/bitcoin-voyager-web

Re: Ask HN: Best tiny JavaScript framework?

#36
post #14

I like the dom wrapper this guy came up with: https://hackernoon.com/how-i-converted-my-react-app-to-vanil... I adapted it for myself here: https://gitlab.com/heycato/domjs/blob/master/dom.js

"VanillaJS is a framework written many years ago by a dude called Brendan that is rarely used anymore." That is the funniest thing I've read all day.

oldy, but a goody: http://vanilla-js.com/

Re: Ask HN: Best tiny JavaScript framework?

#39

Earlier quoted context omitted.

Yes, I am definitely considering just using plain Javascript. I just have a fear of maintaining plain Javascript applications - the hacks just seem to build up. Then again, maybe I should just put the time in to make a well architecture and maintainable plain vanilla Javascript application. I'm definitely a fan of minimalism.

What "hacks" do you expect from using plain JavaScript? The biggest hack in plain JS is usually in my experience creating HTML elements dynamically based on data. That's where Handlebars would come in.

I just mean that over the course of building vanilla JavaScript applications, people often add layer of functionality that are implemented worse than libraries, are harder to maintain, or are not as compatible.

Like yes, I could build my own routing library, and that is probably fine, and yes I can build my own state management library, and so on, but at a certain point you are just rebuilding a framework from scratch, and oftentimes not very well.

Post reply on HN