Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Svelte

From Wikipedia, the free encyclopedia
JavaScript framework
For a definition of the term "svelte", see the Wiktionary entrysvelte.
Svelte
Original authorRich Harris
DevelopersThe Svelte maintainers, and various contributors. IncludesRich Harris,Conduitry,Tan Li Hau,Ben McCann, andSimon Holthausen
Initial release26 November 2016; 9 years ago (26 November 2016)
Stable release
5.38.3[1] Edit this on Wikidata / 23 August 2025; 5 months ago (23 August 2025)
Written inJavaScript Edit this on Wikidata
PlatformWeb platform
TypeWeb framework
LicenseMIT License
WebsiteOfficial websiteEdit this at Wikidata
Repository

Svelte is afree and open-sourcecomponent-basedfront-endsoftware framework[2] andlanguage[3] created by Rich Harris and maintained by the Svelte core team.[4]

Svelte is not a monolithicJavaScript library imported by applications: instead, SveltecompilesHTML templates to specialized code that manipulates theDOM directly, which may reduce the size of transferred files and give better client performance.[5][6][7] Application code is also processed by the compiler, inserting calls to automatically recompute data[2] and re-render UI elements when the data they depend on is modified.[8] This also avoids the overhead associated with runtime intermediate representations, such asvirtual DOM,[9] unlike traditional frameworks (such asReact andVue) which carry out the bulk of their work at runtime,i.e. in the browser.[5][8][4][10][2][9]

The compiler itself is written inJavaScript.[11][10] Itssource code is licensed underMIT License and hosted onGitHub.[10] Among comparable frontend libraries, Svelte has one of the smallest bundle footprints at merely 2KB.[12]

History

[edit]

The predecessor of Svelte is Ractive.js, which Rich Harris created in 2013.[13]

Version 1 of Svelte was written inJavaScript and was released on 29 November 2016.[14] The name Svelte was chosen by Rich Harris and his coworkers atThe Guardian.[14]

Version 2 of Svelte was released on 19 April 2018. It set out to correct what the maintainers viewed as mistakes in the earlier version such as replacing double curly braces with single curly braces.[14]

Version 3 of Svelte was written inTypeScript and was released on 21 April 2019. It rethought reactivity by using the compiler to instrument assignments behind the scenes.[2]

The SvelteKit web framework was announced in October 2020 and entered beta in March 2021.[15][16] SvelteKit 1.0 was released in December 2022 after two years in development.[17]

Version 4 of Svelte was released on 22 June 2023. It was a maintenance release, smaller and faster than version 3.[18] A part of this release was an internal rewrite from TypeScript back to JavaScript, withJSDoc type annotations.[11] This was met with confusion from the developer community, which was addressed by the creator of Svelte, Rich Harris.[19][20]

Version 5 of Svelte was released on October 19, 2024 at Svelte Summit Fall 2024 with Rich Harris cutting the release live while joined by other Svelte maintainers. Svelte 5 was a ground-up rewrite of Svelte, changing core concepts such as reactivity and reusability.[21] Its primary feature,runes, reworked how reactive state is declared and used. Runes are function-like macros that are used to declare a reactive state, or code that uses reactive states. These runes are used by the compiler to indicate values that may change and are depended on by other states or the DOM.[22] Svelte 5 also introduces Snippets, which are reusable "snippets" of code that are defined once and can be reused anywhere else in the component.[23] Svelte 5 was initially met with controversy due to its many changes, and thus deprecations caused primarily by runes. However, most of this has subsided since the initial announcement of runes, and the further refining of Svelte 5.[citation needed]

Also at Svelte Summit Fall 2024, Ben McCann announced the SvelteCLI under the sv package name onnpm.[24]

In early 2025, the Svelte team announced Asynchronous Svelte, an experimental feature set centered around asynchronous reactivity in Svelte usingawait expressions.[25] As of August 2025, the feature is available via an experimental compiler option.[26] This coincided with the experimental release of remote functions, anRPC feature in SvelteKit, Svelte's metaframework.[27]

Key early contributors to Svelte became involved with Conduitry joining with the release of Svelte 1, Tan Li Hau joining in 2019, and Ben McCann joining in 2020.[14] Rich Harris and Simon Holthausen joinedVercel to work on Svelte fulltime in 2022.[28] Dominic Gannaway joined Vercel from the React core team to work on Svelte fulltime in 2023.[29]

Syntax

[edit]

Svelte applications and components are defined in.svelte files, which areHTML files extended with templating syntax that is based on JavaScript and is similar toJSX.

Svelte's core features are accessed through runes, which syntactically look like functions, but are used asmacros by the compiler. These runes include:

  • The$state rune, used for declaring areactive state value
  • The$derived rune, used for declaring reactive statederived from one or more states
  • The$effect rune, used for declaring code that reruns whenever its dependencies change

Starting withSvelte 5, the framework introduced a significant reactivity overhaul that replaces the previous `$:` reactive declarations with new runes such as$state,$derived, and$effect.[30] The$effect rune is now used for post-render operations without modifying state, while$derived is used for computations that depend on other reactive values. This change aims to simplify the mental model of reactivity and make component logic more explicit.[31]

Additionally, the{JavaScript code } syntax can be used for templating in HTML elements and components,[32] similar totemplate literals in JavaScript. This syntax can also be used in element attributes for uses such as two-waydata binding,event listeners, andCSS styling. ATodo List example made in Svelte is below:

<script>letvalue=$state();consttodos=$state([]);constall=$derived(todos.length);constdone=$derived(todos.filter(todo=>todo.done).length);functiononsubmit(e){e.preventDefault();todos.push({text:value,done:false});e.target.reset();}</script><span>Todo List</span><small>completed {done}/{all}</small><br/>{#each todos as { text, done }, index}<inputtype="checkbox"bind:checked={todos[index].done}id={text}/><labelfor={text}class:done>{text}</label><buttononclick={()=> todos.splice(index, 1)}>Remove</button><br/>{/each}<form{onsubmit}><br/><labelfor="input">Add todo</label><br/><inputtype="text"name="input"bind:value/></form><style>span{font-size:20px;font-weight:bold;}.done{text-decoration-line:line-through;}</style>

Associated projects

[edit]

SvelteKit
Initial release ()
Stable release
1.15.5[33][34] Edit this on Wikidata / 13 April 2023; 2 years ago (13 April 2023)
Written inJavaScript,TypeScript,Svelte Edit this on Wikidata
PlatformWeb platform
Typefull-stackweb framework
LicenseMIT License
Websitesvelte.dev/docs/kit
Repositoryhttps://github.com/sveltejs/kit Edit this on Wikidata

The Svelte maintainers created SvelteKit as the official way to build projects with Svelte. It is aNext.js/Nuxt-stylefull-stack framework that dramatically reduces the amount of code that gets sent to the browser. The maintainers had previously created Sapper, which was the predecessor of SvelteKit.[35]

The Svelte maintainers also maintain a number of integrations for popular software projects under the Svelte organization including integrations forVite, Rollup,Webpack, TypeScript,VS Code, Chrome Developer Tools,ESLint, and Prettier.[36] A number of external projects such as Storybook have also created integrations with Svelte and SvelteKit.

Influence

[edit]

Vue.js modeled its API and single-file components after Ractive.js, the predecessor of Svelte.[13]

Adoption

[edit]

Svelte is widely praised by developers. Taking the top ranking in multiple large scale developer surveys, it was chosen as theStack Overflow 2021 most loved web framework and 2020 State of JS frontend framework with the most satisfied developers.[37][38]

Recent surveys continue to show Svelte's strong developer satisfaction, with the 2024 State of JS survey maintaining its position among the most praised frontend frameworks.[39] The 2024 Stack Overflow Developer Survey reported that 73% of developers who used Svelte want to continue working with it, and noted that Stack Overflow's own team used Svelte for building their 2024 Developer Survey results site.[40]

Svelte has been adopted by a number of high-profile web companies includingThe New York Times,Google,Apple,Spotify,Radio France,[41]Square,Yahoo,ByteDance,Rakuten,Bloomberg,Reuters,Ikea,Facebook,Logitech, andBrave.[42][43][44]

A community group of primarily non-maintainers, known as the Svelte Society, run the Svelte Summit conference, write a Svelte newsletter, host a Svelte podcast, and host a directory of Svelte tooling, components, and templates.[45]

See also

[edit]

References

[edit]
  1. ^"svelte@5.38.3 - Github". 23 August 2025.
  2. ^abcdHarris, Rich (2019-04-22)."Svelte 3: Rethinking reactivity".svelte.dev. Retrieved2021-08-07.
  3. ^Harris, Rich (2018-11-26)."The truth about Svelte".GitHub Gist. Retrieved2022-12-21.
  4. ^abKrill, Paul (December 2, 2016)."Slim, speedy Svelte framework puts JavaScript on a diet".InfoWorld.
  5. ^ab"React vs. Svelte, the JavaScript build-time framework".react-etc.net. November 30, 2016. Archived fromthe original on July 10, 2017. RetrievedDecember 27, 2025.
  6. ^"8 Most Interesting JavaScript Frameworks to Learn in 2019". RetrievedDecember 27, 2025.
  7. ^Wang, Wenhao (September 12, 2025)."Understanding Virtual DOM and Why Svelte/SolidJS Opt Out". RetrievedDecember 27, 2025.
  8. ^ab"Svelte 3 Front-End Framework Moves Reactivity into the JavaScript Language, Q&A with Rich Harris".InfoQ.
  9. ^abHarris, Rich (2018-12-27)."Virtual DOM is pure overhead".svelte.dev.
  10. ^abc"GitHub - sveltejs/svelte: Cybernetically enhanced web apps". January 11, 2020 – via GitHub.
  11. ^ab"TS to JSDoc Conversion #8569".GitHub.com.
  12. ^Frontendeng.dev (2023-08-01)."Svelte vs React: Which framework is better?".frontendeng.dev.
  13. ^abŚwistak, Tomasz (2020-11-19)."About the Svelte JavaScript framework". Blog.ValueLogic. Archived fromthe original on 2022-03-27. Retrieved2021-06-10.By the way, Vue's syntax has been influenced by Ractive.js, a direct predecessor of Svelte.
  14. ^abcd"Svelte Origins: A JavaScript Documentary".YouTube. 21 June 2022. Retrieved2022-07-09.
  15. ^"Rich Harris: Futuristic Web Development".YouTube. 19 October 2020.Archived from the original on 2021-12-12. Retrieved2021-08-03.
  16. ^Harris, Rich (2021-03-23)."SvelteKit is in public beta".svelte.dev. Retrieved2021-08-03.
  17. ^"Accouncing SvelteKit 1.0". 2022-12-14. Retrieved2022-12-16.
  18. ^team, The Svelte (2023-06-22)."Announcing Svelte 4".svelte.dev. Retrieved2023-08-08.
  19. ^"TS to JSDoc Conversion".Hacker News (news.ycombinator.com). 2023-05-10.
  20. ^"Lordy, I did not expect an internal refactoring PR to end up #1 on Hacker News. ..."Hacker News (news.ycombinator.com). 2023-05-10.
  21. ^"Svelte 5 is alive".svelte.dev. 22 October 2024.
  22. ^"Introducing runes".svelte.dev. 20 September 2023.
  23. ^"{#snippet ...}". Docs.svelte.dev.
  24. ^McCann, Ben (2024-10-24)."Introducing the new Svelte CLI".svelte.dev. Retrieved2024-12-20.
  25. ^Harris, Rich (2025-04-28)."Asynchronous Svelte · sveltejs/svelte · Discussion #15845".GitHub.
  26. ^"await • Docs • Svelte". Retrieved2025-08-13.
  27. ^Holthausen, Simon (2025-06-17)."Remote Functions · sveltejs/kit · Discussion #13897".GitHub.
  28. ^Harris, Rich (Nov 11, 2021)."today is a big day for @sveltejs: i've joined @vercel to work on it full time!".Twitter. Retrieved2022-09-04.
  29. ^"trueadm/status/1640761270566633472".X (formerly Twitter). Retrieved2023-09-30.
  30. ^"Svelte 5 is Alive".Svelte.dev. 2023-11-16. Retrieved2025-10-20.
  31. ^"Migration to Svelte 5 — Reactivity Overhaul".Svar.dev. 2024-04-18. Retrieved2025-10-20.
  32. ^"Svelte tutorial page".svelte.dev. Retrieved2022-07-06.
  33. ^"@sveltejs/kitTypeScript icon, indicating that this package has built-in type declarations1.15.5".npmjs. Retrieved26 November 2024.
  34. ^"@sveltejs/kit@1.15.5".GitHub. Retrieved26 November 2024.
  35. ^Harris, Rich (December 31, 2017)."Sapper: Towards the ideal web app framework".svelte.dev. Retrieved2022-11-29.
  36. ^"Svelte".GitHub. Retrieved2021-08-03.
  37. ^"Stack Overflow Developer Survey 2021".Stack Overflow. Archived fromthe original on 2022-06-25. Retrieved2021-10-26.
  38. ^"State of JS 2020: Front-end Frameworks".2020.stateofjs.com. Retrieved2021-10-26.
  39. ^"State of JavaScript 2024: Front-end Frameworks".2024.stateofjs.com. Retrieved2025-06-28.
  40. ^"2024 Stack Overflow Developer Survey".Stack Overflow. Retrieved2025-06-28.
  41. ^"Radio France migrated their site to SvelteKit".reddit.com. 2 September 2021. Retrieved2024-06-04.
  42. ^"Svelte • Cybernetically enhanced web apps".svelte.dev. Retrieved2021-08-03.
  43. ^"Websites using Svelte - Wappalyzer".www.wappalyzer.com. Retrieved2021-08-03.
  44. ^"Your Profile, Your Home Experience".yourhome.fb.com. Retrieved2021-12-01.
  45. ^"Home - Svelte Society".sveltesociety.dev. Retrieved2021-08-03.

External links

[edit]
.NET
C++
ColdFusion
Common Lisp
Haskell
Java
JavaScript
Back end
Server-side
Full-stack
Front end
Client-side
Perl
PHP
Python
Ruby
Rust
Scala
Smalltalk
Other languages
Dialects
Engines
Frameworks
Client-side
Server-side
Multiple
  • Cappuccino
Libraries
People
Other
Retrieved from "https://en.wikipedia.org/w/index.php?title=Svelte&oldid=1329751503"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp