The JavaScript Framework That Puts Web Pages on a Diet

By Moses Leonard   10 months ago   416
Programming - Top Stories

The JavaScript Framework That Puts Web Pages on a Diet

Svelte, created by a graphics editor for The New York Times, has attracted a following among programmers who want their pages to load faster.

WEBSITES ARE TOO damn big.

The average web page is about 2 megabytes, according to HTTP Archive, a site that tracks the performance of websites and the technologies they use. Sure you can download 2 megabytes in less than a second on a good 4G mobile connection. But today’s web pages are problematic for people on slow connections or with small bandwidth caps. Not all that long ago, a complex game or software program fit on a 1.4-megabyte floppy disk.

There are many reasons today’s web is so bloated, including the ads and tracking scripts that saddle so many pages. Another reason is that websites do much more than just display text and images. Many sites now look and feel like full-blown desktop applications.

To build these interactive sites, many web developers turn to open source packages that handle common tasks. These tools liberate programmers from a lot of grunt work, but they can add heft to a project. Facebook's popular open source React library for building user interfaces, for example, weighs in at 100 kilobytes. Throw in some other tools and graphics, and soon you’re talking many megabytes.

The up and coming JavaScript framework Svelte, created by visual journalist and software developer Rich Harris, aims to make it easier to write faster, smaller interactive websites and applications. Web developer Shawn Wang says he cut the size of his personal website from 187 kilobytes to 9 kilobytes by switching from React to Svelte.

"It was a big 'wow' moment," Wang says. "I wasn't even trying to optimize for size and it just dropped."

Harris, a graphics editor for The New York Times, created and released the first version of Svelte in 2016 while working for The Guardian. Many of his projects involved interactive graphics and animations, but he worried that the graphics could take too long to load or would chew through users’ data limits.

Frameworks add heft to websites because they traditionally serve as a middle layer between an app's code and the user's browser. That means developers need to bundle the entire framework, in addition to their own code, with an app, even if they don't use all of the framework's features. Wang compares this to a rocket ship that needs massive fuel tanks to launch into space.

[NewsNaira]


Share this article!


Login to comment and earn


David042
10 months ago

Wow that amazing ooh 


(Quote) (Likes)
Possible Polypraise
10 months ago

Rhat put web oage in diets


(Quote) (Likes)
Caroline Udo
10 months ago

Mmmnnbbvvxfjkooiuygddghjkkmmn


(Quote) (Likes)
Usman Yusuf
10 months ago

Page on diet


(Quote) (Likes)
Simon
10 months ago

Wooooooooooooooow cool


(Quote) (Likes)
Ossom Louis Oreva
10 months ago

JavaScript is the blast


(Quote) (Likes)
Emmanuel Jille
10 months ago

Nice innovation


(Quote) (Likes)
Apenda Emmanuel
10 months ago

Hmmmmmm kaiii ooooo


(Quote) (Likes)

Woow,but the best JavaScript is this


(Quote) (Likes)
Nneoma Aniuche
10 months ago

Wow amazing 


(Quote) (Likes)
Jacob
10 months ago

This is a wonderful air work


(Quote) (Likes)

Good and great initiative.


(Quote) (Likes)
Monday Erik Udeme
10 months ago

This is very cool like it and it's a good tool for innovation too


(Quote) (Likes)
Amonimo Temitope
10 months ago

Ohh amazing


(Quote) (Likes)
Chibundu
10 months ago

Choi more than amazing 


(Quote) (Likes)
Ephraim Idogho
10 months ago

Page on diet


(Quote) (Likes)
Unegbu Bright
10 months ago

Wow that’s amazing 


(Quote) (Likes)
Hussaina Adamu
10 months ago

OK ooooooooo


(Quote) (Likes)
Okechukwu Francis
10 months ago

Jalvalscript


(Quote) (Likes)
Blessed Tobey
10 months ago

The internet is vast. No ome really knows its full ability yet. 

Web developers are incredible. 


(Quote) (Likes)