SlideShare a Scribd company logo
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1
SVELTE
Attractively thin, graceful
and stylish
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 2
Hello y’all!
Bartosz Magier
Senior Front End Developer @ TSH
bartosz.magier@tsh.io
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 3
Agenda
➡ Introduction to Svelte
➡ Live coding
➡ A little bit about TypeRunner.js
➡ Q&A
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 4
What is Svelte?
➡ It's a JavaScript Framework
➡ Svelte is a compiler, not a dependency like React or Vue
➡ Svelte seems to need less code for the same things that with React
require 40% more LOC (source: Rich Harris)
➡ Svelte has no virtual DOM, compiles to minimal “vanilla” JavaScript
and seems more performing than other libraries
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
Javascript
Framework
5
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 6
Here are compiled files
Development folder
Our main component
Entrypoint file
Config for Rollup
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 7
{
  "name": "svelte-app",
  "version": "1.0.0",
  "devDependencies": {
    "npm-run-all": "^4.1.5",
    "rollup": "^1.12.0",
    "rollup-plugin-commonjs": "^10.0.0",
    "rollup-plugin-livereload": "^1.0.0",
    "rollup-plugin-node-resolve": "^5.2.0",
    "rollup-plugin-svelte": "^5.0.3",
    "rollup-plugin-terser": "^4.0.4",
    "svelte": "^3.0.0"
  },
  "dependencies": {
    "sirv-cli": "^0.4.4"
  },
  "scripts": {
    "build": "rollup -c",
    "autobuild": "rollup -c -w",
    "dev": "run-p start:dev autobuild",
    "start": "sirv public #--single",
    "start:dev": "sirv public #--single #--dev"
  }
}
Everything is declared
under devDependencies
Including Svelte
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
Compiler
8
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 9
React
➡ Bundles up and minifies
your files
➡ Adds react and react-dom
to the bundle
➡ Produces one file or multiple
chunks
Svelte
➡ Compiles your components,
so they can run
independently
➡ Includes only parts of the
framework that are used
➡ It's your app that Svelte has
taught how to run
independently
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
Real DOM
1 0
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 1
element div
className app
children
element h1
children
text Hello world!
element input
value world
element button
text Clicks: 0
Hello world!
Clicks: 0world
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 2
element div
className app
children
element h1
children
text Hello world!
element input
value world
element button
text Clicks: 0 Clicks: 1
Hello world!
Clicks: 1world
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 3
<button on:click={handleClick}>
  Clicks: {count}
#</button>
if (changed.count) {
  text.data = `Clicks: ${current.count}`;
}
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 4
Basic reactivity
<script>
  let count = 0;
#</script>
<button on:click={() #=> count#++}>
  Clicks: {count}
#</button>
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 5
Arrays reactivity
<script>
  let feature = "";
  let features = [
"Fast", 
"Real DOM"
];
  
  function addFeature() {
-   features.push(feature);
+ features = [##...features, feature];
  }
#</script>
<input bind:value={feature} #/>
<button on:click={addFeature}>
  Add Feature
#</button>
<ul>
  {#each features as feature}
    <li>{feature}#</li>
  {/each}
#</ul>
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 6
Await/then/catch in template
{#await posts}
  <p>Loading##...#</p>
{:then payload}
  <Posts items={payload.data} #/>
{:catch error}
  <p style="color:red">{error.message}#</p>
{/await}
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 7
Example code
➡ https://svelte.dev/repl/c2ad67c64b5249a497301575cf8b1ace
➡ https://svelte.dev/repl/50003faab13f4124a2bb45d14fd3f1a5
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
Use Cases
1 8
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
TypeRunner.js
1 9
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
Let's play
2 0
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 2 1
Architecture
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
Let's see some code
2 2
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
Svelte Ecosystem
2 3
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
Sapper
2 4
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
Svelte Native
2 5
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 2 6
Svelte GL
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9
In summary
2 7
S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 2 8
Any questions?
Thank you

More Related Content

Similar to Svelte (adjective): Attractively thin, graceful, and stylish

php[world] 2016 - You Don’t Need Node.js - Async Programming in PHP
php[world] 2016 - You Don’t Need Node.js - Async Programming in PHPphp[world] 2016 - You Don’t Need Node.js - Async Programming in PHP
php[world] 2016 - You Don’t Need Node.js - Async Programming in PHPAdam Englander
 
Angular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedAngular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedIlia Idakiev
 
Apache Spark: the next big thing? - StampedeCon 2014
Apache Spark: the next big thing? - StampedeCon 2014Apache Spark: the next big thing? - StampedeCon 2014
Apache Spark: the next big thing? - StampedeCon 2014StampedeCon
 
Consistency, Availability, Partition: Make Your Choice
Consistency, Availability, Partition: Make Your ChoiceConsistency, Availability, Partition: Make Your Choice
Consistency, Availability, Partition: Make Your ChoiceAndrea Giuliano
 
19. stretnutie komunity kubernetes
19. stretnutie komunity kubernetes19. stretnutie komunity kubernetes
19. stretnutie komunity kubernetesJuraj Hantak
 
Meteor - not just for rockstars
Meteor - not just for rockstarsMeteor - not just for rockstars
Meteor - not just for rockstarsStephan Hochhaus
 
MongoDB Europe 2016 - Using MongoDB to Build a Fast and Scalable Content Repo...
MongoDB Europe 2016 - Using MongoDB to Build a Fast and Scalable Content Repo...MongoDB Europe 2016 - Using MongoDB to Build a Fast and Scalable Content Repo...
MongoDB Europe 2016 - Using MongoDB to Build a Fast and Scalable Content Repo...MongoDB
 
Zend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPZend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPAdam Englander
 
Jenkins Docker
Jenkins DockerJenkins Docker
Jenkins DockerAlex Soto
 
OSDC 2017 - Sebastian Saemann - Developing a saa s platform based on open sou...
OSDC 2017 - Sebastian Saemann - Developing a saa s platform based on open sou...OSDC 2017 - Sebastian Saemann - Developing a saa s platform based on open sou...
OSDC 2017 - Sebastian Saemann - Developing a saa s platform based on open sou...NETWAYS
 
OSDC 2017 | Developing a SaaS platform based on Open Source Software by Sebas...
OSDC 2017 | Developing a SaaS platform based on Open Source Software by Sebas...OSDC 2017 | Developing a SaaS platform based on Open Source Software by Sebas...
OSDC 2017 | Developing a SaaS platform based on Open Source Software by Sebas...NETWAYS
 
Puppet Camp Sydney 2014 - Evolving Design Patterns in AWS
Puppet Camp Sydney 2014 - Evolving Design Patterns in AWSPuppet Camp Sydney 2014 - Evolving Design Patterns in AWS
Puppet Camp Sydney 2014 - Evolving Design Patterns in AWSjohnpainter_id_au
 
Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 DISID
 
Continuous Delivery As Code
Continuous Delivery As CodeContinuous Delivery As Code
Continuous Delivery As CodeAlex Soto
 
MOUG17: Visualizing Air Traffic with Oracle APEX and Raspberry PI
MOUG17: Visualizing Air Traffic with Oracle APEX and Raspberry PIMOUG17: Visualizing Air Traffic with Oracle APEX and Raspberry PI
MOUG17: Visualizing Air Traffic with Oracle APEX and Raspberry PIMonica Li
 
An Introduction to React -- FED Date -- IBM Design
An Introduction to React -- FED Date -- IBM DesignAn Introduction to React -- FED Date -- IBM Design
An Introduction to React -- FED Date -- IBM DesignJosh Black
 
Developing Apps With React Native
Developing Apps With React NativeDeveloping Apps With React Native
Developing Apps With React NativeAlvaro Viebrantz
 

Similar to Svelte (adjective): Attractively thin, graceful, and stylish (20)

php[world] 2016 - You Don’t Need Node.js - Async Programming in PHP
php[world] 2016 - You Don’t Need Node.js - Async Programming in PHPphp[world] 2016 - You Don’t Need Node.js - Async Programming in PHP
php[world] 2016 - You Don’t Need Node.js - Async Programming in PHP
 
Angular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedAngular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of Speed
 
Meteor WWNRW Intro
Meteor WWNRW IntroMeteor WWNRW Intro
Meteor WWNRW Intro
 
Apache Spark: the next big thing? - StampedeCon 2014
Apache Spark: the next big thing? - StampedeCon 2014Apache Spark: the next big thing? - StampedeCon 2014
Apache Spark: the next big thing? - StampedeCon 2014
 
Consistency, Availability, Partition: Make Your Choice
Consistency, Availability, Partition: Make Your ChoiceConsistency, Availability, Partition: Make Your Choice
Consistency, Availability, Partition: Make Your Choice
 
Jenkins 20
Jenkins 20Jenkins 20
Jenkins 20
 
19. stretnutie komunity kubernetes
19. stretnutie komunity kubernetes19. stretnutie komunity kubernetes
19. stretnutie komunity kubernetes
 
Meteor - not just for rockstars
Meteor - not just for rockstarsMeteor - not just for rockstars
Meteor - not just for rockstars
 
MongoDB Europe 2016 - Using MongoDB to Build a Fast and Scalable Content Repo...
MongoDB Europe 2016 - Using MongoDB to Build a Fast and Scalable Content Repo...MongoDB Europe 2016 - Using MongoDB to Build a Fast and Scalable Content Repo...
MongoDB Europe 2016 - Using MongoDB to Build a Fast and Scalable Content Repo...
 
Zend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPZend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHP
 
Jenkins Docker
Jenkins DockerJenkins Docker
Jenkins Docker
 
OSDC 2017 - Sebastian Saemann - Developing a saa s platform based on open sou...
OSDC 2017 - Sebastian Saemann - Developing a saa s platform based on open sou...OSDC 2017 - Sebastian Saemann - Developing a saa s platform based on open sou...
OSDC 2017 - Sebastian Saemann - Developing a saa s platform based on open sou...
 
OSDC 2017 | Developing a SaaS platform based on Open Source Software by Sebas...
OSDC 2017 | Developing a SaaS platform based on Open Source Software by Sebas...OSDC 2017 | Developing a SaaS platform based on Open Source Software by Sebas...
OSDC 2017 | Developing a SaaS platform based on Open Source Software by Sebas...
 
Puppet Camp Sydney 2014 - Evolving Design Patterns in AWS
Puppet Camp Sydney 2014 - Evolving Design Patterns in AWSPuppet Camp Sydney 2014 - Evolving Design Patterns in AWS
Puppet Camp Sydney 2014 - Evolving Design Patterns in AWS
 
Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016
 
Continuous Delivery As Code
Continuous Delivery As CodeContinuous Delivery As Code
Continuous Delivery As Code
 
MOUG17: Visualizing Air Traffic with Oracle APEX and Raspberry PI
MOUG17: Visualizing Air Traffic with Oracle APEX and Raspberry PIMOUG17: Visualizing Air Traffic with Oracle APEX and Raspberry PI
MOUG17: Visualizing Air Traffic with Oracle APEX and Raspberry PI
 
An Introduction to React -- FED Date -- IBM Design
An Introduction to React -- FED Date -- IBM DesignAn Introduction to React -- FED Date -- IBM Design
An Introduction to React -- FED Date -- IBM Design
 
New Android Languages
New Android LanguagesNew Android Languages
New Android Languages
 
Developing Apps With React Native
Developing Apps With React NativeDeveloping Apps With React Native
Developing Apps With React Native
 

More from The Software House

Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...The Software House
 
Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?The Software House
 
O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?The Software House
 
Chat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon ChimeChat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon ChimeThe Software House
 
Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?The Software House
 
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWSAnaliza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWSThe Software House
 
Feature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScriptFeature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScriptThe Software House
 
Typowanie nominalne w TypeScript
Typowanie nominalne w TypeScriptTypowanie nominalne w TypeScript
Typowanie nominalne w TypeScriptThe Software House
 
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQLAutomatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQLThe Software House
 
Serverless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychServerless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychThe Software House
 
Testy API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięciTesty API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięciThe Software House
 
Jak skutecznie read model. Case study
Jak skutecznie read model. Case studyJak skutecznie read model. Case study
Jak skutecznie read model. Case studyThe Software House
 
Firestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny KrzemowejFirestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny KrzemowejThe Software House
 
Jak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzachJak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzachThe Software House
 
O łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsO łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsThe Software House
 
Amazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurzeAmazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurzeThe Software House
 
Od Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki koduOd Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki koduThe Software House
 

More from The Software House (20)

Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
 
Uszanowanko Podsumowanko
Uszanowanko PodsumowankoUszanowanko Podsumowanko
Uszanowanko Podsumowanko
 
Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?
 
O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?
 
Chat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon ChimeChat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon Chime
 
Migracje danych serverless
Migracje danych serverlessMigracje danych serverless
Migracje danych serverless
 
Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?
 
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWSAnaliza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
 
Feature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScriptFeature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScript
 
Typowanie nominalne w TypeScript
Typowanie nominalne w TypeScriptTypowanie nominalne w TypeScript
Typowanie nominalne w TypeScript
 
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQLAutomatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
 
Serverless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychServerless Compose vs hurtownia danych
Serverless Compose vs hurtownia danych
 
Testy API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięciTesty API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięci
 
Jak skutecznie read model. Case study
Jak skutecznie read model. Case studyJak skutecznie read model. Case study
Jak skutecznie read model. Case study
 
Firestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny KrzemowejFirestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny Krzemowej
 
Jak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzachJak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzach
 
Jak poskromić AWS?
Jak poskromić AWS?Jak poskromić AWS?
Jak poskromić AWS?
 
O łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsO łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.js
 
Amazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurzeAmazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurze
 
Od Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki koduOd Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki kodu
 

Recently uploaded

Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareinfo611746
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAlluxio, Inc.
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Krakówbim.edu.pl
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownloadvrstrong314
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...rajkumar669520
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion Clinic
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEJelle | Nordend
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisNeo4j
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfOrtus Solutions, Corp
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1KnowledgeSeed
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessWSO2
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfkalichargn70th171
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfMeon Technology
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAlluxio, Inc.
 

Recently uploaded (20)

Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdf
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 

Svelte (adjective): Attractively thin, graceful, and stylish

  • 1. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 SVELTE Attractively thin, graceful and stylish
  • 2. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 2 Hello y’all! Bartosz Magier Senior Front End Developer @ TSH bartosz.magier@tsh.io
  • 3. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 3 Agenda ➡ Introduction to Svelte ➡ Live coding ➡ A little bit about TypeRunner.js ➡ Q&A
  • 4. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 4 What is Svelte? ➡ It's a JavaScript Framework ➡ Svelte is a compiler, not a dependency like React or Vue ➡ Svelte seems to need less code for the same things that with React require 40% more LOC (source: Rich Harris) ➡ Svelte has no virtual DOM, compiles to minimal “vanilla” JavaScript and seems more performing than other libraries
  • 5. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 Javascript Framework 5
  • 6. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 6 Here are compiled files Development folder Our main component Entrypoint file Config for Rollup
  • 7. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 7 {   "name": "svelte-app",   "version": "1.0.0",   "devDependencies": {     "npm-run-all": "^4.1.5",     "rollup": "^1.12.0",     "rollup-plugin-commonjs": "^10.0.0",     "rollup-plugin-livereload": "^1.0.0",     "rollup-plugin-node-resolve": "^5.2.0",     "rollup-plugin-svelte": "^5.0.3",     "rollup-plugin-terser": "^4.0.4",     "svelte": "^3.0.0"   },   "dependencies": {     "sirv-cli": "^0.4.4"   },   "scripts": {     "build": "rollup -c",     "autobuild": "rollup -c -w",     "dev": "run-p start:dev autobuild",     "start": "sirv public #--single",     "start:dev": "sirv public #--single #--dev"   } } Everything is declared under devDependencies Including Svelte
  • 8. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 Compiler 8
  • 9. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 9 React ➡ Bundles up and minifies your files ➡ Adds react and react-dom to the bundle ➡ Produces one file or multiple chunks Svelte ➡ Compiles your components, so they can run independently ➡ Includes only parts of the framework that are used ➡ It's your app that Svelte has taught how to run independently
  • 10. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 Real DOM 1 0
  • 11. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 1 element div className app children element h1 children text Hello world! element input value world element button text Clicks: 0 Hello world! Clicks: 0world
  • 12. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 2 element div className app children element h1 children text Hello world! element input value world element button text Clicks: 0 Clicks: 1 Hello world! Clicks: 1world
  • 13. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 3 <button on:click={handleClick}>   Clicks: {count} #</button> if (changed.count) {   text.data = `Clicks: ${current.count}`; }
  • 14. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 4 Basic reactivity <script>   let count = 0; #</script> <button on:click={() #=> count#++}>   Clicks: {count} #</button>
  • 15. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 5 Arrays reactivity <script>   let feature = "";   let features = [ "Fast",  "Real DOM" ];      function addFeature() { -   features.push(feature); + features = [##...features, feature];   } #</script> <input bind:value={feature} #/> <button on:click={addFeature}>   Add Feature #</button> <ul>   {#each features as feature}     <li>{feature}#</li>   {/each} #</ul>
  • 16. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 6 Await/then/catch in template {#await posts}   <p>Loading##...#</p> {:then payload}   <Posts items={payload.data} #/> {:catch error}   <p style="color:red">{error.message}#</p> {/await}
  • 17. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 1 7 Example code ➡ https://svelte.dev/repl/c2ad67c64b5249a497301575cf8b1ace ➡ https://svelte.dev/repl/50003faab13f4124a2bb45d14fd3f1a5
  • 18. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 Use Cases 1 8
  • 19. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 TypeRunner.js 1 9
  • 20. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 Let's play 2 0
  • 21. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 2 1 Architecture
  • 22. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 Let's see some code 2 2
  • 23. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 Svelte Ecosystem 2 3
  • 24. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 Sapper 2 4
  • 25. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 Svelte Native 2 5
  • 26. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 2 6 Svelte GL
  • 27. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 In summary 2 7
  • 28. S V E L T E — U S Z A N O W A N K O P R O G R A M O W A N K O 2 0 1 9 2 8 Any questions? Thank you