Hacker News new | ask | show | jobs
by kypro 246 days ago
First thing to ask is whether you even need a reactive UX/UI. If you don't then just don't use a JS framework. Pick a decent BE framework and build a solid static site.

Static sites can be done really well. I think gov.uk and GDS provide a solid example of how you can build really high quality sites with very minimal amounts of JS.[1]

If however you do need a reactive UX/UI, but don't want to use a FE framework, my advice would be to use the JavaScript event system and roll your own sub/pub system so components can emit custom events which other components can subscribe and react to.

It's not as powerful as React, but I've used this model to build relatively large apps with reactive UIs using just vanilla JS. With the right amount of abstraction event systems can be very powerful and scale extremely well. But they can quickly become an unmanageable mess if you don't abstract.

Depending on your requirements, you could also expand on the event system add centralised state which your components can use if you have more complex state requirements.

At the end of the day it's all about architecture. React gives you a lot out of the box and has some well established patterns around state management. But there's nothing stopping you from building your own solutions tailored to your own problems.

Personally I strongly agree with Obsidian on using JS frameworks. The only issue for me is that it's hard to find developers who care enough to learn your weird FE and use it correctly. In recent years this has always been the problem I've personally had with rolling my own solution. I think the primary strength of React today is simply the fact it's so popular. A good React dev knows how to build a good React app and that's a huge advantage now products can have large teams of frontend developers.

Honestly, unless you're building something really special I'd just take a look at the popular JS frameworks and pick the one best suited for your product.

--

[1] https://design-system.service.gov.uk/