Outline updated November 2026

Advanced14 hours delivered over 2 daysLive, online

Request this course

Svelte Pro Techniques

Class Duration

14 hours of live training delivered over 2 days.

Student Prerequisites

  • Svelte, JavaScript, and HTML programming experience
  • Working knowledge of runes, snippets, and SvelteKit routing
  • Experience with CSS is helpful but not required

Target Audience

Developers who already build with Svelte and SvelteKit and want to write larger, faster, easier-to-maintain apps. This course assumes the fundamentals from Svelte Essentials; together the two courses form a five-day Svelte and SvelteKit program.

Description

This course covers the advanced parts of Svelte and SvelteKit for developers who already ship Svelte apps. It starts with fine-grained reactivity: reactive classes, writable deriveds, untrack, the reactive built-ins, and $inspect.trace. Students then build typed generic components, type-safe context, attachments, and motion with Tween and Spring. SvelteKit topics include hooks, error handling, invalidation, shallow routing, explicit environment variables, and observability. The course closes with the experimental async features and a testing strategy with Vitest, Storybook, and Playwright.

Learning Outcomes

  • Design reactive state with classes, .svelte.ts modules, and writable deriveds.
  • Use the reactive built-ins in svelte/reactivity.
  • Debug reactivity with $inspect, $inspect.trace, and IDE breakpoints.
  • Use function, media, and dimension bindings.
  • Build typed generic components with snippet props and createContext.
  • Write reusable attachments and convert actions with fromAction.
  • Build transitions and motion with Tween and Spring.
  • Handle errors and pending states with <svelte:boundary>.
  • Apply advanced SvelteKit routing, hooks, invalidation, shallow routing, and snapshots.
  • Configure explicit, validated environment variables.
  • Trace requests with OpenTelemetry and instrumentation.server.ts.
  • Evaluate the experimental await in components and remote functions.
  • Test components, load functions, and form actions with Vitest, Storybook, and Playwright.

Training Materials

Comprehensive courseware is distributed online at the start of class.

Software Requirements

Students will need a free, personal GitHub account to access the courseware. Students will need permission to install Node.js and Visual Studio Code on their computers. Also, students will need permission to install NPM Packages and Visual Studio Code extensions. If students are unable to configure a local environment, a cloud-based environment can be provided.

Software versions: Svelte 5 and SvelteKit 3 with Vite 8, TypeScript 6, and Node.js 22.17 or later.

Training Topics

Fine-Grained Reactivity in Depth

  • How signals, effects, and push-pull updates work
  • Reactive classes with $state and $derived fields
  • Shared reactive modules in .svelte.ts files
  • Writable deriveds for optimistic UI
  • untrack and $effect.tracking
  • $effect.pre and $effect.root
  • SvelteMap, SvelteSet, and SvelteURL
  • MediaQuery for responsive state
  • Window state from svelte/reactivity/window
  • External sources with createSubscriber

Debugging Svelte Apps

  • {@debug} and $inspect
  • Tracing effect dependencies with $inspect.trace
  • Breakpoint debugging in VS Code and JetBrains
  • Compiler warnings and runtime warnings

Advanced Bindings

  • Function bindings with getters and setters
  • Content-editable bindings
  • Each block bindings
  • Media element bindings
  • Read-only dimension bindings
  • Element references with bind:this
  • Bindable props across component boundaries

Advanced Component Composition

  • Snippet props, parameters, and fallbacks
  • Typing snippets with Snippet
  • Generic components with the generics attribute
  • Type-safe context with createContext
  • Reactive context patterns
  • Module scripts with <script module>
  • Unique IDs with $props.id()
  • Reading named slots in existing code

Attachments and Actions

  • Attachment factories and inline attachments
  • Re-running attachments when state changes
  • Conditional attachments
  • Passing attachments through wrapper components
  • Spreading attachments with createAttachmentKey
  • Converting actions with fromAction
  • Wrapping third-party DOM libraries

UI Special Effects

  • Motion with the Tween and Spring classes
  • Respecting prefersReducedMotion
  • The transition: directive and parameters
  • in: and out: transitions
  • Custom CSS and JavaScript transitions
  • Transition events
  • Local vs. global transitions
  • Key blocks
  • The animate: directive and flip

Special Elements

  • <svelte:boundary> with failed and pending snippets
  • <svelte:element> for dynamic tags
  • <svelte:window>, <svelte:document>, and <svelte:body>
  • <svelte:head>
  • <svelte:options>
  • Replacing <svelte:self> with self-imports
  • Replacing <svelte:component> with dynamic components
  • Replacing <svelte:fragment> with snippets

Advanced Routing

  • Optional parameters
  • Rest parameters
  • Param matchers in src/params.ts
  • Route groups and breaking out of layouts
  • Route sorting and encoding
  • Organizing layouts and routes

Hooks

  • Server, client, and universal hooks files
  • handle, sequence, and event.locals
  • handleFetch for server-side requests
  • handleError for all error kinds
  • reroute and transport
  • init for startup work

Errors in Depth

  • Error boundaries for load and render errors
  • Typing App.Error
  • Controlling status codes from handleError

Pages and Layouts

  • ssr, csr, and prerender page options
  • trailingSlash
  • Universal vs. server load functions
  • Invalidation with depends and invalidate
  • Reloading everything with refreshAll
  • Snapshots for ephemeral state
  • Shallow routing with goto and page.state
  • View transitions with onNavigate
  • Preloading data and code
  • data-sveltekit-* link options
  • Reloading and replacing state

Configuration and Operations

  • Explicit environment variables in src/env.ts
  • Public and private variables
  • Static and dynamic values
  • Validating variables with Standard Schema
  • Server-only modules
  • instrumentation.server.ts and OpenTelemetry tracing

Async Svelte (Experimental)

  • Enabling await in components
  • await in markup and $derived
  • Pending states with <svelte:boundary>
  • $effect.pending()
  • settled() and fork()
  • Adoption guidance for experimental features

Remote Functions (Experimental)

  • Type-safe calls from .remote.ts files
  • query, query.batch, and query.live
  • form with schema validation
  • Form fields with field.as()
  • command and single-flight mutations
  • prerender for static data
  • Remote functions vs. load functions and form actions

Unit Testing

  • Why unit test Svelte?
  • Vitest setup with sv add vitest
  • Testing runes in .svelte.test.ts files
  • flushSync and $effect.root in tests
  • Component tests with Testing Library
  • Vitest browser mode
  • Interaction tests with Storybook
  • Testing load functions, form actions, and hooks
  • End-to-end tests with Playwright

Private team training

Bring this course to your team

Tell us about your team and we will tailor this outline to your tools, stack, and schedule. Courses can also be combined into a longer program.

  1. Tell us what you needYour tools, stack, team size, and timeline.
  2. We send a proposalA course or program, an outline adjusted to your team, and possible dates.
  3. Your team trains liveOnline or on-site, with courseware for every student.

Prefer to talk? Call +1 434-509-6890 or email help@cloudcontraptions.com.

We reply within 1 business day.

Training partner?