Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
What I learned from using Svelte for the demos
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Niklas Kiefer
March 17, 2020
Programming
230
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
What I learned from using Svelte for the demos
Modeling Lightning Talk ⚡️
Niklas Kiefer
March 17, 2020
More Decks by Niklas Kiefer
See All by Niklas Kiefer
Optimizing tidy: Practical Insights with the React Compiler
pinussilvestrus
0
14
a11y testing: tech talk
pinussilvestrus
0
11
Tech Talk: a11y testing at the HTO team
pinussilvestrus
0
55
a11y testing
pinussilvestrus
0
90
Taking Templates to the Limit
pinussilvestrus
0
64
What the $ref - Create composable JSON Schemas
pinussilvestrus
0
78
Automatic a11y testing with axe
pinussilvestrus
0
45
Roller coaster mining with Camunda Cloud
pinussilvestrus
0
25
How to break down
pinussilvestrus
0
66
Other Decks in Programming
See All in Programming
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
290
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
120
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.7k
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.4k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
160
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
110
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
360
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
11
5.9k
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
120
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
720
1B+ /day規模のログを管理する技術
broadleaf
0
100
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
KATA
mclloyd
PRO
35
15k
Speed Design
sergeychernyshev
33
1.9k
Rails Girls Zürich Keynote
gr2m
96
14k
It's Worth the Effort
3n
188
29k
Unsuck your backbone
ammeep
672
58k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
160
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Transcript
What I learned from using Svelte for the demos Modeling
Lightning Talk ⚡ Niklas Kiefer
2 Background: DRD Edit Demo
3 Background: DRD Edit Demo
4 New: Navigation + Table Layout Demo
5 New: Navigation + Table Layout Demo
6
7 Lessons Learned (1) Reactivity is - Part 1 <script>
export let view; export let activeView; </script> <div class="wrapper" style="display: {view === activeView ? 'block' : 'none'}"> {#if view === activeView} <slot/> {/if} </div>
8 Lessons Learned (2) Reactivity is - Part 2 <script>
export let tableData = {}; const HIT_POLICIES = [ /* ... */ ]; $: explanation = find( HIT_POLICIES, hp => hp.name === tableData.hitPolicy ).explanation; function changeHitPolicy(event) { const { target: { value } } = event; tableData.hitPolicy = value; } </script> <select on:change={changeHitPolicy}> {#each HIT_POLICIES as { name }} <option selected={name === tableData.hitPolicy}> {name} </option> {/each} </select> <p class="hp-explanation">{explanation}</p>
9 Lessons Learned (3) Component Templating <script> import Table from
'../../../decision-table-layout/src/components/Table.svelte'; import ArrowExpandSvg from '../../resources/arrow-expand.svg'; import './NavigationTable.scss'; const noop = () => {}; export let onViewSwitch = noop; export let tableData; </script> <div class="navigation-table"> <div class="buttons"> <span class="arrow-expand btn btn-sticky" on:click={() => onViewSwitch('split-screen')}> {@html ArrowExpandSvg} </span> <button class="edit-drd btn" on:click={() => onViewSwitch('drd')}> Edit DRD </button> </div> <Table { tableData } /> </div>
10 Lessons Learned (4) Global State <script> import data from
'../resources/data.js'; let currentTable = data['Decision_03absfl']; let view = 'drd'; </script> <Wrapper view="drd" activeView={view}> <DRD decision={currentTable.id} /> </Wrapper> <Wrapper view="split-screen" activeView={view}> <SplitScreen tableData={currentTable} /> </Wrapper>
11 Lessons Learned (5) Local Styles are equally good
12 Lessons Learned (6) Performance measures DRD Editing Demo Navigation
Demo
13 Summary Reactivity + State Management makes it way easier
to build quick demos with Svelte
Thank you