News for hackers. Stuff that matters.
Re:Starting a TypeScript Project in 2021 by qudat on Wednesday April 21, 2021 @04:03PM (#26894713)
> I just write JavaScript?

This is the tell. If you are able to satisfy your business requirements with "just JavaScript" then you are in a completely different world than the people building production-grade web apps and there's absolutely nothing wrong with that. If you can be productive with "just JavaScript" then that's awesome!

However, I'm sure you understand there's a massive difference between simple pages that need *some* interactivity and a full-blown app inside a web browser.

I'm sure you've come across projects that probably didn't need the same tooling that I'm describing which ultimately boils down to a judgement call.

> I've never been like "boy I really need a virtual DOM" so I guess I've never really seen the appeal of React. It just seems like a bundle of complexity, obfuscation and anti-patterns.

That's because you've never needed it before. I've never been like "boy I really need a batteries-included web framework" so I guess I've never really seen the appeal of Rails. It just seems like a bundle of complexity, obfuscation and anti-patterns.

Re:Starting a TypeScript Project in 2021 by gmfawcett on Wednesday April 21, 2021 @04:24PM (#26894958)
> ...than the people building production-grade web apps...

Please don't co-opt the word "production" to mean what you're implying here. Production doesn't mean single-page, reactive, etc. applications, it just means "in production."

Re:Starting a TypeScript Project in 2021 by InvertedRhodium on Wednesday April 21, 2021 @05:16PM (#26895553)
I agree. My workplace has at least a dozen applications deployed to production with "just JS" and they're just at production ready as a react stack would be.

Source: Running "just JS" in production for more than 6 years.

Re:Starting a TypeScript Project in 2021 by bobthebuilders on Wednesday April 21, 2021 @04:43PM (#26895186)
Words are given a meaning by society.
Re:Starting a TypeScript Project in 2021 by gmfawcett on Wednesday April 21, 2021 @04:58PM (#26895367)
Obviously? And a society needs to correct misuses if it wants its words to keep meaning things.
Re:Starting a TypeScript Project in 2021 by bobthebuilders on Thursday April 22, 2021 @10:14AM (#26902991)
Literally?
Re:Starting a TypeScript Project in 2021 by xyzzy_plugh on Wednesday April 21, 2021 @05:14PM (#26895533)
I'm curious -- what is not possible with just JavaScript? Why do you assume "a full-blown app inside a web browser" isn't possible without React or something like it?

Is client-side rendering strictly necessary? Do your websites actually run offline?

I've built websites with React, used React Native -- none of it is necessary, nor the end-all-be-all. There's nothing truly novel going on. You can accomplish the exact same experience with server-side rendering and a tiny smattering of vanilla JS (you can use modern JS and polyfills and webpack/esbuild without React, you know).

For 99.9% of the web, I'd argue you don't need it. I have yet to encounter the 0.1% personally.

If you don't believe me, know that I'm not alone. Take a look at https://levels.io/deviance/ -- PHP and jQuery. What would React provide that isn't possible with his stack?

There is a disturbing amount of kool-aid being consumed around React/Vue/etc. Sure, you can slap together a website in record time with massive boilerplate/templates -- but so can I.

Re:Starting a TypeScript Project in 2021 by __s on Wednesday April 21, 2021 @06:05PM (#26896030)
Here's your 0.1%: a card game, https://etg.dek.im before React I was using PIXI.js, over the years it's transitioned from being fully rendered in canvas to not using canvas at all (& now uses webpack, but years ago I had my own bundler mkcjs https://github.com/serprex/mkcjs which was pretty vanilla js, using require let me share code for awhile between server/client until server was rewritten in Rust)

react-motion made animating card transitions very straight forward

During a game you can click on history items to look at previous game states, this is very straight forward with React's model

Sure you could get this all by rolling your own state dom renderer, but that's like saying you can do everything Lisp does in C. Greenspun's tenth rule rephrased as "Any sufficiently complicated JavaScript UI contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of React."

Re:Starting a TypeScript Project in 2021 by flippinburgers on Thursday April 22, 2021 @01:16AM (#26899004)
Websites that are "production-grade" can be built without tools like react.