Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Revisiting the Hotwire Landscape after Turbo 8 ...

Revisiting the Hotwire Landscape after Turbo 8 @ RailsConf 2024, Detroit

Hotwire has significantly altered the landscape of building interactive web applications with Ruby on Rails, marking a pivotal evolution toward seamless Full-Stack development.

With the release of Turbo 8, the ecosystem has gained new momentum, influencing how developers approach application design and interaction.

This session, led by Marco, a core maintainer of Stimulus, StimulusReflex, and CableReady, delves into capabilities introduced with Turbo 8, reevaluating its impact on the whole Rails and Hotwire ecosystem.

https://railsconf.org/schedule/

Marco Roth

May 09, 2024
Tweet

More Decks by Marco Roth

Other Decks in Programming

Transcript

  1. Started to actively contribute in 2019 Went full-time on OSS

    in January 2022 Started contracting in July 2023
  2. X

  3. $

  4. %

  5. I want to build modern frontend tools and tooling that

    are worthy of the Rails framework and it’s history.
  6. We want to use the HTML and the business logic

    we already have on the backend without having to duplicate anything on the frontend.
  7. Hotwire is not about getting rid of JavaScript. Hotwire is

    about reducing the amount of custom JavaScript you need to write for your application.
  8. 2012 Turbolinks first released Rails 3.2 2013 Rails 4.0 Turbolinks

    ships per default in Rails 2014 2016 Turbolinks 5 released Rails 5.0 Rails 4.1 and Rails 4.2
  9. RailsConf 2016 - Turbolinks 5: I Can’t Believe It’s Not

    Native! by Sam Stephenson https://www.youtube.com/watch?v=SWEts0rlezA
  10. 2012 Turbolinks first released Rails 3.2 2017 Stimulus and CableReady

    released Rails 5.1 2013 Rails 4.0 Turbolinks ships per default in Rails 2014 2016 Turbolinks 5 released Rails 5.0 Rails 4.1 and Rails 4.2
  11. 2012 Turbolinks first released Rails 3.2 2017 Stimulus and CableReady

    released Rails 5.1 2018 Phoenix LiveView and StimulusReflex released Rails 5.2 2013 Rails 4.0 Turbolinks ships per default in Rails 2014 2016 Turbolinks 5 released Rails 5.0 Rails 4.1 and Rails 4.2
  12. 2012 Turbolinks first released Rails 3.2 2017 Stimulus and CableReady

    released Rails 5.1 2018 Phoenix LiveView and StimulusReflex released Rails 5.2 2013 Rails 4.0 Turbolinks ships per default in Rails 2014 2016 Turbolinks 5 released Rails 5.0 Rails 4.1 and Rails 4.2 2019 2020 Hotwire umbrella and Turbo released Rails 6.1 Rails 6.0
  13. 2012 Turbolinks first released Rails 3.2 2017 Stimulus and CableReady

    released Rails 5.1 2018 Phoenix LiveView and StimulusReflex released Rails 5.2 2021 Rails 7.0 Hotwire ships per default in Rails 2013 Rails 4.0 Turbolinks ships per default in Rails 2014 2016 Turbolinks 5 released Rails 5.0 Rails 4.1 and Rails 4.2 2019 2020 Hotwire umbrella and Turbo released Rails 6.1 Rails 6.0
  14. 2012 Turbolinks first released Rails 3.2 2017 Stimulus and CableReady

    released Rails 5.1 2018 Phoenix LiveView and StimulusReflex released Rails 5.2 2021 Rails 7.0 Hotwire ships per default in Rails 2013 Rails 4.0 Turbolinks ships per default in Rails 2014 2016 Turbolinks 5 released Rails 5.0 Rails 4.1 and Rails 4.2 2019 2020 Hotwire umbrella and Turbo released Rails 6.1 Rails 6.0 2023 Rails 7.1 2024 Turbo 8 with Morphing released
  15. Going forward we would love to help make Hotwire the

    best set of framework in this space.
  16. We were able to build these features early on, because

    we were pushing what’s possible with the HTML-over-the-wire approach
  17. StimulusReflex + CableReady Hotwire / Turbo Difference DOM Updates May

    2017 CableReady Operations Dec 2020 Turbo Streams 3 yrs 7 mo Morphing as an individual concept Aug 2019 CR Morph Action + SR Morphs ? 4 yrs 9 mo+ Scoped Navigation Oct 2019 data-reflex-root Dec 2020 Turbo Frames 1 yrs 2 mo Custom Actions May 2020 Custom CableReady Operations Sep 2022 Custom Turbo Stream Actions 2 yrs 4 mo Reactive Page Refreshes May 2020* StimulusReflex Page Morph Feb 2024 Turbo Page Refreshes 3 yrs 9 mo Partial Page Refreshes May 2020 StimulusReflex Selector Morph ? 4 yrs+ Subscribe to Models Jan 2021 cable_ready_stream_from Dec 2020 turbo_stream_from -1 mo Modal Change Broadcasts Aug 2021 CableReady::Updatable Feb 2024 Turbo Model Broadcasts 2 yrs 6 mo
  18. Tooling Education Marketing Documentation Addressing Issues Community Building Building new

    features Accelerating Adoption Framework integrations Answering Questions/Forums Guides/How tos/Best Practices Support Migrations/Transitions
  19. import { Controller } from "@hotwired/stimulus" export default class extends

    Controller { static targets = ["name"] connect() { console.log("User Profile connected") } }
  20. import { Controller } from "@hotwired/stimulus" export default class extends

    Controller { static targets = ["name"] connect() { console.log("User Profile connected") } }
  21. import { Controller } from "@hotwired/stimulus" export default class extends

    Controller { static targets = ["name"] connect() { console.log("User Profile connected") } }
  22. import { Controller } from "@hotwired/stimulus" export default class extends

    Controller { static targets = ["name"] connect() { console.log("User Profile connected") } }
  23. import { Controller } from "@hotwired/stimulus" export default class extends

    Controller { static targets = ["name"] connect() { console.log("User Profile connected") } }
  24. import { Controller } from "@hotwired/stimulus" export default class extends

    Controller { static targets = ["name"] connect() { console.log("User Profile connected") } }
  25. import { Controller } from "@hotwired/stimulus" export default class extends

    Controller { static targets = ["name"] connect() { console.log("User Profile connected") } }
  26. import { Controller } from "@hotwired/stimulus" export default class extends

    Controller { static targets = ["name"] connect() { console.log("User Profile connected") } }
  27. import { application } from "./application" import ClipboardController from "./clipboard_controller.js"

    application.register("clipboard", ClipboardController) import FileUploadController from "./file_upload_controller.js" application.register("file-upload", FileUploadController) app/javascript/controllers/index.js
  28. import { application } from "./application" import ClipboardController from "./clipboard_controller.js"

    application.register("clipboard", ClipboardController) import FileUploadController from "./file_upload_controller.js" application.register("file-upload", FileUploadController) app/javascript/controllers/index.js
  29. import { application } from "./application" import ClipboardController from "./clipboard_controller.js"

    application.register("clipboard", ClipboardController) import FileUploadController from "./file_upload_controller.js" application.register("file-upload", FileUploadController) app/javascript/controllers/index.js
  30. import { application } from "./application" + import AlertController from

    "./alert_controller.js" + application.register("alert", AlertController) app/javascript/controllers/index.js
  31. <%= tag.div( data: { controller: "filter", filter_open_class: "border-white", filter_close_class: "hover:bg-gray-100

    border-gray-300" } ) %> Full support for HTML+ERB and Rails-specific helpers Ruby LSP
  32. # Pin npm packages by running ./bin/importmap pin "application", preload:

    true pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true pin "@hotwired/stimulus", to: "stimulus.js", preload: true pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true pin "@rails/request.js", to: "requestjs.js", preload: true pin_all_from "app/javascript/controllers", under: "controllers" pin_all_from "app/javascript/config", under: "config" Full support for importmap-rails
  33. $ stimulus-lint Stimulus Lint is inspecting 25 files ........................ 25

    files inspected, 0 offenses detected, 0 offenses autocorrectable
  34. ActionCable AnyCable CableReady Cubism current.js Debounced Formulus Futurism Hotwire Kredis

    Local Time Rails Request.js Skeletons Stimulus Stimulus Intellisense Stimulus LSP Stimulus Parser Stimulus Rails Stimulus Use StimulusReflex Strada Strada Android Strada Web Strada iOS tippy.js Tom Select Turbo Turbo Boost Turbo Boost Commands Turbo Boost Dev Tools Turbo Boost Elements Turbo Boost Streams Turbo LSP Turbo LSP Turbo Morph Turbo Native Turbo Native Android Turbo Native iOS Turbo Power Turbo Power Rails Turbo Rails View Components ….
  35. Backed by community content If you write a post, we

    want to feature it next to the relevant documentation section so it can also be discovered by the community.
  36. The framework is not worth anything if people do not

    know about it and can not learn about it.
  37. Hotwire Weekly • A new Hotwire-focused newsletter • Delivered Weekly

    • Explore what’s happening in the world of Hotwire • Progress and updates while we are building out hotwire.io • Been running since Oct 2023 • Over 1200+ subscribers and growing WEEKLY
  38. My wish is that we as a community can continue

    pushing what’s possible with Hotwire.
  39. Optimistic UI Optimistic client-side rendering "Frameless"-Turbo Frames Partial Page Morph

    Updates Independent Morphing Plugins/Extensibility Web Components PWA Better React-compatibility