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.
Ask HN: Best tiny JavaScript framework?
31–40 of 46 posts
Re: Ask HN: Best tiny JavaScript framework?
#32Re: Ask HN: Best tiny JavaScript framework?
#33How about basically no framework with svelte? https://svelte.technology/
Re: Ask HN: Best tiny JavaScript framework?
#34Do 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.
Re: Ask HN: Best tiny JavaScript framework?
#35http://mithril.js.org/ Size < 8kb gzipped (includes routing and ajax)
Do you know of any good mithril projects out in the wild?
Re: Ask HN: Best tiny JavaScript framework?
#36I 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.
Re: Ask HN: Best tiny JavaScript framework?
#37Re: Ask HN: Best tiny JavaScript framework?
#38Have a Look at Backbone.js. http://backbonejs.org I have choosen the lib for similiar reasons and i loved it
Re: Ask HN: Best tiny JavaScript framework?
#39Earlier 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.
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.