Live data from Hacker News

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

news.ycombinator.com

41–50 of 197 posts

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

#41

The modern web platform is capable and not bad at all to work with directly. I love seeing projects like HTMX and the recent hyperflask etc showing the way, but you don't need to buy into a project to follow this path, just use the web platform. Edit: for a more practical example, you don't need to go down the web components rabbithole just for native reactive components, MutationObserver can watch for your template…

Web components, copy/paste CSS that does crazy stuff, all of these Web APIs [0]. However, Vue is my go-to. It's just reactivity with files that don't break "separation of concerns". Plus a community if I get stuck. However however, making something super slim bare bones is the most rewarding.

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

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

#42
Programming is managing a pile of complexity that wants to fall over.

Going without a premade framework means it's a fight between you and the pile of complexity. Code will tend to become ugly and slow and hard to change the more you add, so you'll have to go into a cycle that's more like add-refactor-add-refactor. Forward then sideways, forwards then sideways. Do this long enough and you'll will end up with your own libraries and frameworks to manage the complexity.

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

#43

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?

class components (which do not use hooks) are still supported by React with no scheduled deprecation AFAIK.

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

#44

> JS frameworks move really quickly React is a lot more stable than I think you're giving it credit for. > And the stability also means that more time is spent on delivering features Frameworks/libs also exist to save you time, thus letting you spend more time on delivering features. And fwiw, the obsidian team seems to agree in principle. Your link goes to a forum post of some kind, in which one may find a link to o…

> React is a lot more stable than I think you're giving it credit for. That's until you have to use it in a real project, for a long time the go to solution was the facebook maintained CRA which is now deprecated. I have spent a lot more time than I'd like to admit migrating webpack versions when it was considered best practises to use class component with decorator but decorator never was standardised in the browser…

> the go to solution was the facebook maintained CRA which is now deprecated

Not only did they deprecate it, they refused to acknowledge it's existence in the new docs which is wild to me.

It may have changed in the last year, but if you searched for "CRA", it would get 0 results. Again, mind-blowing considering it was the recommended way to build apps with React.

Instead, it was replaced with a section driving you towards adopting Next. Which then had to be whittled away at and updated to include other options all the while the React team acted hostile to any criticism of it. You either used Next or you were shit out of luck.

> I have been outside the ecosystem for a year and looking at the shit show that is nextjs it seems things are even worse than before.

My thoughts about CRA aside, you don't have to use the frameworks (I still don't). And if you remove Next from the equation, things are actually pretty cool. Suspense is cool, and you'll have to rip React Query from my cold, dead hands.

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

#45

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

If it takes you 6 days to set up your environment there are bigger problems than framework choice at play. It does not take more than a couple hours to fully prototype some HTML and some JavaScript/TypeScript in the backend.

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

#47

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…

> and even jQuery is that they are aren't necessary.

JQuery was never considered "necessary". It's just a much prettier wrapper around the native dom apis. Arguing against adopting a more readable api (and codebase), is gonna be a tough sell.

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

#48
Every time a company refuses to use a framework for a large web project, they end up reproducing all of its features - badly.

And, when a new developer comes in who knows React, they can ramp up fast and even if they don’t, there are plenty of resources instead of asking Bob how something works - if Bob is even still working there.

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

#49
post #26

It depends on the target product. I'm working with JS for already 25 years. Tried all of the frameworks, and continue on doing it. And every time I try something new, the refactoring flow turns most of them into NextJS (if it's very UI rich or customer facing or something very web-oriented), or Vite+React+Tailwind (client) and Hono (backend) if it's more of a tinker toy needing more custom solutions. The boilerplate…

I'm curious if you've tried Lit on the frontend, and if so, what you think about it.

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

#50
Spritemate is built with TypeScript + Vite + JQuery, and has a pretty organized structure: https://github.com/Esshahn/spritemate (I do not condone its use of the 'any' type everywhere tho)

I wouldn't use JQuery for a new project, as you can do almost everything it does with straight DOM manipulation. But there are still some strategic vanilla JS/TS packages that come in handy, e.g. clipboard, mousetrap, file-saver, split.js.

Web Components with Lit is kinda fun, though you'll have to deal with DOM shadow roots or disable them.

I would challenge that using a framework leads to less security. In vanilla JS you've got to use something like dompurify religiously to avoid XSS bugs, and you're tempted by the shiny candy-like innerHTML attribute.

Post reply on HN