Logo

dev-resources.site

for different kinds of informations.

Why Svelte?

Published at
12/12/2024
Categories
svelte
sveltekit
react
a11y
Author
chris_devto
Categories
4 categories in total
svelte
open
sveltekit
open
react
open
a11y
open
Author
11 person written this
chris_devto
open
Why Svelte?

I found myself wondering what technology stack to use for my personal site.

I've recently been working within Ruby on Rails, however my perception within the private sector, is this is not a Frontend web framework that is usually considered an option (I'm not entirely sure why).

Realistically, this site doesn't even need to even use an single-page application (SPA) framework but learning-wise I felt I wanted to use some type of SPA.

I was looking at React as an obvious option but I wanted it to be accessible as possible out-of-the-box. With React, I started to notice some issues. This isn’t an anti-React post by any means, it’s more of a "here is what I’ve learnt in the context of React and Accessibility and why I chose Svelte."

React doesn't handle page titles in an accessible way without additional work. Typically when a user changes page, the page title is read-out-loud through a screen reader as the page is reloaded. However with React, as this is a SPA that does routing, this doesn’t happen quite the same. There’s some additional work or a plugin that’s needed.

Additionally, focus management appeared a bit more complicated as well. Should a keyboard user need to navigate correctly, there’s a host of plugins and techniques that need to be considered.

I also wanted progressive enhancement to “just work”.

What this means is if JavaScript is disabled or doesn't load, the project will still render and work - to a point. Many users and use cases require a project to work without JavaScript, additionally it makes a project more robust. Give it a try, disable JS on this site to see this in action.

React (and React frameworks) have re-branded progressive enhancement, calling this server side rendering (SSR). By default progressive enhancement is not active within React. Some of the React frameworks have started to introduce progressive enhancement citing the benefits, like faster initial page load and enhanced performance on low-end devices.

I recently watched a documentary on the origins of React. It’s a really fascinating watch, however I think it might be fair to say that accessibility and disabled users were not necessarily at the forefront of priorities when this technology was created.

Enter Svelte

Svelte and Sveltekit was created later and after reviewing some of the features I started to feel it met of a lot of my requirements.

  • Svelte handles page titles in accessible way with route announcements
  • Progressive enhancement is setup "out-of-the-box"
  • Focus management was considered and is easier to control without plugins

Also, this is just a preference, but syntax wise it follows the same concepts that VueJS introduced. Namely, writing HTML CSS and JS just within the Svelte system rather than everything being written in a different syntax - JSX.

Side note, I also read an article titled "the Great Gaslighting of the JavaScript Era" which makes a lot of interesting points that I don't feel are shared or explored widely, if at all.

Of course, there are many reasons behind choosing a technology including the ecosystem, plugins, integrations, hiring and long-term investment. However these are just some of my reasons for choosing Svelte for this project.

sveltekit Article's
30 articles in total
Favicon
Optimize SvelteKit performance with brotli compression
Favicon
SvelteKit VS Astro. laidback side by side
Favicon
Integrating SvelteKit with Storyblok (Using Svelte 5)
Favicon
Make EditorJS work in Svelte(kit) SSR
Favicon
Why Svelte?
Favicon
Nosecone: a library for setting security headers in Next.js, SvelteKit, Node.js, Bun, and Deno
Favicon
Building AI-Powered Apps with SvelteKit: Managing HTTP Streams from Ollama Server
Favicon
NgSysV2-3.4: A Serious Svelte InfoSys: Rules-friendly version
Favicon
NgSysV2-3.3: A Serious Svelte InfoSys: Firebase D/b rules and Login
Favicon
NgSysV2-3.6: A Serious Svelte InfoSys: Deploying to the Google Cloud
Favicon
NgSysV2-3.5: A Serious Svelte InfoSys: Client-Server Version
Favicon
NgSysV2-4.2: SEO (Search Engine Optimisation)
Favicon
NgSysV2-4.3: Automated Svelte Pre-render Builds
Favicon
NgSysV2-4.4: Responsive/Adaptive Design
Favicon
Deploy a Static Sveltekit site to Railway
Favicon
Why You Should Avoid Using `try...catch` in SvelteKit Actions
Favicon
How to integrate shadcn-svelte into the editable.website template
Favicon
PostgreSQL Full Text Search Rank by Position
Favicon
How to Build a Content-Driven Static Site with Markdown, SvelteKit and Fusionable
Favicon
Interview with Prabhu Kiran Konda, Creator of Snail AI!
Favicon
"Helper" Varaibles in Svelte 5
Favicon
Experiences and Caveats of Svelte 5 Migration
Favicon
Running a Function When an #await Block resolves in Svelte(Kit)
Favicon
SanS-UI v0.0.1 Quick Start!
Favicon
Introduction to Svelte: Features and Benefits of the Modern JavaScript Framework
Favicon
Sveltekit + TypeScript + TypeORM + ESM
Favicon
Svelte 5 is out!!!
Favicon
SanS-UI Released v0.0.1
Favicon
How to Integrate Passkeys into SvelteKit
Favicon
AWS Amplify (Gen2) with SvelteKit: authentication on SSR

Featured ones: