Live data from Hacker News

The Frontend Treadmill

polotek.net

61–70 of 722 posts

Re: The Frontend Treadmill

#61
post #46

Earlier quoted context omitted.

Javascript doesn't have a good enough standard library to execute on this. You need frameworks just to patch up the runtime (or otherwise avoid the holes). Last time I checked they didn't even have decent hashmap or set implementations (let alone decent serde support).

No regular frontend needs any of that. Serde support, that's a ridiculous requirement for painting some web boxes on a display. Plus, as the other comment noted, the basic JS types go a long way now.

You don't need javascript at all to render.

Oh for a version of the WWW that never allowed javascript at all.... money destroys absolutely everything it touches.

Re: The Frontend Treadmill

#62

I have recently been doing some upgrades to the build system for our FE code to swap out yarn for pnpm. I’m normally a backend engineer, but I’ve spent plenty of time in the JS mines. The most frustrating thing about dipping in to the FE is that it seems like literally everything is deprecated . Oh, you used the apollo CLI in 2022? Bam, deprecated, go learn how to use graphql-client or whatever, which has a totally d…

Wait, we're supposed to use pnpm now? What happened to yarn? What's wrong with npm? I stop paying attention for six months and even the installer has changed. What's an npx?

Main difference between all of them is speed. There’s some differences in how npm, yarn, pnpm or bun handle workspaces and hoisting (and stuff like dependency overrides) but if one of them works for you, you rarely have to switch between them.

Edit: also npx is just an alias for npm exec, allowing you to run scripts in npm packages

Re: The Frontend Treadmill

#63
post #5

> Whatever framework you choose will be obsolete in 5 years. I've been writing React professionally for over a decade at this point. I don't know what this guy's on about.

My current firm is still on 16 and just trying to make it to 18 because of the deprecations.

All of the WYSIWYG editors that work on 16 are no longer supported. it's a "cross your fingers" in case someone found a security issue (or don't use them)

React 16 is still supported, but it's definitely obsolete.

Re: The Frontend Treadmill

#64
post #5

> Whatever framework you choose will be obsolete in 5 years. I've been writing React professionally for over a decade at this point. I don't know what this guy's on about.

I've been writing React professionally for over a decade and React from 5 years ago is obsolete. Like, literally won't build with current tools. To their credit, I think the React code itself has maintained reverse compatibility pretty well (it's not React's fault), but the build systems I was using 5 years ago have all changed and broken reverse compatibility. EDIT: Forgot about component lifecycle methods... Even a…

> To their credit, I think the React code itself has maintained reverse compatibility pretty well (it's not React's fault), but the build systems I was using 5 years ago have all changed and broken reverse compatibility.

That's a problem with your build system then, not React. There is (or was) indeed a lot of churn in build systems, but you wouldn't have been spared unless you had chosen to not use a build system - which is still possible with React, but not with Svelte, Vue or Angular.

My current position on build systems is that if it doesn't work out of the box with esbuild, I'm not using it. If it does work out of the box with esbuild, then it's likely also going to work with whatever comes after.

Re: The Frontend Treadmill

#65
post #58

I have given this a lot of thought, and I haven't been able to come up with any reasonable long-term solution that avoids major refactors or swapping out libraries and tools. I am leaning toward pairing React with React Router for creating server-side rendered web apps. My thinking is that React has "won" the JavaScript wars, maintaining its popularity consistently over the past decade, and React Router is one of the…

So I mostly agree with you, but I think there's some real dissatisfaction with React and Remix/React-Router's emphasis on SSR. If you don't care about SEO, there's really not that much SSR gives you that CSR doesn't. React and Remix seem to have gone all-in on SSR, and I just don't quite understand why.

Re: The Frontend Treadmill

#66
I think of the strange case of react-router which has been through 7 versions, many of which were complete breaking rewrites. It's hard not to come to the conclusion that since they kept rewriting it, they didn't believe in any of them. Lately they made big changes because they want to support SSR but I couldn't give a flying F because we're not using SSR any more than I care about React Native support because we're not using React Native! [1]

I've worked on a lot of code where people tried to use react-router and eventually gave up and have some code where they parse the URL directly and it works just fine. The trouble with react-router is that if you understand it enough to use it, you don't need it that is, you can either write some stupid URL parsing code or you can write some hooks that do 100% of what you want (as opposed to 90% of what you want with their code) with about 25% of the code.

For them it's a tiny amount of code that they understand completely and they have no problem tearing it up and rewriting it all because there is very little to it and it doesn't really do very much. [2] For you you either don't understand it in which case you feel like a hostage to their whims or you do understand it in which case you don't need it.

I am looking at a React 16 app which uses a huge number of third-party components that I badly want to take up to React 17 because of testing. With React 16 the tests can't ever really know that React is done running callbacks which makes them brittle and slow which is a bad enough situation that I don't want to write any more tests. React could have done something about it before because React knows if it has callbacks left to run but they didn't until React 17.

My understanding is that, most likely, all the components I have will work just fine with React 17 or 18 for that matter because the 16 -> 17 and 17 -> 18 transitions caused very little breakage. Their package.json files disagree so I can't just bump to React 17, but rather I have to update all the dependencies to newer version and many of them, like react-router, have a cavalier attitude about compatibility so I'd expect to spend a month at least dealing with all the breaking changes in the dependencies. It's times like this when I wish I could stick an axiom into my package.json that says "Version A of package B is really compatible with React 18" or just fork version A of package B to version A' which has a patched package.json. After all that it is certain that there will be invisible changes in the HTML which will cause us to fail an accessibility audit six months later requiring another month of work to track down.

[1] Sure, somebody else is, but I have enough problems to worry about with the modern web and patching up applications written by interns that I don't need the burden of navigating through the docs over and over and over again having to ignore 80% of the content which is completely irrelevant to me. Never mind that older versions of RR, at the very least, support obsolete methods of navigation which is another thing you don't need filling your headspace.

[2] So little code that it probably takes up more of their headspace to go to a conference and boast about what they did than it did to actually do it!

Re: The Frontend Treadmill

#67
post #8
post #5

> Whatever framework you choose will be obsolete in 5 years. I've been writing React professionally for over a decade at this point. I don't know what this guy's on about.

Component lifecycle methods to hooks and HOCs, does that ring a bell?

The transition to hooks was worth it.

Re: The Frontend Treadmill

#68
post #39

I have recently been doing some upgrades to the build system for our FE code to swap out yarn for pnpm. I’m normally a backend engineer, but I’ve spent plenty of time in the JS mines. The most frustrating thing about dipping in to the FE is that it seems like literally everything is deprecated . Oh, you used the apollo CLI in 2022? Bam, deprecated, go learn how to use graphql-client or whatever, which has a totally d…

This is exactly why I am a huge fan of ember.js Unfortunatelly it fell behind in popularity mostly due to some unimportant reasons (eg not being able to render 1M rows faster than react) and some important ones (load times), but boy did they build a stable ecosystem! I haven't seen such a commitment to stability and guardrail upgrades to this day on any other piece of front end library.

I'm thinking of building a long term living app (say an app that I will use the next 30 years).

It has to be a web app so I was thinking of going pure JS. With that requirements in mind would you recommend ember.js?

Re: The Frontend Treadmill

#69
post #5

> Whatever framework you choose will be obsolete in 5 years. I've been writing React professionally for over a decade at this point. I don't know what this guy's on about.

Idiomatic Reacts historical changes pretty often. In large codebases major version upgrades can take teams multiple quarters to complete.

Re: The Frontend Treadmill

#70
post #5

> Whatever framework you choose will be obsolete in 5 years. I've been writing React professionally for over a decade at this point. I don't know what this guy's on about.

How many dependencies does your package.json file declare? Which versions of node/npm does your team use? If you're on recent-enough versions and are using any popular libraries, you will have seen the deprecation notices pile up during npm install for downstream dependencies.

None? I use it from ClojureScript. I've been maintaining a React-based app with Semantic UI for 10 years now.
Post reply on HN