6 ms·
While builtin support for server side React makes a lot of sense, as a developer I'm really missing a high level browser framework in React that gives me routes
by eatonphil 6y ago
While builtin support for server side React makes a lot of sense, as a developer I'm really missing a high level browser framework in React that gives me routes, auth, api access.
Maybe I've just been out of the loop. At work every React app I've built had all this custom logic for each of those pieces. But when I start a new project I'm loathe to do all that setup again.
I'd just like an opinionated framework built on React that gets rid of some of this boilerplate of browser routing, auth, api access, etc.
This isn't a knock on React. React is awesome. But at this point it's almost too barebones on its own.
- evilduck 6y agohttps://nextjs.org https://nextjs.org?
- acemarke 6y agoThat's exactly what Next.js is: https://nextjs.org https://nextjs.org (as well as a few other tools in the ecosystem)
- eatonphil 6y agoThanks! Somehow I thought next.js was only for SSR. What are the other tools?
- chrisco255 6y agoGatsby: https://www.gatsbyjs.com/ https://www.gatsbyjs.com/
- arcturus17 6y agoWait, Next.js would be useful for pure client SPAs? I built a prototype for the SSR and loved it, but it didn’t occur to me it could be used for client apps too... Does it need to be served from a Node.js environment or can it be used as a bundler and be served from other servers (eg Django or Rails)?
- chrisco255 6y agoNext.js can output static pages now on build time, so you don't necessarily need to use SSR unless you're hydrating data on the server.
- dbbk 6y agoIf you're building a dashboard-like SPA it's not really suitable, because every page is its own component, so you can't do nested layouts or routing.
- httgp 6y agoYou actually can build nested layouts in Next.js — see https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/ https://adamwathan.me/2019/10/17/persistent-layout-patterns-...
- danabramov 6y agoTotally agree. The goal here is to give better building blocks for frameworks to build upon.
- Nkuna 6y agoNext¹ offers a more fleshed out framework with far less boilerplate for both client and server code. Server side, Nest² offers much of the same. Think Angular but for backend dev. Yes, it has some boilerplate to it but for the most part, its CLI eases redundant typing. [1] https://nextjs.org/ https://nextjs.org/ [2] https://nestjs.com/ https://nestjs.com/
- hermitwriter 6y agoI don't know. I use next.js and love it. But I have to implement two static methods for every thing I want to fetch... This also locks me into next.js...
- eyelidlessness 6y agoI’ve shopped around a lot and most projects targeting a similar featureset are generally adopting the Next.js APIs for server-side data fetching. So it’s probably not as bad in terms of lock-in as you’d expect.
- xeon06 6y agoI think more people should take a look at https://blitzjs.com https://blitzjs.com. It makes your lock in problem slightly worse I suppose but only because it argues that you want most apps to be coupled like this in real life. In exchange, it gives you great developer experience around things like data fetching.
- scsilver 6y agoTouched this about a half a year ago. Feels like rails for react. Very opinionated and interesting how prisma is used to set up the data schema.
- slow_donkey 6y agoYou can be productive with Nest.js but I'd hate to promote it as a great solution. It's really a mashup of other JS libs with Nest bringing a rather convoluted form of dependency injection and http action decorators. You can build your own soup rather easily without the Nest overhead and with better choices. It's not the worst place to start, there's just better shit out there.
- lkki 6y agohttps://blitzjs.com https://blitzjs.com
- zaiste 6y agoThere's also Kretes¹ that comes with a React.js template. It pre-configures few popular libraries such as React Query, React Hook Form, built-in REST & GraphQL API, authorization/authentication, etc - so you can (relatively) quickly create a «full-stack» (TypeScript) app [1]: https://kretes.dev https://kretes.dev
- mekkkkkk 6y agoAFAIK an explicit goal of React (at least in the beginning) was to not be opinionated at all and to only provide the view/rendering part of an app. Since then it feels like its scope has expanded a bit. Or maybe not? Not sure which batteries are supposed to be included anymore. Would be interesting to hear Dan's thoughts on this.
- xeon06 6y agoTake a look at https://blitzjs.com https://blitzjs.com! It's built on top of Next.js, which everyone else has been recommending to you, but goes a step further that I think you might find enjoyable, reading your comment.