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

[Saint-P RubyConf 2021] Rails X

[Saint-P RubyConf 2021] Rails X

Rails 7 is just around the corner. Although it brings a lot of powerful features, the new major release is not a revolution. Rails stays omakase; the Rails way is still a monolithic journey.

Let's turn the imagination mode on, and take a look at the fantastic future Rails: composable, extendable, free of core_ext, but still as easy to to use as today.

Vladimir Dementyev

June 05, 2021
Tweet

More Decks by Vladimir Dementyev

Other Decks in Programming

Transcript

  1. 1

  2. If there is a gun hanging on the wall in

    the first act, it must fire in the last > 5
  3. Have I been trying to accomplish the quest for an

    ideal Rails X all these years 🤔 > 8
  4. EXTRACTION CURSE 13 A combination of extractions is not a

    framework, it's a Frankenstein 🧟 >
  5. Rails codebase is mostly an extraction (Basecamp with Shopify &

    GitHub sprinkles) Extractions are often too host-specific 14 The Extraction Curse
  6. 16

  7. Rails is bloating from the features most users don't need

    More code 㱺 more maintenance burden 㱺 less time for improvements 19
  8. 26 "The first thing we do is tell them to

    do a bunch of configuration."-Steve Klabnik > 2021
  9. 29

  10. 30 # app/services/purchaser.rb class Purchaser < ActiveService ::Base needs :payment_transaction

    needs :order_mailer def purchase!(customer:, card:, order:) transaction = payment_transaction.new(card,order.amount) if transaction.success? order_mailer.receipt_email(customer,order).deliver_later else order_mailer.card_failed(customer,order,transaction).deliver_later end end end # config/initializers/braintree.rb service :payment_transaction do Braintree ::Transaction.new(api_key: ENV["BRAINTREE_API_KEY"]) end
  11. 31

  12. My Rails X Unbundled & Separated Environment-friendly More abstractions, less

    implementations (More) Developer happiness Scalable codebase For the web and beyond Modern 32
  13. 35 >= 5.1 -> nokogiri ( >= 1.6) actionpack (6.1.3.1)

    actionview (= 6.1.3.1) activesupport (= 6.1.3.1) rack ( ~> 2.0, >= 2.0.9) rack-test ( >= 0.6.3) rails-dom-testing ( ~> 2.0) rails-html-sanitizer ( ~> 1.0, >= 1.2.0) "actiondispatch" *
  14. Rails 3-4: Sprockets Rails 5: Sprockets + Webpacker Rails 6:

    Webpacker + Sprockets Rails 7: ??? 41
  15. DEVELOPER EXPERIENCE 45 Supporting tools are becoming more and more

    important than the language itself.–Matz >
  16. 48

  17. Generators Generator could only be useful if it fits your

    project needs Make a generator a part of the project Generate the generators! 54
  18. Modular architecture Engines should become an official way to extract

    components Engines must be supported by all sub-frameworks 64
  19. 65

  20. Modular architecture Engines should become an official way to extract

    components Engines must be supported by all sub-frameworks Engines should just work! 66
  21. 69 Did I show you enough reasons to choose PHP

    for the next project? 😄 >
  22. engines/ core/ app/ events/ core/ users/ registered.rb chat/ app/ subscribers/

    core/ users/ on_registered/ create_chat_account.rb github.com/palkan/active_event_store Event store the Rails way > 70
  23. Beyond Web 🚀 HTTP server should be just one of

    the possible entry-points (e.g., gRPC, cables, serverless) Both request-response and events (streaming) based communication supported AbstractController should be really abstract! > 73
  24. And a lot more... Improved instrumentation Improved testing tools (benchmarks,

    property- based, factories along with fixtures) Improved views 79
  25. Improved instrumentation Improved testing tools (benchmarks, property- based, factories along

    with fixtures) Improved views Improved configuration (anyway_config) 81 And a lot more...
  26. And a lot more... Improved instrumentation Improved testing tools (benchmarks,

    property- based, factories along with fixtures) Improved views Improved configuration (anyway_config) Improved Rails commands 82
  27. Full-features CLI instead of Rake Fast start time (no application

    loading) First-class support for custom commands 83 Rails Commands X
  28. SIMPLE STAY SIMPLE 85 Blog in 5 minutes without DI,

    algebraic effects and monads ⏱ >
  29. We are hiring. We are hiring. I am hiring. I

    am herring 🐟 > evl.ms/jobs