PikoPong
  • Web Dev
  • Hack
  • Database
  • Big Data
  • AWS
  • Linux
No Result
View All Result
PikoPong
  • Web Dev
  • Hack
  • Database
  • Big Data
  • AWS
  • Linux
No Result
View All Result
PikoPong
No Result
View All Result
Home Web Dev

Servers: Cool Once Again | CSS-Tricks

January 22, 2021
in Web Dev
277 15
Servers: Cool Once Again | CSS-Tricks


There were jokes coming back from the holiday break that JavaScript decided to go all server-side. I think it was rooted in:

  • The Basecamp gang releasing Hotwire, which looks like marketing panache around a combination of technologies. “HTML over the wire,” they say, meaning it makes the server generate and serve HTML, and leaves client-side JavaScript to things only client-side JavaScript can do.
  • The React gang Introducing Zero-Bundle-Size React Server Components, which I believe is the first step of the core project toward server-side anything.

I’m all about some marketing hype, but it’s worth noting that these are just fresh takes on already solid (dare I say old) ideas.

Turbo (“The heart of Hotwire”) is an evolution of Turbolinks, which is a terrifically simple base idea: intercept clicks on internal links. Rather than the browser doing a full page refresh, fetch the contents of the new page, plop it in place, and History.pushState() the URL. Now you’ve got a Single Page App feel, but you didn’t have to build a SPA. That’s mighty convenient if you’ve already built your app in Rails with ERB templates.

But is that actually efficient? Well, it hasn’t been particularly popular so far. The thinking has been that the network is the bottleneck, so let’s send as little as possible over the network. “As little as possible” typically translates into JSON, typically. If you get JSON on the client, now you need a templating system on the client to turn that into usable DOM. With that technique, you’re paying two costs: 1) loading a client-side library 2) data-to-DOM processing. If you sent “HTML over the wire,” you pay neither of those costs (faster), but theoretically are sending beefier payloads across the network (slower), which assumes that HTML is heavier than JSON, which is… questionable.

So… it depends. It depends on how big the payloads are and what is expected to be done with them.

You’d expect the React opinion would be: definitely use the client. But that’s not true with the new preview of server side components. The video is abundantly clear: “rendering” the components on the server is faster, particularly in nested component situations where many of the components are responsible for fetching their own data. So what comes across the network then? Is it DOM-ready HTML? Not here. From a peek at the video, it looks like the network response is some proprietary format that describes a React component. That seems important because it means the client-side JavaScript bundle doesn’t contain that component at all, and state can be passed back and forth. Lauren Tan is also clear in the video: this is kinda SSR but distinct from how something, like Next.js, does SSR today. And the point is to make the Next.js of tomorrow far better.

So: servers. They are just good at doing certain things (says the guy typing into his WordPress blog). There does seem to be some momentum toward doing less on the client, which I think most of us would agree has been taking on a bit much lately, which asset sizes doing nothing but growing and growing.

Let’s push those servers to the edge while we’re at it.



Source link

Share219Tweet137Share55Pin49

Related Posts

Web Components Are Easier Than You Think
Web Dev

Web Components Are Easier Than You Think

When I’d go to a conference (when we were able to do such things) and see someone do a...

March 8, 2021
Going Beyond The Basics — Smashing Magazine
Web Dev

Obscure Mobile Design Techniques That Boost UX — Smashing Magazine

About The AuthorGert Svaiko is a professional copywriter and mainly works with digital marketing companies in the US and...

March 8, 2021
Invoker–the no-bull Laravel tool | Laravel News
Web Dev

Invoker–the no-bull Laravel tool | Laravel News

Invoker by Beyond Code lets you access all your Laravel applications with an instant admin panel—locally, via SSH and...

March 8, 2021
Laravel Tutorial: Step by Step Guide to Building Your First Laravel Application
Web Dev

Laravel Tutorial: Step by Step Guide to Building Your First Laravel Application

Since its initial release in 2011, Laravel has experienced exponential growth. In 2015, it became the most starred PHP...

March 7, 2021
Next Post
You want minmax(10px, 1fr) not 1fr

You want minmax(10px, 1fr) not 1fr

Movim: An Open-Source Decentralized Social Platform Based on XMPP Network

Movim: An Open-Source Decentralized Social Platform Based on XMPP Network

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended

Working with JavaScript Media Queries

Working with JavaScript Media Queries

September 7, 2020
How to Detect When a Sticky Element Gets Pinned

How to Detect When a Sticky Element Gets Pinned

November 10, 2020
Tailwind versus BEM

Tailwind versus BEM

November 25, 2020
Make Jamstack Slow? Challenge Accepted.

Make Jamstack Slow? Challenge Accepted.

July 15, 2020

Categories

  • AWS
  • Big Data
  • Database
  • DevOps
  • IoT
  • Linux
  • Web Dev
No Result
View All Result
  • Web Dev
  • Hack
  • Database
  • Big Data
  • AWS
  • Linux

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In