SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
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

Mais conteúdo relacionado

Semelhante a 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 | 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
 
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
 
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
 

Semelhante a 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 | 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...
 
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...
 
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
 

Mais de 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
 

Mais de 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
 

Último

eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 

Último (20)

eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 

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