SvelteKit Up and Running
Leverage the power of a next-generation web framework to build high-performance web apps with ease
By Dylan Hildenbrand
Buy now!About the 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 SvelteKit 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 data submission, all through real-world scenarios commonly encountered in day-to-day development. You'll discover 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.
Whether you’re new to JavaScript development and are wondering which framework to pick up first, or are a seasoned developer tired of the bloat that comes with other popular frameworks; this book will teach you the concepts behind the project leading the field in revolutionizing JavaScript development. The examples found throughout the book are concise, practical, and easy to follow while still effectively demonstrating how to leverage the various techniques necessary for implementing features commonly found in web applications. The very site you're on right now is built and deployed using concepts taught in this book!
Dylan Hildenbrand
Dylan Hildenbrand is a freelance full-stack web developer with a penchant for understanding how things work. Over the past decade, that desire to know “how things work” has led Dylan to a robust skillset ranging from front and back-end development to database administration, Linux server administration, and automation of application deployments and testing procedures. Dylan graduated from Minot State University in 2012 with a degree in Computer Science and dove headfirst into the world of web development. While he enjoys working with JavaScript and Node.js, he also has years of training with PHP, WordPress, and Yii2. When not proselytizing to strangers about the benefits to free and open source software (FOSS), Dylan enjoys administering and automating his “homelab.” To read more of his ramblings about web development and why Vim is the best text editor, visit https://www.closingtags.com.
FAQ
Why did you write this book?
This book was written to be concise and simple resource for other developers looking to learn a next generation JavaScript framework. It was written to provide the explanations and examples I wish I had when learning SvelteKit. The examples aim to be practical yet provide real-world demonstrations utilizing the concepts powering SvelteKit. After finishing this book, readers will have a high level understanding of SvelteKit and be able to build and release their very own SvelteKit-based applications and web sites.
Who is this book for?
SvelteKit Up and Running is intended for web developers looking to advance their skill set by learning the next popular JS-based framework. Whether you’re new to web development and deciding which framework should be the first you learn, or you want to set yourself apart from other job applicants by adding yet another popular technology to your résumé, this book will provide you with all of the essential knowledge to begin your journey to becoming a SvelteKit master!
Do I need anything before starting?
Having a working knowledge of HTML, CSS, and JS are a must before beginning this book. Prior knowledge of Svelte and how it works will be very beneficial.
It also helps to have a computer to follow along with the provided code. Following along with the examples will ensure you're getting the experience inteded by the author. You'll need a MacOS, Windows, or Linux based computer with access to console or terminal for executing commands. You'll also need Node.js v16 or higher installed on your computer as well as a text editor. The code found in this book has been made freely available on GitHub. Likewise, the code for this very website is also available on GitHub.
What's in this book?
In the first part, you’ll be introduced to SvelteKit with a quick installation, followed up with the standard Hello, World! example we’ve all come to love and appreciate. This will help familiarize you with SvelteKit's project structure. It then goes on to lay some groundwork by exploring the various configuration options available to further customize a SvelteKit application. From there, it covers how SvelteKit leverages existing standards to deliver a small yet powerful framework.
In the second part, we learn why the developers of SvelteKit have made routing central to the framework. It examines some previously introduced routing techniques in more detail. This part then shows how SvelteKit moves data to Svelte components and accepts data from them through HTML form elements. Finally, you’ll see some more advanced routing techniques that promise to cover even the most obscure edge cases encountered in routing.
Part three aims to cover the additional requisite concepts of SvelteKit. It begins by showing you how to produce a build for a production environment with resources showing how easily it can be done using SvelteKit’s adapter system. It then covers how hooks can be used to manipulate data flowing in and out of a SvelteKit application. From there, it addresses how to best import static assets by leveraging Vite. Then, it explains the various modules available in SvelteKit that make the entire framework possible. The section also covers how to ensure that a SvelteKit application can be made available to as many users as possible while boosting search engine rankings. Finally, it wraps up with various resources that will prove invaluable to any developer attempting to power their next project with SvelteKit.
Where can I get it?
SvelteKit Up and Running can be obtained in a DRM-free format directly from Packt Publishing! It can also be purchased on Amazon but this author advises against purchasing there and instead recommends reading How to Resist Amazon and Why: The Fight for Local Economics, Data Privacy, Fair Labor, Independent Bookstores, and a People-Powered Future! for various reasions why you should avoid using Amazon's platform.
Can you recommend any other SvelteKit resources?
The Svelte and SvelteKit documentation are fantastic resources for getting started. There is also a wonderfully thorough tutorial maintained by the official team that covers many subjects not discussed in this book.
If you have finished SvelteKit Up and Running and are interested in taking your SvelteKit skills to the next level, check out Svelte with Test-Driven Development by Daniel Irvine. This incredible book dives into effective testing strategies for SvelteKit. Readers will learn how to incorporate Vitest to ensure each component behaves as expected. It also covers how to use Playwright to ensure users are getting the intended experience of the application. This resource will prove invaluable to those who wish to prove their code works correctly and is thoroughly tested.
I have more questions! What's the best way to reach you?
The author of this book (and website) can be reached via the contact form at https://closingtags.com/contact. He's also on the Fediverse at Mastodon!