4 ms·
The cycle isn't short like people continue to say each year. I use react since 2014 and it hasn't changed much in 6-7 years. I just built a script tag based re
by zackify 8mo ago
The cycle isn't short like people continue to say each year. I use react since 2014 and it hasn't changed much in 6-7 years.
I just built a script tag based reusable library for our company with react as the only dependency and thanks to stuff like shadow Dom and dialogs I get a much higher quality dev experience than plain js.
- afavour 8mo agoBest practises have changed dramatically in React since 2014 though. It’s easy to say “oh you don’t have to use hooks, you can keep using class components” but that’s not really true when the entire ecosystem is pivoting. My bigger problem with React is that it ends up being used as a form of vendor lock in. Once your entire page is in the React VDOM it’s very, very difficult to pivot to a different framework piece by piece. That’s a core strength of web components.
- hliyan 8mo agoI think React originally started with the opposite intent: a library where you can mount a component onto selected elements of the web page. The lock in only happened when React was used to develop SPAs, which effectively meant that React takes over the document root. With that came state management, and frameworks that managed the complexity of state were not far behind.
- mickeyp 8mo agoIndeed. I've gradually adapted a server rendered jquery and HTML site to react by making react render a component here and there in react and gradually convert the site. Works great.
- sheept 8mo agoClass components still work, and you can still use function components with hooks inside class components and vice versa. In the parent comment's case of not having other dependencies, whatever the React ecosystem does isn't relevant if you aren't using any React libraries, which aren't really necessary anyways, especially nowadays when the LLM can reimplement what you need for you. Nothing has changed about react-dom that prevents you from using React piece by piece—its docs still recommend attaching to a #root node even for single page apps. Including web components in a React app is very seamless, and embedding non-React-controlled elements inside React is not uncommon (e.g. canvas, Monaco, maps), though for common use cases there's usually convenience libraries for React that wrap around these.
- colordrops 8mo agoit's also impossible to look at the DOM and figure out what the hell is going on with React.
- llbbdd 8mo agoReact has excellent dev tools of its own that cover this.
- colordrops 8mo agoI have those dev tools installed. I wouldn't call them "excellent".
- llbbdd 8mo agoAgreed I might have gone too far with "excellent". :) I think they do a good job though at operating at the level of abstraction React lives at, which generally requires less detail to live in the DOM (e.g. ids/classes used only for JS bindings compared to classic jQuery soup).
- harrall 8mo agoReact state management has changed a lot. React DOM/views have not significantly changed in 12 years. Our 10 year React projects that used mobx have not changed very much. Savage take: I found React when it came out and I thought “wow you made this gorgeous DOM library and then you bolted on this messy ugly wart for state.” Then hooks came out and I’m like… this is a good electrician pretending they can also do plumbing.
- megaman821 8mo agoExactly what are you using in React land that has lasted for 6-7 years. No components to hooks transition? No styling library changes? No state management changes? No meta framework changes? The React ecosystem is the least stable thing I have ever worked with.
- nayroclade 8mo agoHooks were introduced in 2019. so, seven years ago.
- megaman821 8mo agoEven only looking at React provided hooks, they added a lot over years and best practices around things like useEffect have changed a lot. If you have a complex app from 2019 that you haven't updated, it is virtually guaranteed that it has memory leaks and bugs.
- c-hendricks 8mo agoI don't really agree that "best practices around useEffect have changed a lot". It's more that that particular hook was used a lot when it didn't need to be so the team finally wrote some guidelines.
- zackify 8mo agoyeah same... i have always tried to useState and minimal effects, those have not really changed in 7 years
- socalgal2 8mo agoI have react projects from less than 6-7 years ago that are bit-rotted because of changes to react. I have wanted to add features but can't because I don't have the time to fix everything that rotted. To be clear, it's not 100% react. It's the entire ecosystem around it. Want to take wigdet-x v3 for bug fixes. It requires newer react, which may or may not be compatible with widget-z I'm using. Newer react requires newer tools which aren't compatible with the configuration that was created by create-react-app from 2 versions ago. etc...
- nextaccountic 8mo ago> I have react projects from less than 6-7 years ago that are bit-rotted because of changes to react. I have wanted to add features but can't because I don't have the time to fix everything that rotted. That's what AI is for. It makes previously unfeasible projects feasible again