Ask HN: What JS framework/library would you use for lightweight frontend work
I am soon starting a project where I am in need of a JavaScript framework to do pretty much only very lightweight frontend work with. I have looked around at things like react, angular, vue, svelte, ember and so on but all of them seem pretty hefty for the purpose. I could use vanilla JS but I am in the mood for testing something new. The other parts of the tech stack are going to be node/express, some css framework like tailwind or bulma and sqlite. Basically to be as "portable" as possible.
Any advice or tips would be greatly appreciated.
36 comments
[ 3.3 ms ] story [ 71.8 ms ] threadOr, if you're in the mood for something different, you could also consider native WebComponents. That set of APIs has broad browser support, and can be powerful enough as-is for many applications.
https://shoelace.style/
Good constructs, low complexity space, no compilation required.
Tailwind is also excellent.
You'll be saving yourself a lot of time by not googling version compatibility issues or some obscure package bug of the front-end framework itself.
You only need full blown frameworks when you create an application which multiple teams would be working independently on and preferably using CI-CD as the means of deployment, this is absolutely not needed when you're trying to validate a solution or build a one-off project.
Why not go plain HTML? (with the odd little JS snippet for anywhere it is truly needed)
You can also enable JSX [1] if you prefer that to hyperscript.
A site with more code examples and up to date [2]
[0] https://mithril.js.org/
[1] https://mithril.js.org/jsx.html
[2] https://mithril-by-examples.js.org/
[0] https://preactjs.com/guide/v10/differences-to-react
Edit: about solid, the normal "mode" precompiles jsx, but i believe you can use it even without it a la hyperscript
All the composition without any luggage or slowness forced on the user.
Maybe try https://github.com/solidjs/solid
As a next step, I wanna build my own web components and include the tags on the backend. I want to develop frontend apps by controlling them on the backend.
Ficusjs looked interesting.