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
Introduction to Hotwire
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Onur Ozer
October 11, 2023
Programming
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to Hotwire
Onur Ozer
October 11, 2023
Transcript
20 slides
Onur Ozer Founder, Simple Matters Introduction to Hotwire ⚡ Ruby
Singapore Meetup, Sep 2023
My modern web development journey
(╯°□°)╯︵ ┻━┻
Rails and Javascript Prototype.js Script.aculo.us Rails 1 2005 jQuery
Co ff eescript Rails 3 2010 Webpacker Rails 6 2019 importmaps Rails 7 2021 Turbolinks 2015 ActionCable 2016 Stimulus.js 2018
How do you build modern web apps? • That are
fast and responsive • With a simple, productive work fl ow • While keeping template rendering on the server • Without introducing additional complexity
Traditional Web Apps Rails application HTTP Request HTML Response
JS Component Approach JS component AJAX Request JSON Response Rails
application
Single Page Applications (SPAs) Rails JSON API AJAX Request
JSON Response
H T M L O V E R T H
E W I R E
Philosophy • Responsiveness of an SPA without the complexity of
an SPA • Reuse partials • Sending HTML instead of JSON
Ingredients • Turbo • Turbo Drives • Turbo Frames •
Turbo Streams • Stimulus • Strada
Turbo Drive Accelerate navigation without full page reload <body> Rails
application AJAX GET/POST (Fetch) HTML Response <head>
Turbo Frames Partial page updates scoped to individual contexts Rails
application AJAX GET/POST HTML Partial (Turbo Frame) Turbo Frame <turbo frame id=“8”>
Turbo Streams Update multiple parts of a page in response
to a request Rails application AJAX GET/POST HTML Partial (Turbo Streams) Turbo Stream <turbo stream action=“replace” target=“content"> Turbo Stream <turbo stream action=“replace” target=“header”>
Turbo Streams Update multiple parts of a page in response
to a request Rails application (Action Cable) WebSocket Connection WebSocket Connection
Stimulus Organise Javascript with controllers and actions HTML Element HTML
Element Stimulus Controller Stimulus Controller
Demo: Todo App https://github.com/onurozer/hotwire-introduction
Getting Started • Rails 7 - comes by default •
Rails 6 - install turbo-rails and stimulus-rails gems https://github.com/hotwired/turbo-rails#installation https://github.com/hotwired/stimulus-rails#installing-with-installer • Others - install turbo and stimulus npm packages https://www.npmjs.com/package/@hotwired/turbo https://www.npmjs.com/package/stimulus
Resources • Hotwire for Rails Developers Course https://pragmaticstudio.com/hotwire-rails • Turbo
Rails Tutorial https://www.hotrails.dev/ • Hotwire Devs Newsletter https://masilotti.com/hotwire/ • Rails + Hotwire Jobs https://railshotwirejobs.com/
Thank You • Connect on LinkedIn https://www.linkedin.com/in/onurozer/ • Connect on
Mastodon https://ruby.social/@onurozer • My personal website https://onurozer.me/ • My company https://simplematters.co/
More Decks by Onur Ozer
See All by Onur Ozer
Breaking Rules to Ship Products: A Beginner's Rails Journey
onurozer
0
71
From Ruby to Revenue: Mastering Marketing for Developers
onurozer
0
40
Foundations of Marketing
onurozer
0
41
Other Decks in Programming
See All in Programming
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
130
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
310
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
340
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
190
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
350
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
240
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
290
GraphQL の onError と Nullability のこれから
quramy
0
220
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
2
160
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
320
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
880
Spec-driven Development with AI
simas
PRO
0
2.3k
Featured
See All Featured
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
640
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
660
Balancing Empowerment & Direction
lara
6
1.4k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
6
930
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Ruling the World: When Life Gets Gamed
codingconduct
0
440
Embracing the Ebb and Flow
colly
88
5.2k
Speed Design
sergeychernyshev
33
2.2k
Between Models and Reality
mayunak
4
580
Technical Leadership for Architectural Decision Making
baasie
4
650
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
490