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
Niklas Kiefer
March 17, 2020
Programming
1
190
What I learned from using Svelte for the demos
Modeling Lightning Talk ⚡️
Niklas Kiefer
March 17, 2020
Tweet
Share
More Decks by Niklas Kiefer
See All by Niklas Kiefer
Tech Talk: a11y testing at the HTO team
pinussilvestrus
0
7
a11y testing
pinussilvestrus
0
63
Taking Templates to the Limit
pinussilvestrus
0
28
What the $ref - Create composable JSON Schemas
pinussilvestrus
0
35
Automatic a11y testing with axe
pinussilvestrus
0
7
Roller coaster mining with Camunda Cloud
pinussilvestrus
0
9
How to break down
pinussilvestrus
0
12
Move from webpack to vite
pinussilvestrus
0
140
JSON Schema Validation @Camunda Modeler
pinussilvestrus
0
170
Other Decks in Programming
See All in Programming
Anthropic Cookbook のおすすめレシピ
schroneko
7
980
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
210
SIMD Parallel Programming with the Vector API
josepaumard
0
180
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
540
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
180
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
260
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
170
Compose-View Interop in Practice (mDevCamp 2024)
stewemetal
0
140
ONE WEDGE_company_guide
1wedge_one
0
490
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
2
770
dbtのドメイン分割による データ基盤の改善とDigdagとの連携
sakama
0
350
PHPはいつから死んでいるかの調査
chiroruxx
1
400
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
92
4.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
19
1.7k
Web development in the modern age
philhawksworth
202
10k
Visualization
eitanlees
136
14k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
A better future with KSS
kneath
231
16k
A Philosophy of Restraint
colly
197
16k
Code Reviewing Like a Champion
maltzj
514
39k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Why Our Code Smells
bkeepers
PRO
331
56k
The Pragmatic Product Professional
lauravandoore
25
5.8k
Ruby is Unlike a Banana
tanoku
96
10k
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