Posted in:

Is Svelte Ready For Prime Time?

Developer experience (DX) is critical to the success of any web development project. Positive DX can increase developer productivity, reduce development time, and result in higher-quality code.

To achieve all that, selecting the right front-end development language and framework is essential. Developers are responsible for designing the structure and visual elements of the website, as well as ensuring high accessibility and responsiveness of navigation buttons and forms. 

The choice of development language and framework can significantly impact the ease of development, maintainability, and scalability of the project.

For instance, JavaScript (JS) is known for its high speed and performance, which can make web pages more responsive. Some of the commonly used front-end JS frameworks include React, Vue, Angular, and jQuery.

Svelte is another popular front-end JavaScript framework that has been gaining traction in recent years. With the release of Sveltekit, developers are excited about the future of Svelte and its potential to become a mainstream front-end technology.

So, how is Svelte different from its alternatives, and which famous brands are already using it? This article will discuss everything you need to know about this growing JS framework.

Introduction to Svelte

Svelte is a compiler-based JS framework. It compiles the source code written in Svelte syntax into optimized JavaScript code before running it in the browser. Much of the work is completed at build-time and not during run-time, as with most frameworks. 

Since the code is compiled ahead of time, there is no need to ship a large library of features to the browser. The framework generates the necessary code for the application to run. This optimized code is smaller and faster and improves the overall user experience. 

The history of Svelte

Svelte’s journey in the world of programming dates back to November 2016. Rich Harris created and introduced this framework as part of his proposed solutions to problems associated with complex web applications. 

Harris’s other famous works include The Guardian website and the Rollup bundler. Many believe that his Rollup project may have contributed to the idea of creating Svelte.

However, the first release didn’t attract many developers as it’s simply React with a compiler. The framework gained popularity after the introduction of Svelte 3.0 in 2019. This version came with many significant improvements, including enhanced performance and support for TypeScript.  

Svelte has evolved since its initial release and continues gaining popularity. A recent survey shows that more than 75% of developers consider it the most-loved front-end JavaScript framework. In fact, it won the Breakthrough of the Year award in 2020, highlighting its growth over the years. 

The focus on performance and DX have helped Svelte surpass some of its popular competitors like Vue, Angular, and React. With its growing ecosystem and community of developers, you can expect it to be among the most-used frameworks for many more years. 

What is SvelteKit?

SvelteKit is a framework used with Svelte to build web applications. Created in 2022, it is the successor to Sapper, which played a similar role. Sapper was a framework that allowed developers to create server-rendered applications with ease. SvelteKit builds on this functionality and offers support for static site generation (SSG), server-side rendering (SSR), and client-side routing (CSR).

SvelteKit is analogous to Next.js in the React ecosystem and Nuxt.js in Vue.js, which are popular frameworks to handle routing, application and SSR. With SSR, web pages are rendered before they’re sent from the server to the client. 

SSG generates static HTML files at build-time and sends them directly to clients, while CSR allows for easy client-side page transitions and navigation. These features improve website performance and reduce server load, making SvelteKit a versatile solution for developers building all types of web applications.

The recent release of SvelteKit 1.0 came in December 2022, as announced on the official site, Svelte.dev. This version is designed to enhance the process of building production-grade websites and is ideal for solo developers and teams working on large projects.

Which websites employ SvelteKit?

Many big companies have started adopting Svelte because it’s faster than most of the other frameworks. Another appealing feature of Svelte is the fact that it integrates with other libraries and frameworks. This flexibility allows developers to code using their preferred libraries. 

Here is a list of the top 10 biggest websites SvelteKit based on traffic:

  • Daisyui.com

First on the list is the official website for DaisyUI. This is a customizable component library for Tailwind CSS. The site uses SvelteKit to enhance its user experience through an interactive UI.

  • Nytimes.com

New York Times is one of the biggest daily newspapers in the world. Its official website, nytimes.com, is ranked 75th globally, with an average of over 640 million visits per month. Rich Harris, the creator of Svelte, worked with the New York Times on a project to improve the website’s performance and load times, which led to the adoption of Svelte as part of their front-end development stack.

  • Svelte.dev

Svelte’s official website, svelte.dev, not only serves as a comprehensive documentation hub for both Svelte and SvelteKit, but also provides some unique features to help developers get started with the framework. 

For example, the website hosts an interactive tutorial that teaches users how to build a simple app using Svelte. Additionally, the website also features a REPL (Read-Eval-Print Loop), which allows users to write and run Svelte code snippets directly in their web browser. 

This is a great way to experiment with Svelte’s reactive capability and get a feel for the framework without the need to set up a local development environment. 

  • Finance.ozon.ru

Famously referred to as the “Amazon of Russia,” Ozon is a big e-commerce company in Russia with their primary website built on Vue.js and Nuxt.js. Finance.ozon.ru is the brand’s finance site, and its user interface is designed using Svelte & SvelteKit instead. 

  • Downforeveryoneorjustme.com

If you’re worried that a website or service is down, Downforeveryoneorjustme.com is there to help. It allows you to quickly check if a site is unavailable or if it’s just you having connectivity issues.

You can also see what other users are reporting so you know what to do next. 

Because it is a functional and lightweight utility website, it is the ideal candidate to be built with SvelteKit, making it snappy and responsive.

  • Stake.com

The 6th biggest website using Sveltekit in production is a notable one, the biggest online casino, Stake.com. This multi-billion-dollar company is known for sponsoring Everton F.C. in the English Premier League, Alfa Romeo in Formula 1, and Drake. The website is also the official betting partner of the UFC in Latin America and Asia.

Switching over from React in late 2021, this gambling platform has been using Sveltekit since the early beta implementations—taking advantage of the simplification of routing, server-side rendering, and speed found in Sveltekit. 

Looking at their slots page, for example, you can see a fast-loading, easy-to-filter page with an added twist—the tiles for their game listing update dynamically based on region—showcasing that a highly dynamic website can still measure up performance-wise versus traditional server-side applications that are much easier to cache.

  • Huggingface.co

Hugging Face is an amazing platform for data science enthusiasts, which enables them to code, train, and deploy machine learning models with ease. As a leading open-source machine learning project, it requires the best tools, and that’s why it’s built using SvelteKit, a smart technology choice that provides superior performance, flexibility, and versatility. Hugging Face is also known for the popular “mini-Dalle2” trend on Twitter, where users generated prompt-based images using a text prompt

  • Creately.com

As businesses continue to employ the work-from-home model, leaders have to get more creative with their skills. Creately.com is one of the most popular platforms that enhance remote project management. Its adoption of SvelteKit will continue attracting more users.

  • Radiofrance.fr

Lovers of music and French culture enjoy browsing through the official website of the French public service radio broadcaster, Radio France. The site offers a wide range of musical genres, from jazz to classical music, as well as news and cultural programs. It’s an excellent resource for anyone looking to explore the rich cultural heritage of France and is a prime example of SvelteKit used.

  • Paimon.moe

Fans of the hit game Genshin Impact find Paimon.moe to be an incredible resource for the game. This site’s interactive user interface is powered by SvelteKit, enhancing your gaming experience by making it more engaging and visually appealing to find resources related to the game.

A comparison of Svelte to other front-end frameworks

As mentioned throughout the article, Svelte is quite unique based on its style of operation. But how does it compare to the likes of React and Vue?

  • Performance

Although it’s a relatively new framework, Svelte is already known for its exceptional performance. Its advanced approach to building web applications has made it stand out from its competitors.

React and Vue are the biggest rivals, but they currently can’t replicate what Svelte offers its users. The two frameworks use a Virtual Document Object Model (VDOM) to update the user interface. Vue has a smaller run-time than React, but they both have overhead.

On the other hand, Svelte compiles the code during build-time. This results in optimized JS code that loads and executes faster than the approach employed by other frameworks.

  • Build size

Since much of the work is done during build-time, the code size required during run-time is smaller and is fit for purpose. This small bundle size makes Svelte easier to load and quicker to render than the likes of React.

  • Learning curve

Svelte has a smaller API surface than other frameworks, meaning it has a lower learning curve. This makes it easier for developers to get started with Svelte and build applications quickly. In addition, the syntax of writing in Svelte matches native HTML, CSS & JS – making the learning curve very simple.

  • Component architecture

The component architecture of Svelte is unique compared to other frameworks. Instead of using a virtual DOM like React, Svelte uses a compiler that generates efficient code for updating the actual DOM. This makes it easier to reason about your code and reduces the likelihood of bugs.

  • Community

Unfortunately, Svelte still has a smaller community compared to React, Vue, and other popular frameworks. This is because it joined the market a few years ago while most of its competitors have been around for a decade.

But the community is growing rapidly, given Svelte’s current traction. Within a few years, more resources will be available for developers, as is the case with its competitors.  

Svelte’s potential to go mainstream

This framework has gained popularity in recent years, and its community of developers is growing every day. Of course, it’s not yet widely used like most front-end and back-end frameworks. But that’s not to say it won’t reach or surpass the levels of Angular, React, and Vue.

Svelte is quickly gaining momentum, and many companies already use it in production. As mentioned earlier, its approach is the most appealing factor that has attracted many developers. Code compilation at build-time ensures a smaller bundle size, which enhances strong performance. 

It also has a solid set of tools necessary for building web applications. The compiler, component-based architecture, and a reliable set of APIs make it a great option for developers.

So, is Svelte ready for prime time? Given all these features, Svelte is likely to continue grabbing the attention of companies and solo developers. This will help it mature and hit the mainstream in the future. However, this depends entirely on community support, industry trends, and developer familiarity. 

Benefits of using Svelte

Wondering why many developers are praising Svelte? Here are some of the reasons:

  • Its compilation process results in smoother overall performance.
  • Svelte has a small bundle size that ensures faster loading.
  • Its API surface is smaller and more straightforward than others, making it easier for developers to learn and use. 
  • The component-based architecture employed by Svelte makes it easier to manage and reuse UI elements.
  • Although its community of developers isn’t massive, it’s rapidly growing, and all the parties involved are actively contributing to the creation of new tools and resources.

The future of Svelte and SvelteKit

Svelte and SvelteKit have a promising future. This framework is constantly gaining popularity and has surpassed many established frameworks despite being introduced less than a decade ago. Things are working out well for everyone associated with Svelte, but what could impact its future?   

  • Constant development and improvement

The Svelte team has been busy since the first release in 2016. It gained its first massive traction in 2019 following the introduction of some of its current main features. Every year, developers add new features that make Svelte even more user-friendly. As it continues to evolve, it will likely become even more powerful and flexible.

  • Increased adoption

More companies and developers are learning about the benefits of Svelte. This growth in popularity is likely to increase the framework’s adoption in the coming years.

  • Competition from other frameworks 

The front-end framework landscape is constantly evolving, and new frameworks are always emerging that could compete with Svelte. However, Svelte’s unique approach to building web applications and its strong performance and small bundle size make it a compelling option for many developers.

  • Integration with other tools and technologies 

Svelte’s integration with other tools and technologies could impact its future. For example, Svelte’s integration with serverless functions could become more important as serverless architecture becomes more popular.

Conclusion

Svelte is a modern JavaScript framework that offers a unique approach to building web applications. Its small size, fast performance, and shallow learning curve make it an appealing choice for developers who want to create high-performance web applications quickly and efficiently. With its increasing popularity and active community, Svelte will likely continue to gain traction in the front-end development space in the coming years.