WTF is Svelte?

Tomasz Łakomy
InstructorTomasz Łakomy
Share this video with your friends

Social Share Links

Send Tweet
Published 5 years ago
Updated 3 years ago

Svelte is a tool for building fast web applications.

In this lesson we're going to learn what is Svelte and what's the difference between Svelte and other frameworks such as React or Vue.

Instructor: [0:00] Svelte is a tool for building fast web applications. In that regard, it's a bit similar to frameworks such React and Vue, which also share the same goal of building fast web interfaces.

[0:09] There's one major difference. The difference is that Svelte converts your app to optimize JavaScript code at the build time rather than interpreting your application code at the run time. What that means is that if we have this Hello World header over here, after I switch the JS output, this is actually the code that is going to be run by our users.

[0:27] There's also going to be a CSS output if you're going to have any styles in our Svelte application. If I were to switch to a bit more complicated example, so this is a simple app that allows me to see my mouse position, and here we have the script object, here we have the styles, and this is the markup with the onMouseMove handle.

[0:45] Here in the JS output, we do can see optimized JavaScript code built by Svelte, so we can ship that to our users and also Svelte takes care of the performance.

[0:53] We, as Svelte developers, don't have to optimize so much for performance because all this work is being done by the compiler. If we have any styles in our Svelte application, we're going to get the CSS output as well. We've pre-generated class names. We don't have to worry about that either.

egghead
egghead
~ 9 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today