HACKER Q&A
📣 bjackman

Help me pick a front-end framework


Hopefully this can be a fruitful discussion since I think I have a quite clear but also reasonably common set of needs. I have a feeling that if you're "in the world" of frontend engineering you get a much more intuitive feeling for these tooling questions than I can get at a distance by reading SEO-spam developer blogs and State Of JS (although the latter does seem really helpful).

I'm thinking of building a text-annotation based app _alone in my spare time_. The core usage loop is about viewing and interacting with "visual markup" applied to a body of text. So lots of tooltips/hoverbars I guess.

Some notes about my needs:

- This would be by far the most complex GUI I've ever built.

- Relatedly, I expect to get the UX design horribly horribly wrong and start from scratch at least once.

- I also suck at making things look pretty and also don't find this problem very rewardinging to think or read about.

- All of the above point towards a framework that is pretty easy to get started in and prototype quickly.

- Because of limited time, and low confidence in UX design decisions, I would often follow the path of least resistance and the end product would be heavily influenced by the tools I used to build it.

----

- Despite what I said about quick rampup I'm fine with learning new languages.

- Weak typing is a deal-breaker. If using JS, must have good TypeScript integration or similar. (Does anyone still write plain JS?)

------

- I don't think I'll want a native desktop app but an iOS/Android version could make sense. But I'll never have time if this can't share most of the code with the web version.

-------

- I don't really have the discipline for manual testing. Luckily I also find it satisfying to over-invest in test automation. I don't really know how this is done in frontend land but good tooling would be a big plus.

-----

- I'm happy to sacrifice one or more of the other requirements in favour of tools that are likely to be maintained 10 years from now.

----

What are HNs thoughts?


  👤 chaos_emergent Accepted Answer ✓
Sounds like you're in a similar place as me a year ago. Here's a list of tools that I'd use:

- TypeScript for language. Gives you an insanely expressive type system that is a step up from Python duck typing (which you seem familiar with after perusing your GH).

- React for framework. Frontend experts will shit on it for being non-performant or having a poor UX, but the community is massive and you'll have a ton of support both in terms of people that can help you when you're stuck and libraries that do a lot of work for you.

- Jest for code testing and Cypress for integration testing. The obvious tools for the job.

- Chakra UI for a UI framework. Has all the bells and whistles, DX is great, and there are plenty of escape hatches for non-default behavior.

- TipTap for text editor. This is the _most_ at risk of not being supported in 10 years, but I still see it as a low risk because they have a solid monetization strategy in place.

- Electron for the desktop app. If you _really_ don't want to use Electron then use Tauri (what we use at my company). It uses the native browser engine so package sizes are ridiculously small and it's insanely performant.

- Don't worry about the mobile apps for now. At the very most, just make it a web app that has responsive theming for mobile.

Good luck and have fun!


👤 ryukoposting
As a non-web developer who needed to learn a framework that "just works" for a hobby project, I suggest Svelte.

It was very easy to set up (I had previously had yelling and cursing matches with Angular).

Typescript integration is one little script away (and that script is included with the skeleton project every tutorial tells you to use).

Making a UI that "just works" is stupid simple. It's intuitive- easy to throw stuff together, but also easy to make things that scale and compose nicely. Svelte has been the most bullshit-free experience I've ever had in any of my web frontend escapades.

Frontend deployment? scp the build folder onto an EC2 instance running nginx. Done.

For styles? KISS. Use mvp.css. to use it, slap a single line of HTML into the top of index.svelte. Boom, everything is pretty enough that the average user will notice nothing out of the ordinary.

The stack I've settled on for my web projects is this:

- Svelte for the UI/UX.

- mvp.css for all of my styling needs.

- For the database/backend API/etc, Rails with postgres.

- Infrastructure? An ec2 instance. Nginx. Certbot, assuming that counts as infrastructure. Maybe some docker containers if I'm feeling fancy.

With this stack, a single person with very little web experience can have a fully-functioning MVP for a fairly sophisticated service deployed in a couple of weeks. It's unsophisticated, and it probably doesn't scale to a million billion users, but setup is easy, deployment is easy, maintenance is easy, and all of the necessary structure is there to let you scale up to a more sophisticated architecture later.


👤 eric4smith
Html + CSS + Javascript in 2022 is mostly what you need.

Unless your job is going to require a framework, it’s really not necessary.

Maybe I’m the old curmudgeon who is more concerned about putting out something that works and get customers/revenue quickly, than messing around with the latest Javascript toolchain to ensure it builds in Docker.

You csn get a ton done with Javascript and Tailwind or DaisyUI. In fact almost 90% of what you need.

And with the advent of new backend frameworks like Liveview that patch the dom, I believe things like Angular, React, Vue are on the dying list.


👤 vladstudio
As in every post about front-end frameworks, I must mention HTMX and Unpoly:

https://htmx.org/

https://unpoly.com/

To learn more about the concept, please take a look at Essays here: https://htmx.org/essays/


👤 oblak
Vue is the sort of GUI framework I would've written if I had the talent to do so. Thanks to its reactive nature, powerful things can be extremely easy. Very nice if one knows what they're doing. Power can be misused by the less experienced but what can't?

TS support is optional.

Web Analytics Made Easy - Statcounter