[HN Gopher] I changed my mind about writing new JavaScript frame...
___________________________________________________________________
I changed my mind about writing new JavaScript frameworks
Author : kiyanwang
Score : 11 points
Date : 2022-10-07 18:07 UTC (4 hours ago)
(HTM) web link (whitep4nth3r.com)
(TXT) w3m dump (whitep4nth3r.com)
| ravenstine wrote:
| The author's opinion seems to come down to how different JS
| frameworks support SSR, which is a very specific problem. Outside
| of SSR, which is primarily meant to appease The Google, I think
| said opinion would be diminished because most JS frameworks are
| redundant in every other domain.
| lopatin wrote:
| I'm confused by this
|
| > What's more, static site builds in both Next.js and Gatsby
| can't make use of server-side rendering functionality.
|
| I haven't used Next.js but I heard that it supports server side
| rendering, so I assume you can use it kind of like Rails?
|
| Is the issue with Next.js that you would have to remember to use
| <a> instead of <Link>? That sounds like not a big deal.
| kall wrote:
| It is confusing because between all the different levels of
| being static or server side rendered or client side rendered,
| next.js can pretty much do (and potentially mix) them all,
| right?
|
| I'm quite confused on _why_ they want next to act like this?
| You can use anchor tags to force a browser navigation, but what
| does it get you? You're still loading JS bundles and it's not
| like <Link /> breaks anything like history or open in new tab.
| People put turbolinks in their rails app to get something that
| works half as well.
|
| You could also use unstable_disableRuntimeJs on some pages and
| your <Link /> will still fully degrade to act like a completely
| server rendered page.
| chrisco255 wrote:
| Yeah, Next.js supports both. And the <Link> tag is not
| required, it's simply recommended, as the Link tag has built-in
| prefetching, so users will feel a small performance boost from
| local links that use it.
| Jcampuzano2 wrote:
| Use a <Link /> if you want prefetching and client-side
| transitions, use just an <a /> if you want to opt out of that.
|
| It also sounds like the author is complaining about
| Next.js/Gatsby not having an option that doesn't even make
| sense in the first place. "static site builds in both Next.js
| and Gatsby can't make use of server-side rendering
| functionality" - What does this even mean? Of course a static
| site build won't have SSR.
| NayamAmarshe wrote:
| > static site builds in both Next.js and Gatsby can't make use of
| server-side rendering functionality.
|
| Which is why they're called static builds?
|
| Next.js supports ISR, which is a great way to hydrate pages
| without causing too much overhead.
| mouzogu wrote:
| The irony of this title just hits the spot.
| [deleted]
___________________________________________________________________
(page generated 2022-10-07 23:02 UTC)