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

Summary

In this chapter, we discussed some of the prerequisite knowledge and tools needed for getting started with SvelteKit. You likely already had a computer running a capable operating system with a browser installed. You may even have had the latest LTS version of Node.js installed with the npm package manager. We also briefly touched on getting your editor prepared by installing Svelte-specific extensions.

We continued by covering the installation process of SvelteKit. The prompts provided during the installation make setting up a new SvelteKit project simple and easily customized to a developer’s liking.

After the project installation, we took a high-level look at SvelteKit’s project structure. While the tests/ and static/ directories are fairly straightforward, some nuances lie within the src/ folder. For instance, keeping various Svelte components and other utilities in the src/lib/ folder can help keep a project from becoming difficult to navigate. Components located there are also easily accessed across application code via the $lib/ alias.

We also created a rudimentary “Hello, World!” application. It showcased how simple SvelteKit makes it to start building an application from scratch.

In the next chapter, we’ll go over some of the various configuration options you may need to tweak in both SvelteKit and Vite to customize them to suit your needs.