But as practical tool, React has been a regression for the web IMO.
But as practical tool, React has been a regression for the web IMO.
At the same time, my capabilities with web applications have skyrocketed in the last ten years and I wouldn’t credit it strictly to my experience. These tools aren’t only used because they’re relatively accessible; they’re genuinely capable and powerful, and when used well, allow remarkably fast development and iteration on products with real value.
I think that’s better than the bad parts. Also, a lot of what’s bad about the web today (for me at least) has virtually nothing to do with the tools we use to develop. It’s that our attention has been commoditized, and that market has eroded a vast portion of what made the web exciting.
If keeping track of state is so hard that requires a library to render it, perhaps you have too much state for a single view. It’s ultimately a UI/UX design problem, as it will be hard on your users as well.
I find the way they mix markup with code distasteful, and lots more.
If you do however find the way markup and code is mixed feels distateful, I'd suggest to not look at any templating engine in the last 20 years because that's what most of them already did.
Regarding templating engines, I use PHP :)
Then you've never worked on a medium/large UI application (1k+ LOC), and most certainly couldn't have lived through the era of DOM manipulation!
jQuery when it first arrived was a god-send! but even the most thoughtful couldn't structure it right.
Backbone when it first arrived was a god-send! but even the most thoughtful couldn't structure it right.
React when it first arrived was a god-send! but even the most thoughtful still can't always structure it right.
With, the inclusion of so many other failed and semi-successful attempts throughout history I have no idea how you can possible claim:
> I don’t think direct DOM manipulation was ever a problem, if done thoughtfully.
without just being naive...
htmx is the first JS thing to tickle my curiosity in a long time. Vue seemed fun at first, but it got more complex than needed, IMO.
I agree, this is interesting. I even agree, htmx is probably a polyfill waiting for the browser standards to catch up.
That said, trying to make a markup language smart is a losing battle in the long-term. It makes simple things like `if` and `while` difficult. Markup also really struggles with time / interactivity.
e.g. What should be displayed when a form is invalid? https://htmx.org/docs/#validation-example is just not ergonomic even for a simple case, let alone complex validations that interact with other fields, are async, etc.
I get a allure of wanting "only a markup language", however, it just isn't enough to be competitive for 95% of web development these days. In a different response you say "if you're building the next Gmail, fine use React, but you don't need React for picking between 3 colors to order a shirt". This is true, but it is fundamentally lacking the realization that no company wants to end their feature set at 3 colors for a shirt. They "want" to build a foundation quickly, but then enhance it to be able to custom create the shirt for exactly your body sizes and allow interactive movement of the "logo" or "graphic" anywhere on the shirt. They want the validation to ensure the shirt can be printed, and they want to ensure their logistics network is dynamically updating the order history for live tracking of the package.
To get there, the best thing to do is to use React (or similar) even when it is "just 3 colors".
If/when you get a few million users, then you worry about scaling your backend with microservices, crazy DBs, serverless, whatever. Until then (vast majority of business), LAMP is fine.
If/when you need 20 checkboxes/drop-downs (again, there are very few situations where this is reasonable to the user, the mental load is non-trivial, consider splitting the view and adding a “next step” or something) than you consider a framework devised to render the whole of Facebook, a site with way more views and features than the most sites would ever dream of.
Also, you don't need Virtual DOM to have declarative UI, just ask Svelte.