Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RiotJS + CSS #meguroes
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
mizuki_r
April 19, 2016
Technology
750
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RiotJS + CSS #meguroes
Meguro.es #3 でのトーク内容です
mizuki_r
April 19, 2016
More Decks by mizuki_r
See All by mizuki_r
FrontendUp_新規事業で_Remixを採用した理由と対策.pdf
rymizuki
0
260
税理士ドットコムの 技術的挑戦 #tapioca_lt
rymizuki
0
320
PHPを始めて1年、レガシーシステムにどう向き合っているか #phpstudy
rymizuki
1
860
モダンとレガシー #gotandaem
rymizuki
0
600
Vuexに型を付けるパターンを調べた #gotandajs
rymizuki
0
160
DockerでNodeの開発は厳しいのか? #gotandajs
rymizuki
3
430
マネージャー!きみは何者だ! #gotandaem
rymizuki
0
1.9k
物語を楽しむための物語論
rymizuki
0
570
失敗と向き合う
rymizuki
0
1.6k
Other Decks in Technology
See All in Technology
え、こんなに早く改修できるの?──新人エンジニアとスクラムマスターの2人が語る、AI×アジャイル開発の現場
ysasago
2
460
Goodbye ShellScript, Hello File-based App
shunsock
0
260
LLMに渡さなかった仕事
nanaism
0
870
GoのInterface内部構造から学ぶ!最高パフォーマンスを出すコード設計
yappli_developers
0
160
What the customer really needed
kawaguti
PRO
3
210
データ_AIの事業の勝敗をわけるもの
nek0128
1
460
エージェントはローカル、検証はMicroVM — Lambda MicroVMsでつくるServerless CI
fujioka6789
3
360
事業課題から技術的負債に向き合う
sansantech
PRO
2
2k
積み重なった技術負債への挑戦 〜初手としての全社ゴト化〜
techtekt
PRO
0
1.3k
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
710
Azure Serverless 2026:Production-ready な AI エージェント基盤 / Azure Serverless 2026: Production-Ready AI Agent Platform
miyake
2
240
EventBridge に「合流」はない ― サーバーレスのワークフローを育てるということ / No Join in EventBridge
yusukeshimizu
2
160
Featured
See All Featured
Are puppies a ranking factor?
jonoalderson
2
3.9k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
350
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
Ruling the World: When Life Gets Gamed
codingconduct
0
340
Utilizing Notion as your number one productivity tool
mfonobong
4
590
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
500
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
Deep Space Network (abreviated)
tonyrice
0
310
The browser strikes back
jonoalderson
0
1.7k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
Designing for Timeless Needs
cassininazir
1
480
Transcript
RiotJSͱCSS 2016/04/19 Meguro.es #3 @mizuki_r
PROFILE @mizuki_r 5XJUUFS!NJ[VLJ@S (JUIVCSZ@NJ[VLJ OQNNJ[VLJ@S "OHVMBS 3JPU+4·ΘΓͷ͍ख (PUBOEB+4͔Β͖ͬͯ·ͨ͠ 2
AGENDA ▸ RiotJSͱ ▸ RiotJS + CSS ▸ RiotJS +
CSS + Webpack ▸ Conclusion
RIOTJSͱ INTRODUCTION
RIOTJSͱ A React-like user interface micro-library ▸ ReactͬΆ͍খ͞ͳUIϥΠϒϥϦ ▸ React͕38.56KBͰRiot͕8.61KBʢhttp://riotjs.com/ja/
▸ API͕গͳ͘ɺֶशίετ͕͍ ▸ ඞཁ࠷ݶͷػೳͷΈͰߏ͞ΕͨɺϛχϚϜελʔτΞο ϓͳײ͡ͷϥΠϒϥϦ
<todo> <!-- layout --> <h3>{ opts.title }</h3> <ul> <li each={
item, i in items }>{ item }</li> </ul> <form onsubmit={ add }> <input> <button>Add #{ items.length + 1 }</button> </form> <!-- logic --> <script> this.items = [] add(e) { var input = e.target[0] this.items.push(input.value) input.value = '' } </script> <todo>
<todo> <!-- layout --> <h3>{ opts.title }</h3> <ul> <li each={
item, i in items }>{ item }</li> </ul> <form onsubmit={ add }> <input> <button>Add #{ items.length + 1 }</button> </form> <!-- logic --> <script> this.items = [] add(e) { var input = e.target[0] this.items.push(input.value) input.value = '' } </script> <todo> ίϯϙʔωϯτΛఆٛ
<todo> <!-- layout --> <h3>{ opts.title }</h3> <ul> <li each={
item, i in items }>{ item }</li> </ul> <form onsubmit={ add }> <input> <button>Add #{ items.length + 1 }</button> </form> <!-- logic --> <script> this.items = [] add(e) { var input = e.target[0] this.items.push(input.value) input.value = '' } </script> <todo> DOMͷఆٛ
<todo> <!-- layout --> <h3>{ opts.title }</h3> <ul> <li each={
item, i in items }>{ item }</li> </ul> <form onsubmit={ add }> <input> <button>Add #{ items.length + 1 }</button> </form> <!-- logic --> <script> this.items = [] add(e) { var input = e.target[0] this.items.push(input.value) input.value = '' } </script> <todo> ৼΔ͍ͷఆٛ
RIOTJSͱ ؆୯ʹ͑Δখ͞ͳϥΠϒϥϦ ▸ JavaScript in HTML ▸ গͳ͍API ▸ lifecycle
(mount, update, updated, unmount) ▸ update ▸ yield ▸ dom events
RIOTJSͱ ·ͱΊ ▸ খͯ͘͞खૣ࢝͘ΊΒΕΔϛχϚϜͳUIϥΠϒϥϦ
RIOTJS+CSS RIOTJSʹ͓͚ΔCSSͷར༻ํ๏
RIOTJS + CSS CSSͷهड़ ▸ λάͷதʹ `<style>` Λهड़͢Δ ▸ `<style>`
ͷதʹCSSΛهड़͢Δ
RIOTJS + CSS CSSͷهड़ <todo> <!-- layout --> <h3>{ opts.title
}</h3> <style> todo { display: block } todo h3 { font-size: 120% } </style> <todo>
RIOTJS + CSS Scoped CSSͷهड़ ▸ λάͷதʹ `<style scoped>` Λهड़͢Δ
▸ `<style>` ͷதʹCSSΛهड़͢Δ ▸ `:scope` ͷٖࣅཁૉʹελΠϧΛͯΔ
RIOTJS + CSS Scoped CSSͷهड़ <todo> <!-- layout --> <h3>{
opts.title }</h3> <style scoped> scope: { display: block } h3 { font-size: 120% } </style> <todo>
RIOTJS + CSS λάΛϕʔεͱͨ͠ελΠϦϯά ▸ ͜ͷ̎ͭͷॻ͖ํಉ݁͡ՌʹͳΔ <todo> <!-- layout -->
<h3>{ opts.title }</h3> <style> todo { display: block } todo h3 { font-size: 120% } </style> <todo> <todo> <!-- layout --> <h3>{ opts.title }</h3> <style scoped> scope: { display: block } h3 { font-size: 120% } </style> <todo>
RIOTJS + CSS headλάͷૠೖ ▸ λάͷ෦ʹهࡌ͞Εͨ `<style>` `<head>` ͷඌʹૠ
ೖ͞ΕΔ ▸ Ұૠೖ͞ΕͨΒɺ࠶ૠೖ͞Εͳ͍ ▸ shadow-domͰͳ͍͕ɺ͍ۙΞϓϩʔνΛऔΔ
RIOTJS + CSS ·ͱΊ ▸ λάͷதʹ `<style>` Λهड़͠ɺͦ͜ʹCSSΛॻ͘ ▸ `<style>`
`<head>` ͷඌʹૠೖ͞ΕΔ ▸ `<style scoped>` Λ͏͜ͱͰɺλά໊ͷهࡌΛলུͰ͖Δ
RIOTJS+CSS+WEBPACK CSSϥΠϒϥϦͱͷ࿈ܞ
RIOTJS + CSS + WEBPACK CSS༷ʑͳϥΠϒϥϦʹࢧ͑ΒΕ͍ͯΔ ▸ autoprefixer ▸ meta
css ▸ postcss ▸ etc… ͜ΕΒͷԸܙΛ͋·ͣ͞ड͚͍ͨ!!!
RIOTJS + CSS + WEBPACK webpackͷར༻ ▸ հলུ ▸ riotjs-loader
+ style-loader + css-loader + anywhere
RIOTJS + CSS + WEBPACK webpackͷར༻ module: { preLoaders: [
{ test: /\.tag$/, exclude: /node_modules/, loader: 'riotjs- loader' }, ], loaders: [ { test: /\.css$/, exclude: /node_modules/, loader: 'style-loader! css-loader!postcss-loader' } ] }, postcss: () -> return [ require('postcss-calc') require('postcss-nested') require('autoprefixer') ]
RIOTJS + CSS + WEBPACK webpackͷར༻ var style = require(‘./style’)
<todo> <!-- layout --> <h3>{ opts.title }</h3> <style>{ style }</style> <todo>
RIOTJS + CSS + WEBPACK webpackΛ͏ϝϦοτ ▸ λάͷఆٛͱɺελΠϧͷఆٛΛҰॹʹཧͰ͖Δ ▸ σΟϨΫτϦʹࠝแͰ͖Δ
▸ ίϯϙʔωϯτͱͯ͠ɺใઃܭɾৼΔ͍ɾσβΠϯ͕ಠ ཱ͠ɺΞϓϦέʔγϣϯ͔Βૄ݁߹ʹͳΔ
RIOTJS + CSS + WEBPACK ·ͱΊ ▸ webpack͏ͱ͍͍Αʂ ▸ webpackΛ͏ͱίϯϙʔωϯτʹσβΠϯ·ͰแͰ͖
Δ ▸ ΞϓϦέʔγϣϯͱίϯϙʔωϯτΛૄʹͰ͖Δ
CONCLUSION ·ͱΊͱɺ͜Ε͔ΒͷCSSઃܭ
CONCLUSION RiotJSͱCSSΛ͍͍ײ͡ʹ࿈ܞͤ͞Δํ๏ͷհ ▸ RiotJSͰCSSΛ͏ʹɺλάʹ `<style>` Λॻ͘ ▸ `<style>` ʹهࡌ͞ΕͨCSS `<head>`
ͷඌʹૠೖ ▸ webpackΛͬͯίϯϙʔωϯτʹσβΠϯΛ࣋ͨͤΔ
CONCLUSION ίϯϙʔωϯτࢦ࣌ͷCSSઃܭ ▸ ίϯϙʔωϯτʹελΠϧΛӅṭ͢Δ࣌ ▸ λάʹରͯ͠ελΠϧΛͯΔ ▸ ˠࢠʹରͯ͠ɺmodifierͰίϯϙʔωϯτ֎͔Β ෦ߏΛҙࣝ͠ͳ͍ૄ݁߹ͳελΠϧ੍ޚ ▸
ίϯϙʔωϯτͱͯ͠ใઃܭɾৼΔ͍ɾσβΠϯΛந Խ͢Δ͜ͱͰɺͦΕ୯ମͷࠩ͠ସ͑ΛΑΓ؆୯ʹ
CONCLUSION ࠓޙͷ՝ ▸ ίϯϙʔωϯτͲ͜·ͰͷσβΠϯΛ͖͔࣋ͭʁ ▸ ৭ʁϨΠΞτʁ༨നʁܗʁ ▸ ͜ͷลΓDDDͷʮڥքΛҾ͘ʯ͋ͨΓͷφϨοδ͕ඞ ཁͦ͏ ▸
ࠓ·ͰҎ্ʹσβΠφͱΤϯδχΞ͕ڠྗͯ͠ઃܭΛ٧Ίͯ ͍͘ඞཁ͕͋Γͦ͏
CONCLUSION ࠷ޙʹ ▸ RiotJS؆୯ʹखૣ͘ϓϩτλΠϐϯάͰ͖ΔͷͰ͓͢͢Ί Ͱ͢ʂʂʂ
ۓٸࠂ ͨ͐͝͡ʔ͔Βͷ͓Βͤ
6/3ʹGontanda.js #4 ͷ։ ࠵Λ༧ఆͯ͠·͢ʂ @pine613 ͨ͐͝͡ʔ͔Βͷ͓Βͤ
ڵຯ͋Δํͥͻ gotanda.js.org ʂ @pine613 ͨ͐͝͡ʔ͔Βͷ͓Βͤ
THANKS!