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
バックエンドエンジニアが行うSvelte + Vite なフロントエンド構築
Search
shiro seike
PRO
November 19, 2022
Technology
1.8k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
バックエンドエンジニアが行うSvelte + Vite なフロントエンド構築
shiro seike
PRO
November 19, 2022
More Decks by shiro seike
See All by shiro seike
コミュニティの有益性 ~JAWS Days 2026 での体験を通して~ / The Benefits of a Community ~Through My Experience at JAWS Days 2026~
seike460
PRO
0
320
Architecture as SteeringOn-Ramp to AI-DLC
seike460
PRO
0
30
Why Continue AWS Community Builders
seike460
PRO
0
75
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
190
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
290
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
1.7k
今さら聞けないサーバーレスのいいところ 〜運用から解放される世界を目指して〜 / The Benefits of Serverless You Might Be Too Embarrassed to Ask About Now — Aiming for a World Free from Operational Burdens
seike460
PRO
0
110
AWS Lambda Durable Functions のユースケースを探る / Exploring Use Cases for AWS Lambda Durable Functions
seike460
PRO
0
97
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
540
Other Decks in Technology
See All in Technology
BPaaSで進むAIオペレーションの現在地 AI実装が効く領域とスケーラビリティの選定と実装
kentarofujii
0
260
AIに障害切り分けを全部やってもらった。 。 。 。
estie
0
340
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
220
攻撃者がいなくてもAIエージェントはインシデントを起こす
nomizone
0
190
AIに「使われる」時代のSaaS戦略 〜既存WebAPIのMCPサーバー化における開発ノウハウ〜
ekispert_api
0
270
そのタスクオンスケですか?
poropinai1966
0
120
Fabricをフル活用する AI Agent Hub -製造業特化AIエージェントの設計
iotcomjpadmin
0
190
Claude Codeとハーネスについて考えてみる
oikon48
14
6.2k
フルAIで個人開発して学んだあれこれ / yuruai vol.1
isaoshimizu
0
170
AI時代のエンジニアキャリアについて今一度考える
sakamoto_582
1
890
Kotlin 開発のツラミを爆破した話! / Explode the difficulty of Kotlin dev!
eller86
0
140
初めてのDatabricks勉強会
taka_aki
2
230
Featured
See All Featured
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
550
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Skip the Path - Find Your Career Trail
mkilby
1
160
Become a Pro
speakerdeck
PRO
31
6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
A Modern Web Designer's Workflow
chriscoyier
698
190k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Building Applications with DynamoDB
mza
96
7.1k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Transcript
バ ド ジ が Svelte + Vite ド 2022
2 0 22 . 11 . 19 @seike 4 60 1
@seike 460 - - @seike 46 0 - Fusic -
/ - / / - - PHP - PHP - PHPerKaigi - JAWS Days - AWS Dev Day 2
Agenda 1 .Svelte + Vite 2 .Svelte 3 .Svelte 4
.Vite 5 .Vite 6 . 3
01 Svelte + Vite
5
6
Svelte + Vite + Tailwind CSS 7
02 Svelte
Svelte JavaScript Vite Svelte Svelte Write less code No
virtual DOM DOM Truly reactive Hooks 9
Write less code - React 10 import React, { useState
} from 'react'; export default () => { const [a, setA] = useState( 1 ); const [b, setB] = useState( 2 ); function handleChangeA(event) { setA(+event.target.value); } function handleChangeB(event) { setB(+event.target.value); } return ( <div> <input type="number" value={a} onChange={handleChangeA}/> <input type="number" value={b} onChange={handleChangeB}/> <p>{a} + {b} = {a + b}</p> </div> ); }; UI React State Hook State State input State UI
Write less code - Svelte 11 <script> let a =
1 ; let b = 2 ; </script> <input type="number" bind:value={a}> <input type="number" bind:value={b}> <p>{a} + {b} = {a + b}</p> Svelte let State bind 築 [a] input p [a]
Write less code + Truly reactive 12 <script> let a
= 1 ; let b = 2 ; </script> <input type="number" bind:value={a}> <input type="number" bind:value={b}> <p>{a} + {b} = {a + b}</p> Svelte
TEMPLATE SYNTAX 13 {#if porridge.temperature > 1 00 } <p>too
hot!</p> {:else if 8 0 > porridge.temperature} <p>too cold!</p> {:else} <p>just right!</p> {/if} {#each items as item} <li>{item.name} x {item.qty}</li> {/each} {#await promise} <p>waiting for the promise to resolve...</p> {:then value} <p>The value is {value}</p> {:catch error} <p>Something went wrong: {error.message}</p> {/await} {#key value} <div transition:fade>{value}</div> {/key} {#if }... {:else if } {/if} {#each as name, index} ... {/each} {#await }... {:then name}... {:catch name} … {/await} {#key }... {/key}
Props Props export Props 14 Counter.svelte App.svelte
$: $: JS 15
Store 16
Store React Redux Vue Vuex Store writable Store
subscribe update set Store 17
Context API Svelte ContextAPI setContext getContext hasContext getAllContexts context
context 18 Counter.svelte App.svelte
Context API 19 Counter.svelte App.svelte
Component Hooks onMount DOM beforeUpdate state afterUpdate onDestroy tick state
resolve promise 20
No virtual DOM Virtual DOM Dom Virtual DOM
Svelte DOM 21
krausest React Vue Svelte 22 https://krausest.github.io/js-framework-benchmark/current.html
03 Svelte
👍 HTML CSS Javascript 🙏 $: 24
Made With Svelte Svelte Society Example 25
SvelteKit … 26
04 Vite
Vite HMR Rollup 28
ES Modules - Bundle - import export - ES
Modules - 29 https://vitejs.dev/guide/why.html#slow-server-start
vite.config.js Vite vite.config.js Production Staging loadEnv
.env Svelte Import.meta.env. prefix VITE_ 30 vite.config.js Svelte
05 Vite
👍 32
Svelte + Vite
34
06
36 Svelte UI Point 1 Example Point 2 Vite 頻
Point 3 Point 4
Thank You We are Hiring ! https://recruit.fusic.co.jp/