Svelte.js - Slender and Elegant

Dec 27, 2019

Svelte.js - Slender and Elegant

A Slender & Elegant JavaScript Front-end Framework That Is Definitely Worth A Look & Is The Future Of Javascript Frameworks

Author

Rajat
RajatSoftware Engineer

Is Svelte.js the future?

Svelte is another addition to the diverse options in the 'JavaScript Based Frameworks' pool. There are new frameworks in the market every week claiming to be the best. It's unrealistic to think that you can learn every new framework every other week or month, but Svelte is totally worth a try. Why? Let’s find out.

Why Stick To Run Time Update?

Popular frameworks like React & Vue have promoted the virtual DOM in such a way that every new framework is trying to use virtual DOM more efficiently. It is important to manage run time updates and if you are updating everything at run time then you are left with very few options & virtual DOM, in that case, is a very modest and elegant solution.

This is where Svelte changes the game. Svelte manages everything at compile-time and does not bother with run time updates. Svelte knows how the state of the component can change and generates the fewest possible steps to manage those changes at compile-time only.

How does it do that?

So managing updates at compile-time sounds great, but how does Svelte achieve that? Let’s dig deeper into that. 

First, we should discuss Reactivity in Svelte. By the way Svelte handles reactivity, it can be considered as truly reactive. 

The image above summarises reactivity in Svelte. If count is your state variable, then your state is now reactive. Re-assigning value to a variable using the assignment operator is all it takes to make Svelte reactive. Now let’s discuss how this reactivity causes Svelte to update the DOM.

Svelte marks this state variable as dirty & generates a function that updates this value in the real DOM whenever this state variable reacts (gets reassigned). This function is then embedded into a bundle output at the compile time & will be called whenever our state variable reacts. That’s all.

Smaller Bundle Size -> Fast Boot-up In Browser

What’s great about Svelte is its small bundle size. So you save more on memory & at the same time enjoy quick boot-up in the browser. Svelte is more of a compiler rather than a framework that converts all your framework code into plain javascript code at compile-time & you get a very small bundle size. Above that, the framework code of Svelte is also limited to only some lines of code. The main functions needed to boot-up framework reside in internal.js file in the Svelte.js package. Of those functions, only those functions will be imported which really contributes to application in the browser. No unnecessary function or data to burden your application.

Animations in Svelte

Animation in Svelte provides a fabulous performance. Most of the animations in Svelte are achieved using CSS only, the use of javascript is avoided to a large extent, because CSS animations run off the main thread, your animations are more performant.

Say Hello To Embedded Applications

Although for now, using Svelte for large web applications is still under scrutiny. Using it for embedded applications seems quite promising. We are becoming more of the embedded application world as days are passing. We are almost ready for a great option for that embedded world in the form of Svelte.

Thanks for reading!

Subscribe to Our Newsletter

More from the engineering frontline.

Dive deep into our research and insights on design, development, and the impact of various trends to businesses.
Insight
Building a Real-Time Photo Sync Video Experience Using 100ms SDK and Reactive State Management
Oct 15, 2026

Building a Real-Time Photo Sync Video Experience Using 100ms SDK and Reactive State Management

This blog explains how to build a real-time video experience with synchronized photo sharing, chat, and reactive state management using the 100ms SDK.

Insight
Taming Elasticsearch at Scale
Oct 13, 2026

Taming Elasticsearch at Scale

Optimize Elasticsearch for millions of records with better pagination, leaner payloads, efficient filtering, faster ingestion, and frontend techniques that keep search responsive with increase in data.

Insight
Deep Linking for Mobile Apps(React Native) with NestJs, AWS CloudFront, S3 & ALB: A Complete Guide
Oct 13, 2026

Deep Linking for Mobile Apps(React Native) with NestJs, AWS CloudFront, S3 & ALB: A Complete Guide

Build a self-hosted deep linking and referral system for React Native without a third-party SDK. This guide covers Android App Links, iOS Universal Links, an S3 and CloudFront setup, and a NestJS backend that routes users to the right app store.

Insight
How We Engineered a Three-Path Reward Processing System for a Real-Time Sports Platform
Oct 12, 2026

How We Engineered a Three-Path Reward Processing System for a Real-Time Sports Platform

This blog explains how a real-time sports platform uses synchronous, asynchronous, and scheduled processing paths to handle rewards without slowing down the player experience.

Insight
Building an MCP-Powered QA Agent
Oct 12, 2026

Building an MCP-Powered QA Agent

Build an MCP QA agent that runs Playwright tests, validates APIs, and analyzes failures through a controlled, auditable tool layer with human approval.

Insight
From Test Failure to Root Cause: Building an AI-Assisted Playwright Failure Analysis Pipeline
Oct 9, 2026

From Test Failure to Root Cause: Building an AI-Assisted Playwright Failure Analysis Pipeline

This blog explains how an AI-assisted Playwright pipeline can analyze test failure evidence, identify probable root causes, and support human-validated debugging.

Insight
The Model Context Protocol: From First Call to Production
Oct 8, 2026

The Model Context Protocol: From First Call to Production

This blog explains how Model Context Protocol (MCP) works, from tool discovery and execution to OAuth authorization, security controls, and production deployment.

Footer

The Right Conversation Can

Save You Six Months.

Book a Call