new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Svelte · SvelteKit · all subjects

introduction

16 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Svelte compiles components to JavaScript and CSS

Svelte is a way of writing user interface components. The Svelte compiler converts your components to JavaScript that can be run to render the HTML for the page and to CSS that styles the page.

SvelteKit is similar to Nuxt for Vue developers

For developers coming from Vue, SvelteKit is similar to Nuxt.

SvelteKit is similar to Next.js for React developers

SvelteKit is a framework for rapidly developing robust, performant web applications using Svelte. For developers coming from React, SvelteKit is similar to Next.js.

SvelteKit builds on Web APIs

SvelteKit is built on top of standard Web APIs rather than proprietary abstractions. This means existing web development skills are applicable to SvelteKit, and learning SvelteKit improves general web development abilities.

Web APIs available in SvelteKit environments

Standard Web APIs are available in all modern browsers and in many non-browser environments like Cloudflare Workers, Deno, and Vercel Functions. During development and in adapters for Node-based environments (including AWS Lambda), Web APIs are made available via polyfills where necessary.

$app/types module overview

The $app/types module contains generated types for the routes in your app. It has been available since version 2.26.

SvelteKit is the official framework for Svelte

SvelteKit is the officially supported framework for building applications with Svelte.

Sapper is an app framework built on Svelte

Sapper is an app framework (or metaframework) built on top of Svelte, which is a component framework. Sapper's job is to make it easy to build Svelte apps with modern best practices like server-side rendering (SSR) and code-splitting, and to provide a project structure for productive development.

SvelteKit is a rewrite and rebrand of Sapper

SvelteKit is essentially a rewrite of Sapper coupled with a rebrand. Sapper will never reach version 1.0; instead, it is being replaced by SvelteKit.

Sapper had two build modes

Sapper had two modes: 'sapper build', which creates a standalone app that runs on a Node server, and 'sapper export', which bakes the app out as a collection of static files suitable for hosting on services like GitHub Pages.

SvelteKit is a framework for building Svelte apps with SSR and routing

SvelteKit is a framework for building apps with Svelte, complete with server-side rendering, routing, code-splitting for JS and CSS, and adapters for different serverless platforms. It is comparable to Next.js for Svelte and is the successor to Sapper.

SvelteKit is the recommended framework for building Svelte apps

SvelteKit reached version 1.0 after two years in development and is now the recommended way to build Svelte apps of all shapes and sizes. It is designed as an application framework built on top of Svelte, a UI component framework, to answer structural and architectural questions that component frameworks alone leave unanswered.

SvelteKit 2.0 release and Vite 5 support

SvelteKit 2.0 is now available as an incremental release that adds support for Vite 5. Upgrading to SvelteKit 2 will smooth the path for Svelte 5 when it is released in 2024. Before upgrading to SvelteKit 2, it is recommended to first update to the most recent 1.x release along with Svelte 4 to address any deprecation warnings.

What are runes in Svelte

Runes are symbols with a $ prefix used in .svelte and .svelte.js/.svelte.ts files to control the Svelte compiler. They are part of Svelte syntax and function as keywords. Runes do not need to be imported, are not values that can be assigned to variables or passed as function arguments, and are only valid in certain positions in code, similar to JavaScript keywords.

Runes are a Svelte 5 feature

Runes did not exist prior to Svelte 5.

Rune syntax example

Runes have a $ prefix and look like function calls. For example: let message = $state('hello');

Give your agent this brain