Is Svelte a good choice for widget implementation?

Hello! My name is Dmitry Usov, I am a front-end developer in Citimobil. Just a few months ago, the task was to create a widget for ordering a taxi through the site. In this article I would like to tell why Svelte was chosen for this task, to share my opinion about its advantages and disadvantages, as well as useful links, if you decide to study or apply this technology.


CitymobilSvelte


Initial data


Task: create a widget for ordering a taxi through the site.


, .


:


  1. :
    • . , .
  2. :
    • . .
    • DOM . .
    • , , .

β€” . React, Vue Angular .


ReactVueAngular
runtime (gzip + min)39,5 + 2,622.890, 1

, Preact Svelte.


:


  1. runtime.
  2. Stateofjs β€” , .

Stateofjs


PreactSvelte
runtime (gzip + min)3,81,4
78%88%
40%67%

Preact: React, .


Svelte:


  1. .
  2. , . Preact , React , .
  3. Mail.ru Svelte.

, Svelte.


Svelte


Svelte β€” . , React Vue, , Svelte , .

, Svelte.



.


Widget


, Svelte , . , , , .


β€” . β€” Svelte ( ).


: reverse proxy CORS. rollup, , , , hot reload, proxy, , . rollup webpack.


, , , .


, Svelte


, .


: , β€” . , , .



JS/HTML/CSS . Vue/React/Angular, , Svelte - .



  1. runtime (min+gzip) 1,4 .
  2. virtual DOM. Svelte , .
  3. .
  4. CSS. - CSS-, linter . , .


  1. .
  2. .
  3. .
  4. context stores, .
  5. Actions. AlexxNB, .
  6. , - . , JS-, CSS- , , JS .


  1. .
  2. , , , , Svelte.
  3. Telegram, 1500 .
  4. Discord (sapper, svelte, jobs, typescript, etc).

Svelte


, .


, : , β€” . , , .


Gitlab


Svelte Gitlab . . PaulMaly , gitattributes .


No syntax highlighting



Svelte , ErrorBoundary React. , , , , Sentry. JS .



.


Number of libraries



  1. , .
  2. , . Svelte . , , .
  3. Svelte β€” , , , , , . , .

vscode




, , , , , .


All Articles