9 ms·
My tip: you start by avoiding React altogether. It sounds bad, but if you can, do oldschool SSR with HTMX or the like. It's sooooo much better. I was paid to
by OtomotO 2y ago
My tip: you start by avoiding React altogether.
It sounds bad, but if you can, do oldschool SSR with HTMX or the like.
It's sooooo much better. I was paid to develop frontends in React for 4 years, I wrote my first website in 2005... I am currently migrating one client project from React to HMTX and it's sooooooooo incredibly much better.
There are less bugs, less footguns with wrongly applied hooks...
If you need to do CSR, use Solid or Vue, but don't do React.
If you have no say in it: good luck!
- audessuscest 2y agoHTMX is certainly easier, but it's the worse if you want to actually learn FE
- digdugdirk 2y agoAs someone who isn't a web developer, what do you mean by that?
- audessuscest 2y agoHTMX abstracts functionality into pseudo-HTML attributes, allowing you to handle tasks like event binding and DOM/content manipulation that would typically require JavaScript. By using HTMX, you primarily focus on learning HTML and its attributes, with minimal need to learn JavaScript.
- baq 2y agoNot sure how to interpret what you're saying. HTMX allows you to learn the very basics: the HTML which is almost verbatim turned into DOM which the browser renders. It's the FE. Everything else is layers upon layers of abstraction which ultimately compile down to the DOM representation of HTML. ...or to put it differently, quoting HTMX's author: using HTTP to transfer HTML? How queer!
- audessuscest 2y agoSounds like you don't know anything about FE except htmx...
- szundi 2y agoHe has a point though
- akdor1154 2y agoStrong disagree, it would be a great way to learn vanilla html/CSS/js without kneecapping yourself.
- audessuscest 2y agoHow do you learn JS by using htmx exactly ?
- yawaramin 2y agoBecause htmx is limited in scope. And it's encouraged to use JS for the parts of your app that would benefit from it. But it's encouraged to do so in a way that fits with web standards. Eg https://dev.to/yawaramin/handling-form-errors-in-htmx-3ncg https://dev.to/yawaramin/handling-form-errors-in-htmx-3ncg
- runako 2y agoCouldn't one say the same thing about using any framework that provides capabilities that otherwise would have to be learned?
- wslh 2y agoIs discussing React vs. HTMX like comparing apples to oranges?
- recursive 2y agoMaybe, but it may be reasonable to do that sometimes. What fruit should we bring to the picnic?
- wslh 2y agoYes, my comment was not pedantic at all it is great to discuss intersections and symmetric differences. In this specific case. Just I thought that the intersection was small while the symmetric difference is much bigger. The picnic example would be more like mixing them up though ;-)
- Tade0 2y agoOr what goes well with milk.
- toastercat 2y agoYes. Something HTMX evangelists always forget to mention is that HTMX is not a replacement for React -- HTMX + a backend is. This introduces a whole new layer of complexity; it's a total tradeoff. That is to say there are probably React apps that would be better as HTMX apps.
- exceptione 2y agoAlso, does that currently mean that the backend will be Javascript? In the browser we have no choice, but I prefer to prevent that accident from spreading to my servers.
- toastercat 2y agoNo. Backend can be anything.
- thunky 2y ago
- klaussilveira 2y agoStill no good component or UI libraries for HTMX.
- xigurat 2y agoProbably there will never be, that's like saying "Still no good component or UI libraries for HTML". HTMX philosophy is to be timeless and agnostic as HTML is, is just a nice extension on top.
- clivestaples 2y agoThis is the sticking point for me. I get so many gains in Rails but I quickly sink into time-consuming component research/building. My eyes are always open for HTML/JS component libraries along the lines of react-aria.
- Weetile 2y agoI've had a great experience using Golang + HTMX + DaisyUI using the tailwind-cli-extra standalone tool, negating the requirement for npm at all.
- nox101 2y agoCan webcomponents be trivially used with HTMX? Like for example: https://shoelace.style/ https://shoelace.style/
- klaussilveira 2y agoShoelace is great, but not robust. No data table, no date/time picker, no pagination, no sidebar.
- alexpetros 2y agoAnything that can be loaded as a stylesheet or a script tag works great with htmx. These are not htmx-branded libraries... because they're just web libraries.
- klaussilveira 2y ago
- exceptione 2y agoThe problem I have with many of such advice: 1) what do you precisely mean and 2) why do you think so. Do you mean the whole field, so from B2B SPA apps to personal blogs? "If you want to replace jquery, use Vue!" would be more helpful to understand. The problem is that we don´t know if the advice comes from a "bootcamper" that has only learned Javascript. You know, some people manage to build low-interaction sites that will render a blank page when Javascript is disabled. The "why" is also of interest to see if the advice is applicable. If not react, then why not preact for instance?
- OtomotO 2y agoNo bootcamp, university, albeit only a BSc, because I didn't feel like academia afterwards with a full time job and now I've moved on. 9 years of professional experience. Having worked and paid to do so with Java, Scala, Kotlin, Python, JavaScript, Typescript, Python Been working with Rust since 2015, have prior experience with C++, had to work with C, Haskell and logic programming (not prolog) at University. Also did C#, Golang, Lua, Zig and many more. Does that give more authority to my statement? I sincerely hope not!
- hirako2000 2y agoMy main dislike for React is that I'm constantly learning React, its intricacies and idiosyncracies. Disproportionate amount of energy I would rather spend learning JavaScript, something that would last. Using React since 2013. Each release is an excitement, until I realise some chunk of concepts which altogether took months to fully grasp, are gone. Some even needed to be unlearned. A lot of abstractions. React doesn't make you a better developer, it makes you a better React developer. I don't feel that with Vue. I don't feel that with most libraries I use.
- qt31415926 2y ago> React doesn't make you a better developer, it makes you a better React developer. React's pure component functional style translates really well to nearly every other type of software development.
- johnfn 2y agoWhy is this attitude so pervasive? It's akin to writing backend and saying you should avoid Postgres altogether and use text files saved on the hard disk.
- OtomotO 2y agoIf postgres were worse than the alternatives I wouldn't use it. And React is worse than the alternatives. All it has going for it is the huge ecosystem.
- mollerhoj 2y agoHow are these two scenarios comparable?
- mixedCase 2y agoBecause both are ubiquitous to the point they basically dominate a large part of a usecase's toolspace.
- mlboss 2y agoSql syntax does not change every month
- koito17 2y agoJSX syntax doesn't change every month either. React itself, as a library, has a great deal of backwards compatibility. What does churn is the tooling (e.g. abandoning Webpack for Vite). But the actual API and syntax has remained virtually unchanged. You can still write and use class components today. Hooks themselves are nearly 7 years old at this point, with no sign of changing. You are not required to use "server components" or any of the new features in React. Meanwhile people in this thread recommend "simple" alternatives like Vue that produce breaking changes so massive it splits their ecosystem in half.
- vips7L 2y agoI stopped writing React for probably 2 years and now the whole framework is different and I have to relearn the entire thing. Defining a component is completely changed, changing state is completely changed, and the component lifecycle is completely replaced and it feels like the complexity of the framework has gone through the roof. At least for me this is the type of churn that makes me not want to do it anymore.
- MarcelOlsz 2y agoJust use Vue lol.
- ramses0 2y agoI've avoided React as much as possible. Dabbled (positive experiences) with Vue. What's your recommendation w.r.t. "Components"? I've tried doing web-components from scratch (frameworkless) but nested web components have nasty gotchas. eg: <todo-list><%for...><todo-item .../></for%></todo-list> I've poked at `lit`, read through `htmx`, but really what I want is "custom elements" (including visual styling) on the front-end that I can map back to JSON on the backend. The CSS side nudges towards tailwind (or similar), and modern (raw) CSS has undergone so many feature extensions and new capabilities, it's tough to find a good "modern" guide for building with it. It just feels like there's a missing piece in-between: `let contact = new LdapContact(...)` and `<contact-summary .../> ; <contact-detail .../> ; <contact-search-result .../>`. Vue has come closest, and setting aside a super-complicated "WebApp/SPA" with a ton of interactivity... what's a comfortable, modern, low-ceremony way to get to that?
- recroad 2y agoReact/NextJS user here. I can easily make a case that you should avoid HTMX and go with Elixir LiveView because it’s sooooooo incredibly much better. What you’re not understanding is that “better” is contextual.
- jeswin 2y ago> My tip: you start by avoiding React altogether. Avoiding the most popular front-end tech (or any tech) is a good tip for those who want to play Finding a Job in hard mode.
- bdangubic 2y agoon a flip side, you have an opening for a high 6-figure front end position with an amazing team doing amazing shit - and you see CVs of “React Developers” and you go “uf tough luck, these gals/guys would be PERFECT here except of course we don’t use React” (speaking from personal experiences…)
- jeswin 2y agoI'm saying knowledge of React is a good to have, even when you prefer something else. In the sense, avoiding it is not a good idea - know the enemy.
- sensanaty 2y agoIn my experience React (only) devs make very shitty everything-else devs, because they try to squeeze the broken React patterns in places where they don't make sense and don't work. And since every single React codebase does its own thing, with its own set of libraries and state management and routing and even CSS management, 2 React devs will try squeezing 2 completely different broken solutions into a Vue codebase where they could've accomplished the same thing with a single `v-model` in a single 20-line component.
- bdangubic 2y agoyup, exactly same experience here...
- WuxiFingerHold 2y ago> If you need to do CSR, use Solid or Vue, but don't do React. Easier said than done. There're still many high quality libs for React that are not available for vanilla JS or other frameworks. E.g. https://reactflow.dev/ https://reactflow.dev/ (yes, they have a Svelte version, but not as feature rich). Vue comes very close, though.