+4 votes
35 views
in Web development by (75.9k points)
reopened
Svelte: lightweight framework for developing fast web applications

1 Answer

+5 votes
by (503k points)
edited
 
Best answer

image

Svelte: lightweight framework for developing fast web applications

For a long time, the JavaScript programming language has been essential for creating compelling web content, but being able to use it means mastering it thoroughly, which not all developers have time for. However, today there are so-called frameworks or working environments, which provide developers with a framework in which even the most complex JavaScript functions can be executed automatically and which considerably reduces programming tasks . In return, most frameworks tend to overload the browser a lot. Faced with this, Svelte for JS proposes a radically new approach..

Index
  1. What is Svelte?
  2. What advantages does Svelte offer?
  3. How is Svelte different from other frameworks?
  4. SvelteJS architecture
  5. In which cases is Svelte more convenient?
  6. Should I install SvelteJS or try it online?
  7. Will Svelte become the universal standard for developing applications?

What is Svelte?

Svelte (or SvelteJS) is a framework for developing JavaScript applications. It provides the basic framework for the application to be developed, as well as important and recurring functions in the form of automatically integrated libraries. The framework defines the basic possibilities of the application by establishing a concrete framework and also influences the development process in a decisive way. Getting familiar with the frameworks designed for programming web applications does not take long, so these environments are easy to use .

Note

JavaScript, abbreviated as JS, is a scripting language that extends the capabilities of standard CSS and HTML languages ​​and is compatible with all current browsers. It is used to develop interactive pages and web applications. It should be noted that apart from the name and a few other features, JavaScript has nothing to do with the compiled Java language..

Svelte is an ideal tool for programming fast web applications and, in its fundamentals, it resembles other frameworks for Javascript, such as Angular, Vue, Ractive or React. Like all of them, Svelte is based on JavaScript and allows you to design interactive user interfaces. However, the generated code is much more agile than with traditional frameworks .

What advantages does Svelte offer?

The fundamental innovation of SvelteJS is that it allows you to convert complex framework code into simple and optimized JavaScript . Most of the previous frameworks leave it to the browser to interpret and display the application in JavaScript, so the process slows down. Instead, Svelte compiles the application into JavaScript code already during development. One of the goals of the creators of Svelte was to give developers the ability to compile the most agile and intelligent code possible without having to overload it by using the framework ..

How is Svelte different from other frameworks?

The same problem always occurs with conventional frameworks : instead of simplifying the JavaScript code to run quickly in the browser, it expands and makes JavaScript interpret all the functions of the framework, often also those that are not used. As a result, even relatively simple application code becomes bloated, consuming a lot of data and performance to run. Arguably the frameworks traditional help structure the ideas, but not the code . The problem is usually that they focus on execution in the browser and neglect the so-called Vanilla JavaScript, or the pure form of the code. This is the main difference that Svelte presents. Except for a few basic commands, which can be learned very quickly, Svelte uses pure HTML, CSS and JavaScript .

Done

CSS ( Cascading Style Sheets or cascading style sheets) is a simple language used to determine the visual appearance of HTML pages. While the HTML code only represents the content itself, modifying the CSS can change the layout of the page on different platforms and devices, for example.

During the build process, the application components are compiled into separate JavaScript modules . The developer can check the stability and execution of the compiled program at any time in a preview window. The advantage of this procedure is that the final script is extremely light and fast. In Svelte the code is not inflated, something that can hardly be avoided in traditional frameworks . The result is up to ten times faster performance compared to, for example, React, which has always been very popular.

SvelteJS architecture

Svelte for JS (JavaScript) consists of several components. Its special charm is that the developer hardly has to worry about the elements in CSS, which are often annoying and prone to errors . Simply define simple HTML or XML tags and let SvelteJS interpret them. SvelteJS creates the application components on its own. The HTML code is written in the interactive REPL window ( read-eval-print loop , or read-evaluate-print loop) in the browser. JavaScript interpretation is done immediately and automatically. Also, the stability of the code can be checked immediately.

In which cases is Svelte more convenient?

With its extremely simplified approach, Svelte allows you to extend a wide range of web applications. While with React almost the entire script has to be determined up front, Svelte allows extensions to be added later without any problems and without compromising the stability and performance of the application . In this way, Svelte is an ideal tool both for developing new applications and for increasing the performance of existing structures. The SvelteJS developers are primarily aimed at application programming beginners and offer introductory kits that can achieve results very quickly. Obviously, using SvelteJS also requires some prior knowledge, especially CSS and JavaScript. In any case, the lightweight structure of the Svelte framework makes it easy for inexperienced people to find their way into the field of programming.

Should I install SvelteJS or try it online?

To run SvelteJS locally on your own system, you must install Node.js. When you have it, you can install SvelteJS from the GitHub repository.

  git clone https://github.com/sveltejs/svelte.git cd svelte npm install  

The SvelteJS environment runs on a local web server, at "http: // localhost: 5000". Svelte's online test page is a good introduction to SvelteJS and does not require installing the program package. Provides sample scripts for all major components, which can be interactively modified and tested using the original REPL window. Therefore, it allows you to test SvelteJS and get an idea if the framework may be suitable to implement your application and in what way.

Will Svelte become the universal standard for developing applications?

With its extremely low data volume, SvelteJS allows you to develop more powerful and faster applications than traditional frameworks . However, Svelte is not yet sufficiently developed and its community is still small . SvelteJS promises better access, easier learning, and faster results. So far, these promises appear to have been kept. If Svelte proves to be more effective than Vue, Ractive or React, it will soon replace them and become the new universal standard for mobile web application development .


...