Bytesized - Bytesized #002 — Svelte.js ⚡️

Bytesized Newsletter
Bytesized
Ideas for technologists

#002 — Svelte.js ⚡️

🎓 What is it?

Cybernetically enhanced web apps.

Svelte is a JavaScript framework for building declarative user interfaces.

Svelte demo

⌛ The past

The frontend development world is dominated right now by frameworks. React is the most popular, but a number of "single-page" frameworks exist—where the tool is responsible for reading and writing to the DOM in order to compose a user interface.

The downside to this is that learning how to "make an app" is complicated right now. React and tools like it aren't just about learning JavaScript—you have to start to intuit about functional programming concepts, how to integrate CSS into a JavaScript project, and more.

Frontend applications are really complex. To meet this complexity and try to mitigate it, JavaScript frameworks have begun to heavily rely on a classic programming tool: compilers.

Compilers are the new frameworks. Tom Dale posits that the compilers are where we should focus our efforts to see compounding returns in frontend performance:

My current “investment thesis” is that what we call web frameworks are transforming from runtime libraries into optimizing compilers. When it comes to eking performance out of hand-authored JavaScript and accompanying runtime libraries, we’ve reached the point of diminishing returns.

📌 Right now

Svelte is a build-time framework. You're still writing components like in React or Vue, but instead of compiling them in browser, Svelte compiles them for you into a single bundle.js file at compilation time.

Because Svelte compiles your application, it can optimize for building imperative code that can reach in and update individual pieces of your application without needing to do complicated virtual DOM operations.

Compilers are in right now—TypeScript developers work with another powerful compiler every single day. But Svelte takes it a step further, by not just compiling JavaScript: it also compiles HTML and CSS, too.

The .svelte file used by Svelte applications allows you to mix modern JavaScript, scoped CSS, and HTML into a single template.

Svelte GIF

Ryan Atkinson summarizes this approach and how Svelte feels different in "Why Svelte":

Svelte components are a thin layer over the DOM and naturally expose the web platform. Coding in Svelte feels like I’m moving with the grain of the web. React abstracts the DOM with functionally pure declarative rendering and provides escape hatches back to mutable imperative DOM land.

That being said, compilers aren't necessarily a magic bullet. Compilers are themselves a complex software project, and even if it simplifies your frontend application, there's still complexity somewhere. From the same article as above:

Compilers may appear to magically eliminate complexity, but that’s an illusion — they shift it. The compiler architecture moves complexity from the runtime and source code to build time and tools. Behind Svelte’s simple APIs sits a beefy compiler.

📈 What's next?

Earlier this year, Svelte landed first-class TypeScript support. It was contributed via a TypeScript maintainer and a number of Svelte community members.

Svelte + TypeScript

Svelte continues to grow in mindshare and popularity. In 2019's "State of JS" survey, almost 75% of surveyed developers had heard of Svelte, 45% had heard of Svelte and wanted to use it, and 7% had used it.

🤔 Why it matters

Conceptually, Svelte is rethinking reactivity. It does this by building a superset of JavaScript that Svelte's compiler can understand, and baking reactivity into the language itself, instead of adding additional abstractions like lifecycle hooks.

I'm excited and interested in Svelte because I think that it presents a really different philosophy to building frontend applications. It's good for the framework space to have diversity, and Svelte's approach to build-time components may end up being a great bet on developer experience that will help it grow into the framework of choice for frontend developers.

🙋‍♀️ Who to know

🔗 Links

What did you think of Bytesized #2? Let us know by clicking a reaction below ⏬

😍🤯😴😡👍👎

Bytesized is a weekly newsletter exploring ideas for developers. Join us on our Discord server 👋

Refer your friends to our newsletter!

You'll get rewards and swag as you refer more people to Bytesized :)

It’s easy, just copy and paste your unique link and share it in an email, on Twitter, or wherever you like. Thanks for spreading the word!

Your referral link: https://www.bytesized.xyz/newsletter?rh_ref=d69b9b2f

Bytesized is produced by Kristian Freeman (hello!)

You can unsubscribe from our emails here.

10025 Wind Cave Trail, Austin, TX 78747

Older messages

Bytesized #003 — Serverless 📦

Sunday, December 6, 2020

Bytesized Ideas for technologists 🔐 Overwhelmed by auth? Auth0 lets you quickly and easily add rock-solid authentication to your applications, including universal login, multi-factor authentication,

This is what happens when software developers run Black Friday deals

Sunday, December 6, 2020

​ I know that you're going to get a thousand of these kind of emails today, so I'll keep it short and sweet. We're working with eight excellent authors and educators over the next few days

This is what happens when software developers run Cyber Monday deals

Sunday, December 6, 2020

​ Happy Cyber Monday 🤖 I know that you're going to get a thousand of these kind of emails today, so I'll keep it short and sweet. We're working with eight excellent authors and educators

Bytesized #004 — Flutter 🐦

Sunday, December 6, 2020

Bytesized Ideas for technologists Fauna is a flexible, developer-friendly, transactional database delivered to you as a secure, web-native API. Never again worry about database provisioning,

😇 giving stuff away for the rest of the month

Sunday, December 6, 2020

Bytesized Ideas for technologists Hey there 👋 I'll keep it short since it's Friday and we all could use some time off our computers and phones — Bytesized is giving away six copies of Colby

You Might Also Like

Dark forest, bad art and paying to bike

Saturday, December 28, 2024

Neologism #24, 28.12.2024 ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Weekend Reading — Happy New Year! 🥳

Saturday, December 28, 2024

Vitalis 🇺🇦 The most original and unusual landmark in Odesa, which has become a symbol of the creativity of Odesa residents. Tech Stuff Cursor I really really like Cursor. I had a great time using VS

Daily Coding Problem: Problem #1651 [Hard]

Saturday, December 28, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Apple. You are going on a road trip, and would like to create a suitable music playlist.

📺 There's Still A Place for Universal Remotes — 10 Apps I Always Install on a New Mac

Saturday, December 28, 2024

Also: How to Add Emails to Your Tasks To-Do List in Gmail, and More! How-To Geek Logo December 28, 2024 Did You Know In December 2014, two con men from Girona, Spain, agreed to sell a fake Francisco de

Ranked | The World's Top 30 Countries, by Automobiles Manufactured 🚙

Saturday, December 28, 2024

In 2023, China led global car production, contributing nearly a third of total output. Which countries followed in this competitive industry? View Online | Subscribe | Download Our App FEATURED STORY

🐍 New Python tutorials on Real Python

Saturday, December 28, 2024

Hey there, There's always something going on over at Real Python as far as Python tutorials go. Here's what you may have missed this past week: Learn From 2024's Most Popular Python

15,000+ Four-Faith Routers Exposed to New Exploit Due to Default Credentials

Saturday, December 28, 2024

THN Daily Updates Newsletter cover Resilient Cybersecurity ($39.99 Value) FREE for a Limited Time Reconstruct your defense strategy in an evolving cyber world Download Now Sponsored LATEST NEWS Dec 28,

Hands Down One Of The Best Cards For 2025 Offering 0% interest until 2026

Saturday, December 28, 2024

iPhoneLife Logo Sponsored email sent by iPhone Life Hands Down One Of The Best Cards For 2025 Offering 0% interest until 2026 If you have outstanding credit card debt, getting a new 0% intro APR credit

📧 What Rewriting a 40-Year-Old Project Taught Me About Software Development

Saturday, December 28, 2024

​ What Rewriting a 40-Year-Old Project Taught Me About Software Development Read on: m​y website / Read time: 7 minutes The .NET Weekly is brought to you by: As the year wraps up, it's clear API

This Week in Rust #579

Saturday, December 28, 2024

Email isn't displaying correctly? Read this e-mail on the Web This Week in Rust issue 579 — 25 DEC 2024 Hello and welcome to another issue of This Week in Rust! Rust is a programming language