• Home
  • Forums
  • Chat
  • Categories
    • News
    • Tech
    • Gaming
    • Anime

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

Cassidy Hutchinson’s Jan. 6 Testimony Was an Alexander Butterfield Moment

June 29, 2022

British Royal Family demands YouTube remove video

June 29, 2022

Deborah James: Her passionate vision for the £6.8m she raised

June 29, 2022
Facebook Twitter Instagram
Visit the Oasis
OasisNews
Facebook Twitter Instagram YouTube
  • Home
  • Forums
  • Chat
  • Categories
    • News
    • Tech
    • Gaming
    • Anime
OasisNews
Home»tech»The many definitions of Server-Side Rendering—zachleat.com
tech

The many definitions of Server-Side Rendering—zachleat.com

adminBy adminJune 17, 2022No Comments4 Mins Read
Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Email
Share
Facebook Twitter Pinterest Reddit WhatsApp Email


Frameworks.

What is a framework, even?

“Solid start to this blog post, Zach—you’re doing great.”

What is a JavaScript Framework, even?

“Confuse them, then rescue them. This is how thought leadership works.”

You’ve almost certainly heard of JavaScript Component Frameworks (Libraries 🌶) like Vue.js, Preact, Svelte, Lit, SolidJS, and others.

This is not to be confused with JavaScript Application Frameworks like NuxtJS, Next.js, Gatsby, Remix, Astro, SvelteKit and others.

Well, huh—where does Vite live?

Application frameworks typically make use of one (or more! hi Astro) component frameworks.

Now folks that spend their time in the wonderful world of frameworks have likely encountered the term “Server-Side Rendering” (often abbreviated as SSR). What they might not be familiar with is that SSR is defined differently in Component and Application framework contexts.

Component Framework SSR #

A package for server-side rendering Lit templates and components.
—@lit-labs/ssr

When generating SSR code, this adds markers to <head> elements so that hydration knows which to replace.
…
If “ssr”, Svelte emits an object with a render method suitable for server-side rendering.
—Svelte docs

However, it is also possible to render the same components into HTML strings on the server, send them directly to the browser, and finally “hydrate” the static markup into a fully interactive app on the client.
—Vue Server-Side Rendering (SSR) Guide

Server-Side Rendering (often abbreviated as “SSR”) allows you to render your application to an HTML string that can be sent to the client to improve load time.
—Preact Server-Side Rendering docs

Component frameworks define SSR as the static rendering of a component. Give it a component, get the rendered HTML back.

Application Framework SSR #

Server-side rendering (SSR), is the ability of an application to contribute by displaying the web-page on the server instead of rendering it in the browser. Server-side sends a fully rendered page to the client; the client’s JavaScript bundle takes over which then allows the Vue.js app to hydrate.—NuxtJS Server side rendering

Okay, fine—good so far. Seems in line with the component framework definition.

Node.js server required
A JavaScript environment is required to render your web page.
A Node.js server needs to be configured to execute your Vue.js application
—NuxtJS Server side rendering

Now wait just one second. Why can’t I use a build server to server-side render the markup? The component framework definition made no mention of a Node.js (per-request) server! (Not to mention that servers often cost more than static builds.)

Also referred to as “SSR” or “Dynamic Rendering”.
If a page uses Server-side Rendering, the page HTML is generated on each request.
—Next.js Server-side Rendering docs

Another definition that requires a runtime server to generate HTML (on each request!).

Server-side Rendering (SSR) is one of Gatsby’s rendering options and allows you to pre-render a page with data that is fetched when a user visits the page. While it is recommended to use Static Site Generation (SSG) or Deferred Static Generation (DSG) over SSR you might have use cases that require it…
—Gatsby’s Using Server-side Rendering (SSR) docs

Another server-based definition from Gatsby.

When you enable SSR you can: Implement sessions for login state in your app. Render data from an API called dynamically with fetch. Deploy your site to a host using an adapter.
Astro’s Server-side Rendering docs

Not explicitly stated in the Astro docs, but these are definitely runtime server features.

The gist #

Application frameworks most often define SSR as the alternative to SSG (static site generation). A runtime server is used to render the components on request.

Component frameworks define SSR as generating static HTML from a component definition. They offer no preference as to whether this should or can happen at build time or at request-time.

One term, two contexts, two definitions! I do think it’s important that folks understand the distinction here—and to keep it in mind when you navigate these different contexts. My hunch is that the application framework definition will likely win out. I’ve already started referring to the component framework definition as Component SSR 😅.

SSR isn’t “free”. These SSR frameworks exist because they make a profit for their creators.
—Cory House

The worst outcome from this overloaded definition (in my mind) would be that folks mistakenly assume that component framework SSR requires a Node.js server! It does not. I’d hate to see ambiguity in a technical term leveraged for profit. Just know that you can use a static build to implement component SSR (maybe also known as prerendered markup) without a Node.js server, a serverless function adapter, or any of those unnecessary (and more costly) alternatives.


This post inspired by tweets from:





Source link

Definitions Renderingzachleatcom ServerSide
Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Email
Previous ArticleMultiple people shot at church in Alabama with suspect in custody
Next Article FIFA announces 11 U.S. host sites for 2026 World Cup
admin
admin
  • Website

Related Posts

British Royal Family demands YouTube remove video

June 29, 2022

TSMC May Surpass Intel In Quarterly Revenue For First Time

June 29, 2022

First Core i9-13900K Raptor Lake Processors Already Sell on Black Market

June 29, 2022

A wide range of routers are under attack by new, unusually sophisticated malware

June 29, 2022

Log4Shell Vulnerability Targeted in VMware Servers to Exfiltrate Data

June 29, 2022

Walmart sued by FTC over large-scale money transfer fraud • The Register

June 29, 2022
0 0 votes
Article Rating
Subscribe
Login
Notify of
guest
guest
0 Comments
Inline Feedbacks
View all comments
Demo
Our Picks

Book by Nigerian Author Reminds New Adopters Why Bitcoin Was Created – Featured Bitcoin News

June 28, 2022

Spy x Family Part 2 to Air This October! | Featured News

June 27, 2022

Chinese State-Run Media Warns About Bitcoin’s Price Falling to Zero as Regulators Issue Fresh Crypto Warning – Featured Bitcoin News

June 25, 2022

timvisee/ffsend: Easily and securely share files from the command line. A fully featured Firefox Send client.

June 24, 2022
Stay In Touch
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
  • Vimeo
Don't Miss
News

Cassidy Hutchinson’s Jan. 6 Testimony Was an Alexander Butterfield Moment

By adminJune 29, 2022

Former Trump aide Cassidy Hutchinson is sworn in to the Select Committee to Investigate the…

British Royal Family demands YouTube remove video

June 29, 2022

Deborah James: Her passionate vision for the £6.8m she raised

June 29, 2022

TSMC May Surpass Intel In Quarterly Revenue For First Time

June 29, 2022

Subscribe to Updates

Get the latest creative news from SmartMag about art & design.

Top Posts
Advertisement
Demo
Latest Posts
Our Picks

Steam Deck production picks up, leading to doubled unit shipments

June 27, 2022

Algorithm Known for Outperforming Bitcoin and Crypto Markets Reveals New Altcoin Picks for the Week

June 27, 2022

Analyst Michaël van de Poppe Unveils Altcoin Picks, Says He’s Bullish on Ethereum and Three ETH Rivals

June 20, 2022

Bitcoin falls below $20,000 as crypto selloff picks up

June 18, 2022
Blog Posts

Dr. Stone: Ryusui Confirms Burnout Syndromes For OP Theme! | Anime News

June 28, 2022

Classroom of the Elite Teases Trials to Come in New Trailer! | Anime News

June 28, 2022

Madhouse to Produce Chi: Chikyu no Undo ni Tsuite Anime! | Anime News

June 28, 2022

Summer 2022 Sequel Anime Roundup! | Anime News

June 28, 2022

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

About Us
About Us

Weboasis is the number one home page for your browser on all of the internet. Providing you with links, places to communicate, and news, all in one little OASIS.

Facebook Twitter Instagram Pinterest
  • Home
  • Forums
  • Chat
  • Categories
    • News
    • Tech
    • Gaming
    • Anime
© 2022 ThemeSphere. Designed by ThemeSphere.

Type above and press Enter to search. Press Esc to cancel.

wpDiscuz