Book Image

Svelte 3 Up and Running

By : Alessandro Segala
Book Image

Svelte 3 Up and Running

By: Alessandro Segala

Overview of this book

Svelte is a modern JavaScript framework used to build static web apps that are fast and lean, as well as being fun for developers to use. This book is a concise and practical introduction for those who are new to the Svelte framework which will have you up to speed with building apps quickly, and teach you how to use Svelte 3 to build apps that offer a great app user experience (UX). The book starts with an introduction to Svelte 3, before showing you how to set up your first complete application with the framework. Filled with code samples, each chapter will show you how to write components using the Svelte template syntax and the application programming interfaces (APIs) of the Svelte framework. As you advance, you’ll go from scaffolding your project and tool setup all the way through to production with DevOps principles such as automated testing, continuous integration, and continuous delivery (CI/CD). Finally, you’ll deploy your application in the cloud with object storage services and a content delivery network (CDN) for best-in-class performance for your users. By the end of this book, you’ll have learned how to build and deploy apps using Svelte 3 to solve real-world problems and deliver impressive results.
Table of Contents (9 chapters)

What this book covers

Chapter 1, Meet Svelte, After covering what modern web development looks like, with concepts such as JAMstack and Single-Page Apps (SPAs), we introduce the Svelte 3 framework and explain how it differs from other popular frameworks like Angular and React: how it can lead to smaller bundles and faster apps. We will also introduce the goal of the book, which is to create a sample app for creating your own journal.

Chapter 2, Scaffolding Your Svelte Project, Before we dive into building the app, we will go through the steps to install all the required tools, such as Node.js and Visual Studio Code (optional). We will then scaffold the project, create the folder structure, and setup Webpack. Lastly, we will create a "hello world" app with Svelte 3 and run it locally with a development server, to verify that our setup is complete and correct.

Chapter 3, Building Reactive Svelte Components, In this chapter, we'll start building the Svelte components that our journaling app uses. In the process, we will learn about the syntax used by Svelte templates, and concepts such as binding and events.

Chapter 4, Putting Your App Together, As we create the last components that our app depends on, we will learn about Svelte stores and transitions. We will then look into other features of the Svelte 3 language and runtime, including a more advanced one.

Chapter 5, Single-Page Applications with Svelte, In the first part of this chapter, we'll focus on building Single-Page Apps (SPAs) with Svelte 3, including implementing client-side routing (and we'll look at the two main options for doing that, and when to use which). In the second part, we'll briefly look into creating automated tests for our apps using Nightwatch.js. Lastly, we'll add ESLint to the project and configure it to enforce styling conventions.

Chapter 6, Going to Production, We'll end our journey by bringing the app to production. We'll cover how to serve the app from object storage (Azure Blob Storage) with a CDN in front. We'll also look at pushing our code to GitHub and adding Continuous Integration and Continuous Delivery using GitHub Actions, to automatically build, test, and deploy our app.

Chapter 7, Looking Forward, This chapter looks at what's next for readers, and how they can progress in their knowledge of developing JAMstack apps with Svelte 3.