Live data from Hacker News

Ask HN: How does one build large front end apps without a framework like React?

news.ycombinator.com

31–40 of 197 posts

Re: Ask HN: How does one build large front end apps without a framework like React?

#32

Vanilla JS is very powerful and has the features you need to build SPAs without a big framework. Proxies and mutation observers are great for maintaining state, Updating the DOM yourself is fine, view transitions are awesome, etc. The only thing that's hard is routing, but there are lots of small dedicated JS libraries to handle that. Here's one I made that gives you the Express API on the frontend: https://github.co…

If you're using Proxies and mutation observers you've probably created your own micro-framework. I wrote something like petite-Vue / Alpine as an excersice and it's really not much to them.

Re: Ask HN: How does one build large front end apps without a framework like React?

#33

The reasons I avoid large frameworks like React, Angular, Vue, and even jQuery is that they are aren't necessary. They are code decoration that slows things down. Here is what you can expect without these: * greater flexibility * faster execution, My current application produces a large single page application that fully renders visually and executes state restoration in about 105ms localhost or under 200ms across a…

Frameworks aren't necessary in the same way that high level languages aren't necessary. It depends, it always does

If you want to ship an MVP next week and you spend 6 days setting up your env, you've already failed. If you can get a framework with at least 80% of the features you need, suddenly you have 6.5 days left to build the product

Re: Ask HN: How does one build large front end apps without a framework like React?

#34
I think that you have a good angle, with latest HTML, CSS and so on. I would consider HTMX or DataStar (SSE) based on where you want to manage the state. Bear in mind that both can coexist.

My priority is code clarity … so while it is not yet tested at scale, https://harcstack.org is aimed to do this on the server side (disclosure - I am the author)

Another determinant is the server side language / approach to templating you choose. With HTMX Python, Rust, Go are all fair game. I’m leading with Raku due to its web framework and ORM.

Re: Ask HN: How does one build large front end apps without a framework like React?

#35
post #23

MDN has your answer, built into the browser, ready to go: https://developer.mozilla.org/docs/Web/API/Web_components If that's not enough, Lit enhances it a bit such that either LitElement and/or litHtml can accommodate whichever style you want: https://lit.dev/

We are using Lit and MobX for a very complex real time communication and collaboration application. It is very simple and we have not had any issues with performance or flexibility.

Re: Ask HN: How does one build large front end apps without a framework like React?

#36
1. web-components https://developer.mozilla.org/en-US/docs/Web/API/Web_compone...

2. router https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern...

The rest should be code organization, not even a build tool.

Can check this example https://github.com/radio4000/components

Re: Ask HN: How does one build large front end apps without a framework like React?

#37

I think that you have a good angle, with latest HTML, CSS and so on. I would consider HTMX or DataStar (SSE) based on where you want to manage the state. Bear in mind that both can coexist. My priority is code clarity … so while it is not yet tested at scale, https://harcstack.org is aimed to do this on the server side (disclosure - I am the author) Another determinant is the server side language / approach to templa…

[deleted]

Re: Ask HN: How does one build large front end apps without a framework like React?

#38

Earlier quoted context omitted.

> React is a lot more stable than I think you're giving it credit for. A lot of the HN zeitgegist would have you believe React is the opposite, sadly.

The React ecosystem moves really quickly, and likes to re-invent wheels. But React core APIs remain relatively stable, I've been using React the same way for many years at this point, and you can ignore the parts you don't like, like I'm ignoring hooks and haven't found a single use case where I needed them.

Could you please tell me how are you avoiding hooks? You're not using useState or useEffects?

Re: Ask HN: How does one build large front end apps without a framework like React?

#39

Earlier quoted context omitted.

The React ecosystem moves really quickly, and likes to re-invent wheels. But React core APIs remain relatively stable, I've been using React the same way for many years at this point, and you can ignore the parts you don't like, like I'm ignoring hooks and haven't found a single use case where I needed them.

Could you please tell me how are you avoiding hooks? You're not using useState or useEffects?

I mainly use React via Reagent in ClojureScript, and literally have no use cases where I need to use useState/useEffects for anything.

Turning it around, what exactly are you unable to do without useState/useEffects?

Re: Ask HN: How does one build large front end apps without a framework like React?

#40
post #36

1. web-components https://developer.mozilla.org/en-US/docs/Web/API/Web_compone... 2. router https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern... The rest should be code organization, not even a build tool. Can check this example https://github.com/radio4000/components

Also, ES modules:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...

You basically have the same capability you have in python or other ecosystems if you can be bothered to attempt what the OP suggests. Determining an appropriate way to organize your code is actually a really hard problem to solve if you've been leaning on 3rd parties to solve it for you. It's definitely a skill worth developing. Once you have it you will begin to dislike the organizational suggestions of others because they'll never fit your problem as well as a hand tuned strategy.

Post reply on HN