24 ms·
Here's my feelings like someone who's not strictly frontend developer but has to deal with it from time to time. Frontend seems to be React, rest is dead, ever
by vbezhenar 4y ago
Here's my feelings like someone who's not strictly frontend developer but has to deal with it from time to time.
Frontend seems to be React, rest is dead, everyone's on React.
Build system seems to work. Last time I used vite and didn't tinker with it at all. It just works. That's good. It was a royal pain for in in the past. All those grunts, webpacks, gulps and whatnot. But it doesn't seem like dust is settled yet. I guess more build systems will appear and disappear in the future.
State storage: I don't know. Redux was hot in the past. Nowadays it seems to be react-query which is supposed to be wrapper around fetch but apparently its caching is good enough to replace the whole state storage framework. Sounds weird, but here we are.
Routing is weird. I don't understand what's with it. There's react-router but there are some fuss with latest version, with react-query compatibility.
Code quality tools are not complete. There's prettier which is nice but does not work for everything as they have some weird artificial constraints, like they don't want to insert curly braces automatically, so you need to use eslint. Configuring this stuff still is pain. Deno is awesome in that aspect.
What I miss in JS ecosystem is something single which solves all my problems. Like npm which can also build website, which can hot reload it for dev mode, which can autoformat my code with single blessed unconfigurable code style, which can lint it, which can run unit tests and so on. I don't want to spend a single second setting up my environment.
- whatshisface 4y ago>What I miss in JS ecosystem is something single which solves all my problems. Like npm which can also build website, which can hot reload it for dev mode, which can autoformat my code with single blessed unconfigurable code style, which can lint it, which can run unit tests and so on. I don't want to spend a single second setting up my environment. SvelteKit can do that.
- komali2 4y agoI'm EXTREMELY confused about what's going on with react router, the documentation seems mismatched from versions, and any tips I find online seem to be for some now defunct version. I remember a few months back I was working on a react app with react router and trying to figure out how to hook into all route changes for some reason, and all the documentation centered around "picking a router," of which there was `createBrowserRouter`, `createHashRouter`, etc, all which had different considerations. But I couldn't find an invocation for any of those! Just a single `useRoutes` and that was it lol. And the argument for it was just objects and arrays, with element properties set to JSX. From my understanding, we shouldn't have had history working at all without explicitly setting it to do so, but it all was working, so... who knows?
- siquick 4y agoReact Router devs have a history of breaking changes and some spikey behaviour so this doesn’t surprise.
- n2d4 4y ago>What I miss in JS ecosystem is something single which solves all my problems. Like npm which can also build website, which can hot reload it for dev mode, which can autoformat my code with single blessed unconfigurable code style, which can lint it, which can run unit tests and so on. I don't want to spend a single second setting up my environment. For this, you have Next.js/SvelteKit/Nuxt.js/whatever framework you prefer. For React in particular, Next.js with the default setup has all of these features but unit testing (there's a template for that, but it isn't as commonplace in frontend as it should be), and more such as server-side rendering, routing, data fetching, etc.
- klysm 4y agoI don’t bother unit testing my front end - I’ve never found it to be worth the time
- dariusj18 4y agoWhen using typescript, unit testing needs are few and far between.
- n2d4 4y agoI get that. Testing components in particular is something I've rarely found to be worth it as well. But often I find myself writing logic in the frontend, say for processing data from the API. That's where I want to create a file and write a unit test because it would actually be easier. Sadly for a small project the effort of configuring and maintaining updates of an external test framework on-top of Next makes no sense.
- klysm 4y agoYeah sure if there are some pure functions involved then by all means unit test.
- afloatboat 4y agoI've use React Router 6 in combination with @tanstack/react-query 4 in a ±2 month old project without issue. I did notice that React Router 6 annoyingly by default returned to an object notation for its routes instead of elements, but with `createRoutesFromElements` the option is still there. I find the object notation less readable and it doesn't follow the React paradigm. One thing that I imagine would cause issues (or make react-query at least partially redundant) is the `loader` prop that React Router now has that allows is to do data fetching and posting in the router. I didn't try that due to time constraints. The biggest pain for me in Javascript is tool configuration, it's something that I'm just not good at and configuring Prettier, eslint, testing library (with mocks), tsc, … and all the rules that inevitably start crashing with each other is hell. That's why for the longest time I kept using CRA which had all these things preconfigured with sane defaults. But CRA development is moving at a crawl and with the lack of SSR NextJS makes much more sense so I'm focussing on that now.
- DrFell 4y ago> Frontend seems to be React, rest is dead, everyone's on React. Looking at the "retention, interest, usage, and awareness ratio over time" - Percentages: almost perfectly flat. Rankings: all slowly going down. Relative feelings are in near perfect lock-step. The only thing to note is people, as always, have ennui and are looking for something new. There is nothing to support your statement, at all. You are basically lying.
- Existenceblinks 4y agoSo it's not looking good. After all these years, people stuck with a bloat/slow React (but with all benefits come with being popular alone). State / routing / form, nothing has a decent de facto.