5 ms·
On the third hand, some people use React and some framework to write static web page...
by dorfsmay 1y ago
On the third hand, some people use React and some framework to write static web page...
- lolinder 1y agoAnd if you can point me to an example of that I will happily lampoon them. If we're talking about Medium, then yes, Medium is a complete disaster zone that should not be emulated anywhere. Their reader-facing use case does not require JavaScript at all except as a light optional seasoning on top. All I'm saying is that we need to actually talk about use cases whenever we're talking about frameworks, which we almost never do. Failing to specify the use cases turns the conversation incoherent because we end up having two different conversations without even realizing it.
- austin-cheney 1y agoThe primary use case for these large frameworks is hiring.
- emseetech 1y agoNot just some people. There are a wildly unnecessary amount of marketing pages and pages with basic forms that are built using React. Every time I've been at a company and suggested moving to vanilla css+html or a static generator, the reaction is like I brought up rewriting in assembly. There needs to be a significant push for simplification of the default toolchain. I understand using React, but reaching for it by default at the beginning should be seen as unnecessary complication. Especially because it's 100x easier to move from html+css to a framework than it is to move from a framework to literally anything else.
- sanderjd 1y agoThere is significant path dependency in either direction. A sibling comment to yours described it very well. There really isn't a good substitute for understanding early on whether you're going to be making a website or an application.
- emseetech 1y agoUntil you have a definitive answer, err on the side of simplicity.
- tomnipotent 1y agoYou err on the side of what's best for your business given known constraints. Usually frameworks make teams more productive, and that's worth more than "simplicity", whatever that means to you.
- sanderjd 1y agoYou never have a definitive answer. It's always probabilistic. You make the decision that you think has the highest odds of success at every point in time.
- emseetech 1y agoSuccess for the current requirements? Or success for an imagined future?
- sanderjd 1y agoFor an imagined future. If you're building something with specifications, then what are we even talking about? You know what you need to build so just build that. But this thread is about what to do when you don't know. "Start the simplest way" is not always the right answer, because you have some information about what you plan or want or hope to build, so you can use that information. Not everything is a set of hyperlinked webpages, and you often know that right away, even when you don't have many details sorted out at all.
- emseetech 1y agoWe have a fundamental difference of philosophy.
- 1y ago
- zarzavat 1y agoWhy not use React for that? If I use React for everything then I don’t have to decide, I don’t have to use two different tools. Consistency is fantastic, if you only use nails then you only need to carry a hammer. Why use two incompatible languages (JSX and HTML) for different types of web pages, when you could just always use JSX? React can statically render to HTML if your page is really static. I think what you’re really complaining about is that people use React for static content and don’t statically render it first. That is sloppy, I agree. But it’s not React itself that’s the problem but rather the developers who don’t care what they are doing.
- MrJohz 1y agoIn theory, you can completely statically render everything. In practice, every static site I've seen built with React also uses dynamic client-side components, either as a prerendering mechanism, or because there are dynamic toggles and things on the site that are easiest to build as React components. This usually means that a lot of excess Javascript gets loaded on the client that isn't usually necessary. The islands/RSC work seems to offer some improvements to this, but most of these websites still include a full copy of React on the page to essentially do what the speculation rules API and a `<dialog>` element could do just as easily.
- emseetech 1y agoHTML will be around long after React is dead. What guarantee does a React codebase have that its toolchain will still work in 5 years? We've seen build tools come and go, whole approaches deprecated. What if a security update requires upgrading to a non-compatible version of React, therefore necessitating a considerable refactor? Meanwhile, the original Space Jam website still renders perfectly. The standards are superior to the frameworks built on top of them. Abstractions come and go, but web standards, once adopted, have a solid track record of sticking around.
- dismalaf 1y agoThere's a shocking amount of people who don't know that vanilla JS is a thing... They only know React...