Book Image

SvelteKit Up and Running

By : Dylan Hildenbrand
Book Image

SvelteKit Up and Running

By: Dylan Hildenbrand

Overview of this book

The JavaScript ecosystem has grown vast, complex, and daunting for newcomers. Fortunately, SvelteKit has emerged, simplifying the process of building JavaScript-based web applications. This book aims to demystify SvelteKit, making it as approachable as it makes web app development. With SvelteKit Up and Running you’ll be introduced to the philosophy and technologies underlying SvelteKit. First, you’ll follow a standard educational programming approach, progressing to a 'Hello World' application. Next, you’ll explore the fundamental routing techniques, data loading management, and user submission, all through real-world scenarios commonly encountered in day-to-day development, before discovering various adapters employed by SvelteKit to seamlessly integrate with diverse environments. You’ll also delve into advanced concepts like dynamic route management, error handling, and leveraging SvelteKit to optimize SEO and accessibility. By the end of this book, you’ll have mastered SvelteKit and will be well-equipped to navigate the complexities of web app development.
Table of Contents (19 chapters)
1
Part 1 – Getting Started with SvelteKit
5
Part 2 – Core Concepts
10
Part 3 – Supplemental Concepts

Importing Assets

If you have worked in web development for the past decade, then you’ll remember a time when styles were written either inline or in a Cascading Style Sheet (CSS). These CSS files are helpful for creating a consistent look and feel for an application. Of course, their centralized nature comes with its own drawbacks. They often become large and difficult to navigate, which can lead to the inclusion of unused style rules. When precious milliseconds can mean the difference between converting a user or losing a sale, it’s important not to ship unused assets to clients. Besides, if we’re building a web application with SvelteKit, we really should use the Svelte approach and keep styles isolated within each component. But there are times when it’s useful to keep a style sheet that applies some global styles. For instance, imagine having to apply a specific style to each and every paragraph element. Incorporating the same simple style rule into...