by danielstocks on 3/29/20, 10:49 AM with 72 comments
by jensneuse on 3/30/20, 12:17 PM
-> Website needs to be more interactive.
Step 2: Server Side HTML + Client Side React SPA
-> Website is now interactive but performance decreased.
Step 3: Server Side HTML + Server Side React + Client Side React SPA
-> Website is interactive, performance is good but now it's overly complex.
Step 4: Server Side HTML + Server Side React
-> Let's make it a bit more simple and even more performant by making it less interactive again.
Step 5: Server Side HTML
-> More performant than the previous iteration, also less complex.
You can see that nothing really changed but developers are super happy because they improved the experience all the time.
by davnicwil on 3/30/20, 10:01 AM
But since you don't need the client, you don't need any of that, right? Seems like without having to structure the server code in the same way you'd structure client code, things just get a lot simpler and the native React SSR stuff should be fine to use directly. Just curious which other features of Next you found you wanted for a server-only app?
by dugmartin on 3/30/20, 10:51 AM
You get the speed/reliability of Phoenix and the (for me at least) power of creating your UI in React without having to run a node server at runtime. I'm planning on releasing the plugin once I've used it on a couple of personal projects to remove the rough edges.
by sandGorgon on 3/30/20, 11:28 AM
It doesnt have everything built-in, and the fact that Zeit has such tight control over nextjs to be a minus...but im expecting Next (and Gatsby) to some extent to drive full stack webplatforms for the next decade.
You have to write javascript anyway in Rails...why not go JS all the way ? And Typescript is definitely a fantastic language.
by nfriend on 3/30/20, 1:20 PM
I used a more heavy-handed approach: I strip out all <script> elements from the build output before publishing: https://gitlab.com/nfriend/nuxt-resume/-/blob/63e0298fdb5a08...
The end result is a pure HTML/CSS site that has all the Nuxt.js niceties during development (e.g. hot reloading).
by deltron3030 on 3/30/20, 10:18 AM
https://github.com/blitz-js/blitz
RedwoodJS, a new rails like full stack framework for JS is also very interesting: https://github.com/redwoodjs/redwood
They focus on a classic server side Rails like workflow but embrace the separation of API and clients on the technical side, for a future as a multi frontend framework (web, mobile etc.).
by jamil7 on 3/30/20, 9:58 AM
by cprecioso on 3/30/20, 11:11 AM
At times like this is when I most think of Svelte’s aspiration, to remove the framework and compile its uses to regular DOM calls. It just bothers me so much with their magic syntax.
PS: Maybe something similar could be made for React Hooks? If a component doesn’t use any hooks it’s marked as static and doesn’t need the framework or to be re-hydrated. If it uses any, we only need to create a discrete React root for that component and its children.
by azangru on 3/30/20, 11:13 AM
Why do people not know about Eleventy, why?
by _bxg1 on 3/30/20, 11:50 PM
Server-side-only React sounds like a fundamental misunderstanding of what purpose React actually serves.
In React, you write functions that accept data and output what amounts to HTML. Thing is, you can easily do this with a plain template string. You're just dropping values into HTML. The only benefit provided by React is the efficient modification of existing DOM to bring it up to date with the new state, without dropping the whole thing and rebuilding it from scratch. If there is no existing DOM - because you're only making one rendering pass - React serves no purpose at all.
Here's my website. It uses virtually nothing except Express and a Markdown parser. Pages and components are rendered from plain JavaScript functions. Blog posts are in markdown and automatically detected. Right now it statically renders all of the pages on startup, for efficiency, but it could be made dynamically-rendered with a flip of a switch: https://github.com/brundonsmith/website
by vbsteven on 3/30/20, 10:54 AM
by leerob on 3/31/20, 1:26 AM
Related – If anyone wants to learn more about Next.js, my course is free right now while everyone's stuck indoors.
by FlashBlaze on 3/30/20, 2:41 PM
by XCSme on 3/30/20, 3:03 PM
by hisnameisjimmy on 3/30/20, 5:25 PM
I get that as an educational experience this is interesting, but the level of complexity required to generate static html is extraordinary. Just the amount of tooling and conceptual understanding necessary is so crazy.
I've been working on building out a simple Electron app recently and considered React, but realized with little to no interactivity it would be insane overkill. However, one of the most popular boilerplates out there combines react, redux, typescript, webpack, etc, etc.
There seems to be this default right now of 'over-engineering' everything. It's like people have forgotten how to make simple things.
by rado on 3/30/20, 9:50 AM
by ecmascript on 3/30/20, 10:42 AM
Because this triggers me a lot. Why wouldn't you just use a normal templating language that render html? Isn't this seriously all the same except you just add a massive dependency for no reason? This is why I hate the javascript community.
The only word I find for this is that this is dumb.
by cryptica on 3/30/20, 2:49 PM
For years, I was telling people that React and related tooling was a bad idea, that it adds a lot of unnecessary bloat which is not worth it. Everyone (like 99% of developers) disagreed with me and kept insisting that it was a simple solution.
Fast forward half a decade, now pretty much everyone agrees that React adds a lot of unnecessary bloat... The level of bloat just had to get truly appalling for people to actually notice (I swear a lot of projects seem to take 10 minutes to build). It took 5 years for people to accept the PREMISE of my original argument.
But now even though a lot of people finally accept the premise, they are still desperately trying to rationalize the existence of their favorite hyped up tools in any way they can.
I'm tired of explaining to people that "simpler solutions are better than complex ones". If any idea should be recited dogmatically, that should be it. Someone should write a book about it so that people can repeatedly whack themselves over the head with it until it gets through their thick primal skulls.