Earlier quoted context omitted.
If after nearly a decade swarms of people are still making the exact same mistakes with how they use a specific method exposed by the library, then the problem isn't with the hundreds/thousands of people making the mistake, the design of the method is broken. This type of issue simply does not exist in Vue or Svelte even if people abuse watchers (which I've anecdotally noticed tends to happen from React devs writing…
You know for thousands of years people are still stepping on rake, the spikey part. And they get hit in their foreheads. The rake is lever by design, but I wouldn't say the problem is the rake.
React is winning by default and slowing innovation
791–800 of 866 posts
Re: React is winning by default and slowing innovation
#792Earlier quoted context omitted.
JSX isn't and hasn't even been necessary to use React. The first version of my company's site didn't have a build step and called createElement manually. And in the decade I've been writing for React, I've never used the React compiler. But saying that it's proof that it's not JavaScript it's like saying that V8 is proof that JavaScript is too complicated because otherwise it would be fast enough not to need a JIT. A…
If you also have experience using JSX in a React app, I'd love to hear any opinions/experiences you have with doing the JSX style vs createElement() style coding. I understand how they map to each other but I've only done JSX. That said, I'm old so calling functions all over the place is in my wheelhouse, and I'd love to hear from folks who have done both.
Re: React is winning by default and slowing innovation
#793React isn’t just "winning by default" It's winning because at the core it's just JavaScript function composition. A component is a function, conditionals are `if (...) { ... } else { ... }`, loops are `map()`. JSX is just sugar for function calls. In Svelte you are writing XML with little JavaScript islands inside it. Instead of if you get `{#if}{:else}{/if}`. Thats not "ergonomic" – thats a mini-language stapled on…
> React feels natural because it never asks you to stop writing JavaScript I want to increment some counter on the webpage. Which approach feels natural? increment = () => { this.setState((prevState) => ({ count: prevState.count + 1 })); }; const increment = () => setCount((count) => count + 1); function increment() { count += 1; } No one wakes up saying "please let me mutate simple state with function calls".
function increment() {
count += 1;
dispatchEvent(new CustomEvent(
"count-incremented",
{ detail: { count } }
));
}
I think I prefer not having to manage events all over the place.Re: React is winning by default and slowing innovation
#794Earlier quoted context omitted.
So JSX is pure Javascript and not, say, a dialect of XML embedded in JS? Because it sure looks like the former even though it compiles to the latter. React isn't Javascript. It's a franken-language that looks superficially like a mix of JavaScript and XML whilst following the rules of neither. That's why there is such a thing as a React compiler - a good sign that you're not writing JS, which doesn't have compilers.…
> So JSX is pure Javascript and not, say, a dialect of XML embedded in JS? It would be best to think of it as syntax sugar for create Element() function calls. You enter JSX with angle tags and insert expressions in braces > React is full of magic syntax that looks like functions, but e.g. you can't call them inside an if statement, or you have to redundantly declare the 'dependencies' (variables you read) and so on…
More like syntax cilantro. Some people love it. Some can't stand it.
Re: React is winning by default and slowing innovation
#795Earlier quoted context omitted.
You certainly don't need JSX for React, nor a build chain. My ship investor Kelly trainer game[1] is a simple React application in a single HTML file. The initial page load is slow because I experimented with using built-in browser module support to pull in React, but if you change it to serve a pre-built library from a CDN instead then also the initial page load is fast. You can view the source on that page to see h…
You've given this example about how to use React without JSX but actually you're not using React but Preact, which is a different library. Preact, to its credit, actually has instructions for using it without JSX right in their getting started guide: https://preactjs.com/guide/v10/getting-started/#alternatives... . In fact it's the very first paragraph. React itself buries this information in a reference ( https://re…
Preact's compatibility layer is good but not perfect - some UI libraries rely on React's internal implementation which breaks with Preact. I think people can and should chose Preact for when they know what third party dependencies they will rely on, and for situations like this where it's a fairly trivial single page app.
Re: React is winning by default and slowing innovation
#796Earlier quoted context omitted.
What code are you using to reactively render state? Or do you write all DOM manipulations manually and just accept the problem of state explosion ?
Here is an example: /lib/dashboard/dashboard_script.ts https://github.com/prettydiff/webserver When you aren’t using framework like components state restoration is a single function that runs only on page load. There is no state explosion and on localhost the SPA fully renders and finishes state restoration in about 105ms from http request.
Re: React is winning by default and slowing innovation
#797Earlier quoted context omitted.
A child who hasn't tasted other mom's food always say, my mom is the best cook in the world. You saying you can be productive in react is just ironic. I just read it as, I can be employable using React.
My brain does this sometimes, sorry :) I meant to say, "I can just be productive immediately in React". Not going to edit though. edit: also about the moms cooking analogy... With many of those libs/frameworks, I have much more experience with than react.
Re: React is winning by default and slowing innovation
#798Earlier quoted context omitted.
>I think it's very hard to argue that React is effective or well designed. This is a foolish take. React is the reason the modern web is as usable as it is. Anyone who contests otherwise is simply ignorant of web development history. >(and even Netflix is moving away from React They're not moving away from React, they're doing pure SSR with it. https://react.dev/reference/react-dom/server/renderToPipeabl... You don't…
> Anyone who contests otherwise is simply ignorant of web development history. Or is perfectly aware of web development history and doesn't share your opinion.
It's not a perspective.
Re: React is winning by default and slowing innovation
#799Re: React is winning by default and slowing innovation
#800Earlier quoted context omitted.
Then why dont you pick jquery? Its easy and well known, even now. The answer I see is that react is technically good enough. Using boring technology doesnt mean using the technically most advanced thing. It means picking something safe and stable.
React is significantly more easier to hire for than JQuery is, especially in this market. Especially if you’re looking for more junior roles. As a new grad, I would’ve picked a react job over a JQuery job even if the JQuery one paid me 10k more.