Slide 1

Slide 1 text

1

Slide 2

Slide 2 text

Vova on Rails, since 2014 > 2

Slide 3

Slide 3 text

YEARS AGO 3 The grass was greener, the light was brighter >

Slide 4

Slide 4 text

Bozhidar is challenging Matz and Ruby Core team (RubyConfBY 2017) > 4

Slide 5

Slide 5 text

If there is a gun hanging on the wall in the first act, it must fire in the last > 5

Slide 6

Slide 6 text

NOW The idea has been on a shelf fo(u)r years > 6

Slide 7

Slide 7 text

I didn't expect anyone to vote for this topic 🙀 > 7

Slide 8

Slide 8 text

Have I been trying to accomplish the quest for an ideal Rails X all these years 🤔 > 8

Slide 9

Slide 9 text

Rails X == Rails 🤔 > 9

Slide 10

Slide 10 text

Rails X == Hanami 😸 > 10

Slide 11

Slide 11 text

MY RAILS X Reconsidering the past, designing the future (and some bikeshedding) > 11

Slide 12

Slide 12 text

RECONSIDER rails new --skip-sprockets --skip-actiontext --skip-turbolinks --skip-actionmailbox --skip-wtf >

Slide 13

Slide 13 text

EXTRACTION CURSE 13 A combination of extractions is not a framework, it's a Frankenstein 🧟 >

Slide 14

Slide 14 text

Rails codebase is mostly an extraction (Basecamp with Shopify & GitHub sprinkles) Extractions are often too host-specific 14 The Extraction Curse

Slide 15

Slide 15 text

Non-extractions Rails API Zeitwerk Active Record internals refactoring by @sgrif Action Cable Testing 🙂 15

Slide 16

Slide 16 text

16

Slide 17

Slide 17 text

EXTRACTIONS FEATURES 17

Slide 18

Slide 18 text

OMAKASE CURSE 18 Shut up and eat what's on the table! >

Slide 19

Slide 19 text

Rails is bloating from the features most users don't need More code 㱺 more maintenance burden 㱺 less time for improvements 19

Slide 20

Slide 20 text

Dead weight detected ☠ > 20

Slide 21

Slide 21 text

SEPARATE ECOSYSTEM FROM FRAMEWORK 21

Slide 22

Slide 22 text

22 ⚠ Uwaga! PHP is on the next slide!

Slide 23

Slide 23 text

23 The student has surpassed the teacher ( >

Slide 24

Slide 24 text

Tender age in bloom 🌸 > 24

Slide 25

Slide 25 text

DUAL STACK CURSE 25 Two heads are better worse than one >

Slide 26

Slide 26 text

26 "The first thing we do is tell them to do a bunch of configuration."-Steve Klabnik > 2021

Slide 27

Slide 27 text

27 rails new --test-with=rspec and/or

Slide 28

Slide 28 text

IMAGINARY FUTURE 28 It's time to turn imagination mode on! >

Slide 29

Slide 29 text

29

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

31

Slide 32

Slide 32 text

My Rails X Unbundled & Separated Environment-friendly More abstractions, less implementations (More) Developer happiness Scalable codebase For the web and beyond Modern 32

Slide 33

Slide 33 text

UNBUNDLED 33 Pieces of the puzzle must fit >

Slide 34

Slide 34 text

Unbundled Upgrade individual parts Use sub-frameworks independently Avoid unneeded dependencies 34

Slide 35

Slide 35 text

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" *

Slide 36

Slide 36 text

ActionPack 36 Router 🤯 *

Slide 37

Slide 37 text

37 🤔

Slide 38

Slide 38 text

ENVIRONMENT 38 Stop polluting the environment >

Slide 39

Slide 39 text

stop_core_ext_everywhere > 39

Slide 40

Slide 40 text

ABSTRACTIONS VS. IMPLEMENTATIONS 40 Replace leaking implementations with non-leaking abstractions >

Slide 41

Slide 41 text

Rails 3-4: Sprockets Rails 5: Sprockets + Webpacker Rails 6: Webpacker + Sprockets Rails 7: ??? 41

Slide 42

Slide 42 text

If you can’t decide, ship with zero options instead of two! 42

Slide 43

Slide 43 text

43 Interfaces not implementations for the outside world dependencies >

Slide 44

Slide 44 text

44 actiontrix

Slide 45

Slide 45 text

DEVELOPER EXPERIENCE 45 Supporting tools are becoming more and more important than the language itself.–Matz >

Slide 46

Slide 46 text

My typical Rails journey starts like this > 46

Slide 47

Slide 47 text

DX Plug-n-play development environment 47

Slide 48

Slide 48 text

48

Slide 49

Slide 49 text

Shall we sail, too? > 49

Slide 50

Slide 50 text

DX Plug-n-play development environment Quick setup for new projects 50

Slide 51

Slide 51 text

51 open https: //railsnew.io >

Slide 52

Slide 52 text

Oh, it's aiready a year old! > 52

Slide 53

Slide 53 text

DX Plug-n-play development environment Quick setup for new projects Project-specific generators 53

Slide 54

Slide 54 text

Generators Generator could only be useful if it fits your project needs Make a generator a part of the project Generate the generators! 54

Slide 55

Slide 55 text

DX Plug-n-play development environment Quick setup for new projects Project-specific generators 55

Slide 56

Slide 56 text

DX Plug-n-play development environment Quick setup for new projects Project-specific generators Deployment-ready 56

Slide 57

Slide 57 text

57 ActiveHeroku, ActionKubernetes, ActuallyCapistranoIsStillAlive ... >

Slide 58

Slide 58 text

github.com/lewagon/seatrain 58 Under the sea, under the sea, darling, it's better, down where it's wetter >

Slide 59

Slide 59 text

SCALABLE CODEBASE 59 Rails scales, and you? >

Slide 60

Slide 60 text

60 The promise of the new bright future >

Slide 61

Slide 61 text

MAJESTIC MONOLITH 61 We all want to build majestic monoliths and citadels ... >

Slide 62

Slide 62 text

SHIT-ESTIC MONOLITH 62 But usually that turns out as ... >

Slide 63

Slide 63 text

63 Cutting the application in slices 🔪 >

Slide 64

Slide 64 text

Modular architecture Engines should become an official way to extract components Engines must be supported by all sub-frameworks 64

Slide 65

Slide 65 text

65

Slide 66

Slide 66 text

Modular architecture Engines should become an official way to extract components Engines must be supported by all sub-frameworks Engines should just work! 66

Slide 67

Slide 67 text

67 github.com/palkan/engems One can dare to use engines today >

Slide 68

Slide 68 text

Modular architecture Cross-component communication out-of-the-box 68

Slide 69

Slide 69 text

69 Did I show you enough reasons to choose PHP for the next project? 😄 >

Slide 70

Slide 70 text

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

Slide 71

Slide 71 text

BEYOND WEB 71 Can Rails break out of the Web world? >

Slide 72

Slide 72 text

72 Server is a terrible abstraction (Daniel Azuma, RailsConf 2021) >

Slide 73

Slide 73 text

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

Slide 74

Slide 74 text

MODERN 74 Is it 2021 or what? >

Slide 75

Slide 75 text

Modern Ractor-ready Async-ready RBS-ready 75

Slide 76

Slide 76 text

76 github.com/pocke/rbs_rails Shouldn't Rails itself generate RBS for Rails 🤔 >

Slide 77

Slide 77 text

And a lot more... Improved instrumentation 77

Slide 78

Slide 78 text

78 Good company always worth the time >

Slide 79

Slide 79 text

And a lot more... Improved instrumentation Improved testing tools (benchmarks, property- based, factories along with fixtures) Improved views 79

Slide 80

Slide 80 text

Views X Isolated (no instance vars leaking) Components-first (view_component) UI kits or alike 80

Slide 81

Slide 81 text

Improved instrumentation Improved testing tools (benchmarks, property- based, factories along with fixtures) Improved views Improved configuration (anyway_config) 81 And a lot more...

Slide 82

Slide 82 text

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

Slide 83

Slide 83 text

Full-features CLI instead of Rake Fast start time (no application loading) First-class support for custom commands 83 Rails Commands X

Slide 84

Slide 84 text

INVARIANTS 84 Some things should never change >

Slide 85

Slide 85 text

SIMPLE STAY SIMPLE 85 Blog in 5 minutes without DI, algebraic effects and monads ⏱ >

Slide 86

Slide 86 text

SAFETY FIRST 86 Make it hard to shoot yourself in the foot >

Slide 87

Slide 87 text

AM I A DREAMER? 87

Slide 88

Slide 88 text

discuss.rubyonrails.org 88 Your journey starts here! >

Slide 89

Slide 89 text

We are hiring. We are hiring. I am hiring. I am herring 🐟 > evl.ms/jobs

Slide 90

Slide 90 text

THANKS! 90 Exclusively for Saint-P Ruby Conf 2021 by Vladimir Dementyev, Evil Martians >

Slide 91

Slide 91 text

DISCUSSION TIME 91 What do YOU want to fix in Rails? >