Skip to content

Instantly share code, notes, and snippets.

View travishorn's full-sized avatar
💡
Trying new ideas

Travis Horn travishorn

💡
Trying new ideas
View GitHub Profile
@travishorn
travishorn / svelte-5.mdc
Last active March 30, 2025 09:50
The LLMs that Cursor uses are not as familiar with the new syntax for Svelte 5, SvelteKit 2, or Tailwind CSS 4 as they are for each framework's older versions. These Cursor rules fill in those gaps. Place these files inside the `.cursor/rules` directory.
# Svelte 5
This project uses the newer Svelte 5 instead of the more common Svelte 4.
Version 5 comes with an overhauled syntax and reactivity system. While it may look different at first, you'll soon notice many similarities. This guide goes over the changes in detail and shows you how to upgrade. Along with it, we also provide information on _why_ we did these changes.
## Reactivity syntax changes
At the heart of Svelte 5 is the new runes API. Runes are basically compiler instructions that inform Svelte about reactivity. Syntactically, runes are functions starting with a dollar-sign.