Giter Club home page Giter Club logo

Comments (4)

alan2207 avatar alan2207 commented on May 18, 2024 21

Hey, that is a good idea and something I have already considered but it might be a bit redundant. I agree that choosing between next.js vs plain react is a very important architectural choice. Most of the time I am also choosing next.js as the default option, however, I wanted to make bulletproof-react universal to react and not tie it to next.js specifics and that is the only reason CRA is being used here. Pretty much all of the concepts here can be implemented in a Next.js application with a couple of differences:

  • client-side vs SSR - some pieces of the code that rely on some browser APIs would not work on the server, so you would have to use https://nextjs.org/docs/advanced-features/dynamic-import with the ssr flag set to false in order to start using it once it is in the browser.

  • pages/routes - instead of handling them with react-router, you would keep all the code in features, e.g src/features/pages/Discussion and that page would be used in src/pages/discussions/[discussionId].tsx by just re-exporting everything. That way all the code related to the page would be kept in its belonging feature.

  • authentication - there are multiple options how you do that:

  • Persistent layouts - https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/

  • This video shows a couple of useful tips and tricks specific to next.js: https://www.youtube.com/watch?v=R59e1Vl5lO8

Not sure if I missed something. I am curious about what @leerob thinks of this?

from bulletproof-react.

desiboli avatar desiboli commented on May 18, 2024 11

bulletproof-nextjs13 😝

from bulletproof-react.

leerob avatar leerob commented on May 18, 2024 8

Auth and Layouts now have their own docs:

from bulletproof-react.

gregarnott avatar gregarnott commented on May 18, 2024 3

I've been seeing a fair amount of developer intent (in module/project discussions and the like) towards using react-static instead of Next.

Ah, React... where every aspect has a swag of valid options, and everything ends up opinionated!
(Un-opinionated modules just get consumed into opinionated builds/systems)

"Next vs Gatsby vs react-static" as a search would likely yield a plethora of conflicting opinions...

from bulletproof-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.