Svelte Society
Svelte is retiring Sapper in favor of SvelteKit, replacing monolithic development bundles and dual-template friction with unbundled native modules and pluggable adapters for hybrid serverless deployments.
AI-assisted summary of Rich Harris: Futuristic Web Development — original source. Check the original for full context.
Source published:
Key ideas
- Rich Harris announced that Sapper 1.0 will never be released, replacing both Sapper and the basic Svelte template with a unified, officially supported application framework called SvelteKit. (0:00)
- SvelteKit adopts an unbundled development server powered by Snowpack, enabling sub-second, state-preserving Hot Module Reloading by compiling files lazily and in isolation via native browser ES imports. (5:29)
- Production builds run through a three-phase pipeline—Snowpack unoptimized compilation, Rollup optimization, and adapter generation—enabling seamless deployment targets from Node servers to serverless edge platforms. (12:22)
- Developers can implement hybrid rendering within the same application by exporting `export const prerender = true;` on static routes while letting dynamic routes execute on demand in serverless functions. (17:11)
- The Svelte project has established an official Open Collective to fund infrastructure costs and eventually compensate open-source contributors directly. (22:06)
Detailed notes
## Background This talk was published by Svelte Society on YouTube on October 19, 2020, following its presentation at Svelte Summit 2020. The session addresses how the frontend ecosystem evolved since the inception of Svelte and Sapper, exploring what a reimagined, modern workflow looks like with the introduction of SvelteKit.
## TL;DR Rich Harris announces that Sapper 1.0 will never be released, unveiling SvelteKit as the single, canonical framework for Svelte applications. SvelteKit leverages Snowpack for unbundled, instant local development and state-preserving hot module reloading, transitioning to Rollup and a pluggable adapter system for optimized production builds. The platform rethinks static exporting by invoking Svelte's server-side rendering API in-process and introduces hybrid rendering that pairs pre-rendered static routes alongside on-demand serverless functions. Harris concludes by addressing migration paths, guaranteed TypeScript support, framework extensibility, and the launch of Svelte's Open Collective.
## Atmosphere & style The presentation blends high-energy technical advocacy with disarming, self-deprecating humor and conversational transparency. Harris moves seamlessly from deadpan humor—delivering the revelation that Sapper 1.0 will never launch—into brisk, live-coding terminal demos that capture the visceral speed of unbundled development. The mood is infectious and communal, underscored by unpolished moments like forgetting to save a configuration file and Harris's visible excitement for the architectural future of Svelte.
## Bulletin - [00:00](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=0s) Rich Harris announced that Sapper 1.0 will never be released, replacing both Sapper and the basic Svelte template with a unified, officially supported application framework called SvelteKit. - [05:29](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=329s) SvelteKit adopts an unbundled development server powered by Snowpack, enabling sub-second, state-preserving Hot Module Reloading by compiling files lazily and in isolation via native browser ES imports. - [12:22](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=742s) Production builds run through a three-phase pipeline—Snowpack unoptimized compilation, Rollup optimization, and adapter generation—enabling seamless deployment targets from Node servers to serverless edge platforms. - [17:11](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=1031s) Developers can implement hybrid rendering within the same application by exporting `export const prerender = true;` on static routes while letting dynamic routes execute on demand in serverless functions. - [22:06](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=1326s) The Svelte project has established an official Open Collective to fund infrastructure costs and eventually compensate open-source contributors directly.
## Key takeaways - [00:00](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=0s) Sapper's legacy codebase suffered from structural maintainability issues and struggled to support modern paradigms like serverless architectures and selective pre-rendering. - [00:00](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=0s) SvelteKit resolves developer confusion by establishing a single canonical starting point (`npm init svelte@next`) for all Svelte applications. - [02:44](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=164s) Scaffolded SvelteKit projects introduce a streamlined layout featuring `src/app.html`, file-based routing in `src/routes/`, and adapter-driven configuration via `svelte.config.js`. - [05:29](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=329s) Hot Module Reloading preserves component state during in-place markup and logic edits without triggering full page reloads. - [06:54](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=414s) Layout components (`layout.svelte`) wrap child routes via default `<slot />` projection, avoiding repetitive boilerplate and eliminating unused CSS warnings. - [06:54](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=414s) SvelteKit blends server-rendered initial HTML for fast startup and SEO with immediate client-side router takeover for instant subpage transitions. - [10:35](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=635s) Traditional bundlers (Webpack, Rollup) create development bottlenecks by traversing and concatenating whole dependency trees, whereas unbundled tools transform individual files on demand. - [12:22](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=742s) Production deployments still require coarse-grained, code-split bundles, leading SvelteKit to use Rollup during phase two of its build pipeline. - [15:08](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=908s) SvelteKit's adapter architecture allows identical application code to target Node servers (`adapter-node`), flat static files (`adapter-static`), or serverless platforms (`adapter-netlify`). - [15:08](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=908s) Static generation in SvelteKit directly invokes Svelte's SSR compiler APIs in-process, eliminating Sapper's slow approach of spinning up a local server and executing a headless crawler. - [17:11](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=1031s) Hybrid rendering eliminates the binary choice between a full dynamic server and a pure static site by allowing per-route pre-rendering alongside live serverless endpoints. - [20:03](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=1203s) Svelte avoids mandatory lock-in by offering a batteries-included default in SvelteKit while actively supporting custom integration tools like Routify, Elder.js, and Eleventy. - [20:03](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=1203s) First-class TypeScript support is planned for SvelteKit's public release. - [22:06](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=1326s) An official Open Collective was established to provide financial backing for Svelte's ongoing maintenance, infrastructure, and contributor compensation.
## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=0s) Rethinking Svelte, the Sapper 1.0 Question, and SvelteKit
Rich Harris opens by admitting that he has not been this excited about Svelte since the launch of Svelte 3. While what he is presenting is still somewhat speculative—noting that the Svelte core team supports the effort, but there are no official guarantees about timelines or features—he feels compelled to share the work. His goals are to share his excitement, manage developer expectations regarding the project's roadmap, and advocate for broader architectural ideas in frontend development that he believes should enter the mainstream.
Addressing the community's persistent questions about the future of Sapper (the Svelte-based application framework providing server-side rendering, routing, and code-splitting), Harris reveals a long-awaited answer: “Sapper 1.0 is coming out... never.” Although Sapper enabled developers to build great apps, its internal architecture had become difficult to maintain over time. Implementing modern capabilities—such as targeting serverless environments or selectively pre-rendering subsets of an app into static files—proved challenging. Furthermore, newcomers were continually paralyzed by the initial choice between the standard Svelte template and Sapper. To solve this friction, the project needed to unify around a single, officially supported development path. As Harris puts it:
> “And so it'd be much better for everyone—users and also people giving support on Discord and Stack Overflow and places like that—if we could give you a single canonical answer: this is the officially supported way to build apps with Svelte.”
- Sapper was initially introduced back in 2017, and the frontend ecosystem shifted dramatically in the intervening years. - Recent maintenance and contributions from developers like Ben McCann significantly improved Sapper, but structural limitations in its codebase remained hard to overcome. - The new unified toolchain will provide a single canonical starting point for all Svelte applications.
---
[02:44](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=164s) Project Tour: Setting Up a SvelteKit App
Starting in an empty terminal directory, Harris scaffolds a brand-new project using the command `npm init svelte@next`, converts it into a Git repository, and installs its dependencies. He jokes about how rapid the initialization is compared to other frontend frameworks.
Exploring the newly created structure reveals a streamlined architecture: - `src/app.html`: A minimal HTML shell featuring injection points for Svelte to populate head tags and body markup. - `src/routes/`: The file-based routing directory, starting with an initial `index.svelte` page that imports a counter component via an alias path (`$components`). - `src/components/`: Directory housing shared UI modules like `Counter.svelte`. - `static/`: Plain static assets served untouched, including `favicon.ico` and `robots.txt`. - `package.json`: Configured with CLI scripts `svelte dev` and `svelte build`, powered by the new engine named `svelte-kit` (provisional naming). - `snowpack.config.js` and `svelte.config.js`: Rather than relying strictly on Rollup during local development, the setup is powered by Snowpack and introduces an "adapter" architecture configured in `svelte.config.js`.
---
[05:29](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=329s) Fast Development Server and Hot Module Reloading
Launching the server via `npm run dev -- --open` brings up localhost:3000 almost instantaneously. Modifying the markup within `Counter.svelte` shows sub-second updates in the browser without losing local component state. Clicking to increment the counter and subsequently modifying the font family (e.g., to "Chalkboard") or font size demonstrates that the state persists throughout code modifications.
Harris highlights that this state-preserving Hot Module Reloading (HMR) experience is largely thanks to the work of community member Rixo. Harris pushes the demo further by altering the click action directly from an increment to a decrement function on the fly, immediately allowing him to decrease the accumulated click counter without triggering a full page reset.
---
[06:54](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=414s) Routing, Layouts, and Hybrid Server/Client Navigation
Expanding beyond a single page, Harris constructs a shared navigation bar in `src/components/Nav.svelte` with links pointing to `/` (home) and an upcoming `/about` page. Adding this component to `index.svelte` immediately reveals the navigation links. Clicking the "About" link at first triggers an expected 404, which he resolves by adding a new route file at `src/routes/about/index.svelte`.
```mermaid flowchart TD accTitle: SvelteKit Layout Wrapping Model accDescr: Diagram showing how src/routes/__layout.svelte wraps individual page routes using default slot projection.
subgraph Shell["src/routes/__layout.svelte"] Nav["<Nav />"] MainOpen["<main>"] Slot["<slot /> (Page Insertion Point)"] MainClose["</main>"] Nav --> MainOpen MainOpen --> Slot Slot --> MainClose end
subgraph Pages["Route Components"] Home["src/routes/index.svelte"] About["src/routes/about/index.svelte"] end
Home -.->|"Renders inside"| Slot About -.->|"Renders inside"| Slot ```
To avoid copying boilerplate structure, markup, and styling between separate routes, Harris introduces `layout.svelte` inside the routes folder: 1. He ports global styles and container wrappers into `layout.svelte`. 2. A single `<slot />` tag is used to mark where child route content renders. 3. The individual `index.svelte` and `about/index.svelte` components are cleaned up to only contain their route-specific content, eliminating unused CSS warnings shown by the compiler.
When navigating between the home and about pages, the browser's reload icon remains stationary because the client-side router handles transitions instantly without requesting fresh full-page HTML. However, opening "View Source" shows that every page is completely rendered on the server during the initial load:
> “So you get the best of both worlds: you get a very fast startup with the static HTML, but then you get instant navigation client-side because the client-side router has kicked in.”
Harris demonstrates that compiling mistakes (such as leaving an HTML tag unclosed) immediately trigger a clean, detailed browser error overlay from Snowpack pointing out the exact problem file and line. Fixing the code causes the overlay to disappear instantly.
---
[10:35](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=635s) Why Unbundled Development Outperforms Traditional Bundlers
Harris steps back from the demo to explain why Snowpack maintains blazing speed regardless of whether a project has two pages or thousands of modules. For years, web development relied on bundlers such as Webpack, Rollup, and Parcel. Those tools operate by reading code, traversing every node in the module dependency tree, and concatenating them into bundled files to run in the browser. While essential when web browsers had no module loading capabilities, today's browsers natively support ECMAScript modules (`import`/`export`).
```mermaid flowchart LR accTitle: Traditional Bundlers vs Snowpack On-Demand Architecture accDescr: Compares full dependency tree bundling to Snowpack on-demand individual file transformation.
subgraph BundlerFlow["Traditional Bundler (Webpack / Rollup)"] direction TB B_Src["Source Modules (1000s)"] --> B_Graph["Trace Complete Graph"] B_Graph --> B_Bundle["Create Combined JS Bundle"] B_Bundle --> B_Browser["Browser Executes Entire Bundle"] end
subgraph SnowpackFlow["Snowpack Modern Architecture"] direction TB S_Req["Browser Native Import Request"] --> S_Transform["Compile Single Requested File"] S_Transform --> S_Out["Serve Individual ES Module"] end ```
Rather than building a monolithic bundle during development, modern unbundled tools like Snowpack transform files in isolation: - TypeScript is transformed directly to JavaScript. - `.svelte` components are transformed via the Svelte compiler into standard JavaScript modules without being stitched together. - The browser fetches dependent modules directly via native ES import statements. - Transformations are performed lazily and on-demand: files are only compiled when the browser actually requests them for the current view. - When an individual file is updated, only that isolated file undergoes re-transformation, avoiding the expensive cache-checking and rebundling cycles characteristic of traditional bundlers.
[12:22](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=742s) Unbundled Development and the Three-Phase Production Build
Rich Harris explains that unbundled tools like Snowpack fundamentally change the local development workflow because they avoid full-application bundling cycles. When an individual file is edited, Snowpack simply hands the new module to the browser, which fetches and swaps it in using Hot Module Replacement (HMR). Because transforming a single file in isolation is practically instantaneous, reload speeds outclass anything traditional bundlers can deliver. Rich takes a playful jab at the broader ecosystem, remarking: “I think we're going to get to a point pretty soon where projects that use bundlers during development are going to seem a little bit antiquated looking at you other frameworks.”
However, sending hundreds of separate ES modules across the network in production remains inefficient. Production deployments still require coarse-grained, code-split chunks. Before walking through this workflow in SvelteKit, Rich takes a moment to thank Fred Schott and the Snowpack team, calling Fred the genius behind the project and praising their productive collaboration in adapting Snowpack for server-side rendering frameworks.
Running `npm run build` in SvelteKit executes a distinct three-phase build pipeline:
```mermaid flowchart TD accTitle: SvelteKit Three-Phase Build Pipeline accDescr: Diagram showing the flow from source modules through Snowpack unoptimized build, Rollup optimization, to output adapters.
subgraph Phase1["Phase 1: Unoptimized Build"] A["Source Modules"] -->|"Snowpack 1:1 transforms"| B["Client Modules"] A -->|"Snowpack 1:1 transforms"| C["SSR Server Modules"] end
subgraph Phase2["Phase 2: Optimization"] B & C -->|"Bundle through Rollup"| D["Route Chunks & Shared Code"] D --> E["Manifest & CSS Assets"] end
subgraph Phase3["Phase 3: Generation"] E --> F{"Configured Adapter"} F -->|"adapter-node"| G["Node Server Build"] F -->|"adapter-static"| H["Static HTML Files"] F -->|"adapter-netlify / cloud"| I["Serverless Functions & Static CDN"] end ```
- **Phase 1 (Unoptimized Build):** Runs every module through Snowpack via direct one-to-one transformations, creating separate, unbundled client and server (SSR) versions of the application code. - **Phase 2 (Optimization):** Feeds that unbundled output into Rollup, which bundles the code into optimized chunks representing the routes, creates shared dependencies, manages CSS extraction, and generates an asset manifest. - **Phase 3 (App Generation via Adapters):** Handed off to a designated adapter defined in `svelte.config.js`.
[15:08](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=908s) Adapters and Faster Static Exporting
The target environment is governed by adapters. By default, SvelteKit uses `adapter-node`, which outputs a standalone Node server analogous to the legacy `sapper build`. However, if an application consists purely of static routes—such as a simple demo with an index route (`/`) and an about page (`/about`)—a running Node runtime is unnecessary. Rich switches the project configuration to `adapter-static`, installs the package, and reruns `npm run build` (after pausing with a laugh to actually save the edited config file so the build picks it up).
The adapter generates 200 HTTP responses for both `/` and `/about`, writing out plain HTML files (`index.html` with "hello world" and `about/index.html`). Rich contrasts this against the traditional `sapper export` process. Sapper previously had to compile a complete Node server, spin that server up locally, and run a web crawler against localhost to capture the generated pages. In contrast, SvelteKit invokes Svelte's internal SSR API directly in-process. Eliminating the server spinning and HTTP crawl makes static pre-rendering dramatically faster and capable of handling sites with massive volumes of content with minimal overhead.
- `adapter-node` mimics standard server deployments for dynamic Node hosting. - `adapter-static` produces flat files without requiring an intermediary server crawl. - Direct invocation of Svelte’s SSR compiler APIs replaces the older, sluggish headless crawling technique used by Sapper.
[17:11](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=1031s) Hybrid Rendering and Serverless-First Architecture
A longstanding dilemma in Sapper was the strict divide between dynamic hosting and full static generation: developers were forced to choose between running a dynamic Node server for everything or statically exporting the whole site. The dynamic approach wasted compute re-rendering pages that never changed, while static export failed completely if the site had dynamic data or authenticated, personalized views. SvelteKit solves this by supporting hybrid applications similar to modern versions of Next.js, allowing developers to mix dynamic server-rendered routes and pre-rendered static routes within the exact same app.
To showcase this, Rich demonstrates a Svelte implementation of Hacker News running locally. Top stories, new items, and comment pages fetch live data directly from `api.hnpwa.com` and must be dynamically rendered on demand. Conversely, the site’s About page is completely static. Because computers cannot reliably infer whether a route depends on changing state, developers supply an explicit cue: exporting `export const prerender = true;` from the page component. When `npm run build` executes, the compiler identifies this flag, pre-renders `/about` into `build/prerendered/about/index.html`, and leaves the remainder dynamic. When the production app starts, requests for `/about` serve raw static assets without touching the rendering engine.
Rich emphasizes that this hybrid model is tailor-made for cloud edge platforms:
> “When we launch this thing we'll have adapters for all of the major services the whole serverless thing it's a pretty good trend and Svelte is now a serverless first framework yay so this really just scratches the surface of what we can do in this new world.”
Using an adapter like `adapter-netlify`, SvelteKit automatically splits the production artifact, routing static files directly to the CDN and packaging dynamic routes into individual serverless functions.
[20:03](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=1203s) Project Scope, Framework Philosophy, and Ecosystem FAQs
Rich explores future possibilities opened up by the new project layout, such as using the exact same SvelteKit template structure to author and package standalone component libraries alongside full-fledged web applications. He then tackles anticipated community questions:
- **Migration from Sapper:** While not 100% automated, migrating will be straightforward because project layout and high-level routing concepts closely parallel Sapper. - **Workflow Mandates:** Developers are never locked into SvelteKit. Rich highlights the philosophical split in the frontend world: monolithic meta-frameworks like Angular and Ember that strive to own the entire developer workflow, versus component-only libraries like React and Vue that leave app-level tooling to ecosystem solutions like Next.js, Gatsby, or Remix. Svelte intentionally straddles both:
> “I want Svelte to be both of those you can be wildly productive with this app template in a matter of seconds but if you're a power user with specific needs that aren't met by this template for whatever reason then those needs will continue to be met by the Svelte project.”
- Custom integrations remain first-class citizens, preserving support for tools like Eleventy (11ty) plugins and dedicated Svelte-based application frameworks such as Routify and Elder.js. - **TypeScript Support:** Although not yet wired into the internal prototype repository, full first-class TypeScript support is guaranteed for the public launch. - **Contributing:** Development is currently progressing within a private repository while core architecture stabilizes. Community members are encouraged to follow discussions on the Svelte Discord (`svelte.dev/chat`) and updates via the `@sveltejs` and `@SvelteSociety` Twitter accounts.
[22:06](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=1326s) Funding Svelte on Open Collective
Rich closes the presentation by revisiting a recurring question from earlier in the year regarding financial contributions. While there was previously no official mechanism to donate money to Svelte, the team has now launched an official Open Collective page (`opencollective.com/svelte`).
Rich explains that while the exact long-term distribution of funds is still being determined, donations immediately help offset the infrastructure and operational costs of maintaining an open-source project of this scale. In the future, funds may allow the project to directly compensate contributors to build specific framework features. He extends deep gratitude to community members who discovered the Open Collective page and signed up as financial backers even before an official public announcement had been made, before humorously trying to figure out how to turn off his presentation recording.
## Notable quotes > [12:22](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=742s) I think we're going to get to a point pretty soon where projects that use bundlers during development are going to seem a little bit antiquated looking at you other frameworks. — Rich Harris
> [06:54](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=414s) So you get the best of both worlds: you get a very fast startup with the static HTML, but then you get instant navigation client-side because the client-side router has kicked in. — Rich Harris
> [00:00](https://www.youtube.com/watch?v=qSfdtmcZ4d0&t=0s) It'd be much better for everyone—users and also people giving support on Discord and Stack Overflow and places like that—if we could give you a single canonical answer: this is the officially supported way to build apps with Svelte. — Rich Harris
## Mentioned Rich Harris, Svelte, Svelte 3, Sapper, SvelteKit, Ben McCann, Rixo, Fred Schott, Snowpack, Rollup, Webpack, Parcel, Next.js, Gatsby, Remix, Angular, Ember, React, Vue, Eleventy (11ty), Routify, Elder.js, Netlify, Node.js, Open Collective, Discord, Stack Overflow, Hacker News
## Video description Edit from the future: check out our followup podcast interview on SvelteKit https://share.transistor.fm/s/859bbd95
--- This was recorded for Svelte Summit 2020: https://www.sveltesummit.com
The front end development landscape has been transformed since we started building Svelte and Sapper. What would a reimagined, truly modern workflow look like?
Open Collective: https://opencollective.com/svelte
[Source](https://www.youtube.com/watch?v=qSfdtmcZ4d0)