All Questions

Coding

Can you point me towards a cool JS framework that is lighter than react but heavier than vanilla javascript?

author Tiago Ferreira

Reply
30 Answers

Sveltejs/kit

writen by Benedikt

I like VueJS but it’s probably not lighter than React, just nicer than using Jsx

writen by Iain Cambridge

preact? 🤔

writen by Daniel Nguyen

Preact seems interesting. So my current website is a js mess! I have vanilla js every where (.js files and embeded on the html files) and I want to start organising things without having to go through a huge refactor…

writen by Tiago Ferreira

Honestly, if I was you I would just go for a rewrite. It’s a frontend rewriting your frontend is the way it’s done.

writen by Iain Cambridge

I know… But it’s sooo messy now! haha

writen by Tiago Ferreira

That’s why you start fresh.

writen by Iain Cambridge

Gatsby perhaps ?

writen by Suvojit Manna

I would certainly go with SSG

writen by Benedikt

This is the lighthouse score without any special optimization

writen by Suvojit Manna

What’s SSG Benedikt?

writen by Suvojit Manna

Static Site Generation

writen by Benedikt

oh yeas, gatsby does that

writen by Suvojit Manna

yes

writen by Benedikt

I use Hugo which is also a static site generator. But I am using vanilla JS with it. Maybe I should research on what framework people use with Hugo

writen by Tiago Ferreira

you do not necessarily have to change to a framework only because you’re using vanillajs

writen by Benedikt

Tell me more Benedikt XD

writen by Tiago Ferreira

petite-vue. It’s almost 100% compatible with VueJS, but it’s only 6kb and doesn’t require a built step.

writen by Marc LG

What do you mean by “lighter than react”. Do you mean easier development or faster load times?

Astro is another interesting option. There comparison to other framework docs are nice. https://docs.astro.build/en/comparing-astro-vs-other-tools/#gatsby-vs-astro

Im pretty happy with Next.js which has some optimisations over pure react.

writen by Stephen N

I used to really like knockout.js I haven’t used it in a long time but it’s still around

writen by James Trimble

jquery

writen by Benedikt

> Can you point me towards a cool JS framework that is lighter than react but heavier than vanilla javascript? > > I have vanilla js every where (.js files and embeded on the html files) and I want to start organising things without having to go through a huge refactor… This sounds like two different goals to me. If you’re looking to learn a cool JS framework there are gajillions of them! Many mentioned in this thread.

If your goal is to reorganize your existing vanilla JS code, you’re probably looking for something like vanilla JS file/folder structure best practices.

Here are a couple of articles on that (not endorsing everything in here, just scanned through them briefly!):

https://gomakethings.com/how-i-structure-my-javascript-projects-in-2022/

https://javascript.plainenglish.io/the-basic-vanilla-js-project-setup-9290dce6403f

While I personally love React and would recommend learning it or an equivalent, I completely understand that based on where you are right now a re-write may not be in order.

writen by Matt Morris

As Matt said: you do not need a framework for a good website. Just optimizing a bit for the platform, performance and structure should be sufficient.

Unless you want to learn/practice a framework

writen by Benedikt

What do you mean by “lighter” than React?

writen by Luca Restagno (ikoichi on Twitter)

react.production.min.js is 4.6 kB react-dom.production.min.js is 43.7 kB the size of the bundle shouldn’t be a problem

writen by Luca Restagno (ikoichi on Twitter)

Dom is a lot

writen by Benedikt

What about <https//alpinejs.dev>

writen by Matthias Bohlen

Or maybe <https//hotwired.dev>

writen by Matthias Bohlen

Matt Morris and Benedikt you are absolutely right. My question was more structure oriented than framework oriented. However, there are certain features I need (like quick list filter + re-render) where I believe a framework like react could really help.

writen by Tiago Ferreira

Yeah but there are possibly even libs for that in vanillajs

writen by Benedikt

Do you want to ask a question?


Related Questions