Wikipedia

Svelte

Also found in: Dictionary.
Svelte
Svelte Logo.svg
Original author(s)Rich Harris
Initial releaseNovember 26, 2016[1]
Stable release
3.31.2 / January 4, 2021 (2021-01-04)[2]
RepositorySvelte Repository
Written inTypeScript
PlatformWeb platform
Size4.1 KB[3]
TypeWeb framework
LicenseMIT License
Websitesvelte.dev

Svelte is a free and open-source front end[4] JavaScript framework[5] created by Rich Harris and maintained by Harris and other Svelte core team members.[6] Svelte applications do not include framework references. Instead, building a Svelte application generates code to manipulate the DOM, which may reduce the size of transferred files as well as give better client startup and run-time performance. Svelte has its own compiler for converting app code into client-side JavaScript at build time. It is written in TypeScript.[7][8] The Svelte source code is licensed under MIT License and hosted on GitHub.[9]

History

The predecessor of Svelte is Ractive.js, which Rich Harris had developed earlier.

Version 1 of Svelte was written in JavaScript and was released in 29 November 2016.

Version 2 of Svelte was released in 19 April 2018.

Version 3 of Svelte is written in TypeScript and was released in 21 April 2019.

Example

Svelte applications and components are defined in .svelte files, which are HTML files extended with templating syntax that is similar to JSX. Svelte repurposes JavaScript's label syntax $: to mark reactive statements. Top-level variables become the component's state and exported variables become the properties that the component receives.

<script> let count = 1; $: doubled = count * 2; </script> <p>{count} * 2 = {doubled}</p> <button on:click={ => count = count + 1}>Count</button> 

Influence

Vue.js modelled its API and single-file components after Ractive.js, the predecessor of Svelte.

See also

References

  1. ^ "Frameworks without the framework: why didn't we think of this sooner?". Svelte.
  2. ^ "Svelte Releases". GitHub. January 8, 2021.
  3. ^ "Svelte@3.31.2". BundlePhobia. January 8, 2021.
  4. ^ https://en.wikipedia.org/wiki/Front_end_and_back_end
  5. ^ "React vs. Svelte, the JavaScript build-time framework". react-etc.net.
  6. ^ "Svelte 3 Front-End Framework Moves Reactivity into the JavaScript Language, Q&A with Rich Harris". InfoQ.
  7. ^ "8 Most Interesting JavaScript Frameworks to Learn in 2019 - Developer Drive". www.developerdrive.com.
  8. ^ Krill, Paul (December 2, 2016). "Slim, speedy Svelte framework puts JavaScript on a diet". InfoWorld.
  9. ^ "GitHub - sveltejs/svelte: Cybernetically enhanced web apps". January 11, 2020 – via GitHub.

External links

This article is copied from an article on Wikipedia® - the free encyclopedia created and edited by its online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of Wikipedia® encyclopedia articles provide accurate and timely information, please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.

Copyright © 2003-2025 Farlex, Inc Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.