4 ms·
Trying to couple client server might seem like a good idea, but you are always left guessing as to how the component got in the state it is in, which defeats a
by literallyaduck 5y ago
Trying to couple client server might seem like a good idea, but you are always left guessing as to how the component got in the state it is in, which defeats a lot of the stateless ideas and puts us in a bad place debugging. Express is a good idea, React is a good idea, NextJs and the like make the developers guess until they get burned enough and then by that time a new concept like hooks vs class components comes to popularity and you start the process of learning where the new pit traps are located, until the next big shakeup.
- technobabbler 5y agoI think this is overstating the case a bit? In Next.js, it's pretty straightforward (and useful, really): the page gets its initial data injected at build time and served as HTML. It's static and stays that way until and unless you purposely add in dynamic elements on the page using useEffect or similar. It's not really any different than, say, using PHP to generate the HTML and then using Javascript for clientside interactivity, with or without AJAX. That's been the paradigm for decades now. What NextJS gives you is the ability to do use that same paradigm in a single language, React. Architecturally it's not really all that different, but in terms of dev experience, Next.js + Vercel is SO much better than having to maintain a LEMP stack. Just code the frontend against some CMS or other data store, push to git, and done!