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
まだ DOM 操作で消耗してるの? / ngineerxiv #3
Search
Yuki Ishikawa
June 06, 2015
67
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
まだ DOM 操作で消耗してるの? / ngineerxiv #3
(だいたい)新卒エンジニア向け技術交流会 vol.3
https://ngineerxiv.doorkeeper.jp/events/24857
Yuki Ishikawa
June 06, 2015
Transcript
50 slides
·ͩ DOM ૢ࡞Ͱ ফͯ͠Δͷʁ 2015.06.06 (͍͍ͩͨ)৽ଔΤϯδχΞ͚ٕज़ަྲྀձ vol.3
None
͜ΜΜ hoge17296 Ͱ͢ʂʂʂʂʂ
hoto 17296
ͱ͏ͱ͏ϓϩάϥϚྺ 10 ʹಥೖ
None
ͦΕͰ 10 Ͱ ͍Ζ͍ΖͳͷΛݟ͖ͯͨ
ΫϥΠΞϯταΠυ JS ࢙ۙ
ʙ 2004 • JS ʮ Web ʹͪΐͬͱಈ͖ΛՃ͑Δͷʯ • ʮJS͕ಈ͔ͳ͍ڥͷ͜ͱ
ɹߟ͑ͳ͖ΌμϝͰ͠ΐʂʂʂʯ • Ϧονͳ͜ͱ Flash ͰΕ
None
None
None
Flash ԫۚ࣌
ਓੜͷઈ
2005
None
Ajax ͷੜ • ࣮ੲ͔Β͚͋ͬͨͲΒΕ͍ͯͳ͔ͬͨ XMLHttpRequest ͕ Google Maps ʹΑͬͯ ࠶ൃݟ͞ΕͯҰ༂༗໊ʹ
• Ajax (Asynchronous JavaScript + XML) ͱ͍͏ ݴ༿͕ੜ·ΕΔ • ͔͠͠·ͩ·ͩෑډ͕ߴ͍
2006
None
jQuery ͷিܸ • ΫϥΠΞϯταΠυϓϩάϥϛϯάͷෑډΛ ѹతʹԼ͛ͨ • DOM ૢ࡞ • Πϕϯτॲཧ
• Ϋϩεϒϥβ • Ajax
$()
͋·͍͋·͍ γϯλοΫε γϡΨʔ
jQuery ৬ਓ͕ࣾձʹ ʮ͜ΕάʔάϧΈ͍ͨʹ ɹΪϡΠʔϯͬͯײ͡Ͱ ɹͰ͖ΔΑͶʁʯ
None
...ͱݴ͑ͳ͍ • ͳ·͡ jQuery ͕͋Εͦͦ͜͜ग़དྷͯ͠·͏ • ͪΐͬͱάάΕϓϥάΠϯ͕མͪͯΔ • ग़དྷΔΑ͏ͳؾ͕ͯ͠͠·͏ •
ʮग़དྷͯͨΓલʯͱͯ͠ཁٻ͞ΕΔ
ͳʹ͕ͭΒ͍͔
ͯ͢ͷ DOM ͷঢ়ଶཧ • Ͳͷ DOM ͕ࠓͲΜͳΛ͍࣋ͬͯΔ͔ • Ͳͷ DOM
͔ΒԿͷΠϕϯτ͕ൃՐ͢Δ͔ • ͜ͷ͕มΘͬͨΒͲͷ DOM Λ ॻ͖͑ͳ͍ͱ͍͚ͳ͍͔
ίϯϙʔωϯτ͕૿͑Δͨͼ ߟ͑Δ͖͜ͱ͕ ࢦؔతʹ૿͍͑ͯ͘ ϓϩάϥϛϯά
Ұ෦ͷ༏Εͨ৬ਓʹ͔͠ ͠ಘͳ͍ઈٕ
ͦͯ͠ 2010
Single Page Application
Single Page Application • HTML5 ͷ history.pushState ʹΑͬͯ URL ͷಈతॻ͖͕͑Մೳʹ
• ϖʔδભҠͱ͍͏֓೦Λӽͨ͠ ΫϥΠΞϯταΠυϓϩάϥϛϯάͷۃ
ྫ ʮSPAͰ࡞ͬͯͶʂʂʂʯ ʮͰ history.back ͯ͠લͷϏϡʔͷ ɹεΫϩʔϧҐஔอ࣋ͯ͠Δͷવͩ͠ ɹใߋ৽͞ΕͯΔΑͶʂʂʂʯ
ਓؒۀͰͳ͍
͜Μͳͷ͕ ”ͨΓલ”ͱͯ͠ ཁٻ͞ΕΔੈͷத ઈରʹؒҧ͍ͬͯΔ
Զ ͏
2014
None
React • Facebook ͷ UI ϥΠϒϥϦ • ϑϨʔϜϫʔΫ͡Όͳ͍ • ಛ
• ϦΞΫςΟϒϓϩάϥϛϯά • Virtual DOM
͏ DOM ૢ࡞͠ͳ͍͍ͯ͘ • มߋ͕͋ͬͨΒ HTML શମΛॻ͖͑Δ • ৗʹ࠷৽ͷঢ়ଶͷ DOM
Λ ϨϯμϦϯά͠ଓ͚Ε͍͍͚ͩ • React ͕෦Ͱ diff / patch ͯ͘͠ΕΔ͔Β ͘ͳ͍
DEMO http://bit.ly/mtg_timer
ʮࣄ͋Δຖʹ࠷৽ͷ HTML Λ ϨϯμϦϯά͢Δʯ ʁʁʁ
͜ΕͬͯੲϖʔδભҠͰ ͍ͬͯͨ͜ͱ͡Όͳ͍͔
γϯϓϧͰݹ͍ ͜ͷ֓೦ͦ͜ ਖ਼͔ͬͨ͠
΅ͨͪ͘ ͪΐͬͱΜͰ͍ͨ ͚ͩͩͬͨΜͩ
·ͱΊ • ΅ͨͪ͘ DOM ૢ࡞ͱ͍͏ ۤ௧Λڧ͍ΒΕ͍ͯΔ • ຑༀ (jQuery) ʹΑΔରྍ๏ݶք͕དྷ͍ͯΔ
• React ʹΑͬͯ΅ͨͪ͘ղ์͞ΕΔ
ָ͔ͬͨ͋͠ͷࠒʹΖ͏
None
·ͩ DOM ૢ࡞Ͱ ফͯ͠Δͷʁ
More Decks by Yuki Ishikawa
See All by Yuki Ishikawa
左手デバイスの限界を突破する
hoto17296
0
31
分割40%キーボードにスムーズに入門するには
hoto17296
1
410
FastAPI の並行処理モデルを完全に理解する
hoto17296
10
4.6k
o11y 何もわからない助けてくれ
hoto17296
0
140
Snowflake Openflow さわってみた
hoto17296
0
740
第3回 Snowflake 中部ユーザ会- dbt × Snowflake ハンズオン
hoto17296
4
1.5k
ORM と向き合う
hoto17296
15
12k
明日業務で役立たない Web 開発 TIPS
hoto17296
0
280
クソ bot 実装ライブコーディング
hoto17296
0
290
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.6k
How to Ace a Technical Interview
jacobian
280
24k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
400
Faster Mobile Websites
deanohume
310
32k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
330
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Color Theory Basics | Prateek | Gurzu
gurzu
1
520
It's Worth the Effort
3n
188
29k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
320