Svelte 2 vs 3: Classic Cheat Sheet

Check out the deployed app!

See side-by-side examples of Svelte 2 vs Svelte 3.

This uses Prism code hightlighting with the file highlight plugin.

Inspired by YouMightNotNeedJQuery.

Running locally

This is a vanilla JavaScript application. You must serve the files locally in order for the JavaScript and CSS to load in the browser. For example:

npm install http-server -g
http-server .

Visit http://localhost:8080 to see the results. If you make changes, restart the server. You might have to clear the cache to see your changes. (In Chrome, open the dev tools, then right click on the browser's main refresh arrow and choose Empty Cache and Hard Reload, or configure your dev tools to not keep a cache in the first place.)

Contributing

Contributions are welcome! Simple examples can be added to this cheat sheet. Copy and paste a <section> block in index.html. Create the code sample files in the code directory, change the data tag of the <pre>, and you're done! Try to follow the same file naming scheme as is used elsewhere, and make sure to name any .html files

Deploying

This site is deployed to GitHub Pages automatically from the master branch.

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes