Slide 1

Slide 1 text

Progressive Rails 8.1 (alpha) @tnir - 2024-11-14 - STORES & Rails @STORES HQ

Slide 2

Slide 2 text

@tnir Takuya Noguchi X: @tn961ir ● https://github.com/tnir ● https://gitlab.com/tnir

Slide 3

Slide 3 text

#storesrb @tn961ir @tnir (Takuya N) ● Ruby 25y ● Rails 18y ● GitLab Core Team (2015-) ● geminabox / nronn maintainer ● Bundler / forem (dev.to) contributor ● CTO at B2B SaaS sponsoring Kaigi on Rails 2023/2024 RubyKaigi 2023/2024 Rails Girls Japan 2023-2024 https://github.com/ruby/ruby

Slide 4

Slide 4 text

https://contributors.rubyonrails.org/releases/8-0-0/contributors 31th (tied)

Slide 5

Slide 5 text

#storesrb @tn961ir State: Rails 6.1 in 2023 ● A Rails app started in 2016 (< 1M LOCs) ○ (3 sub Rails apps beside) ● 1k+ modules, 250+ models ● 100+ public gem dependencies (direct & indirect) ○ 10 unmaintained gems 😞 ○ A few edgy gems 🎉 https://x.com/edawerd/status/1833261508924739915 Gusto: 4.18M LOCs

Slide 6

Slide 6 text

🤝Rails 8.0.0.beta1 Sep 2024 (Rails World 2024)

Slide 7

Slide 7 text

A life with Rails 8.0 (beta) - Proposals on Rails https://speakerdeck.com/tnir/a-life-with-rails-8-dot-0-beta

Slide 8

Slide 8 text

🎉Rails 8.1.0.alpha (2024-10-23 - 2 days before Kaigi on Rails 2024)

Slide 9

Slide 9 text

#storesrb @tn961ir activerecord dependency gemspec in dependent gems: Gem::Specification.new do |spec| spec.add_dependency 'activerecord', '>= 6', '< 8' end ↓ Gem::Specification.new do |spec| spec.add_dependency 'activerecord', '>= 6', '< 9' end

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

#storesrb @tn961ir Releases based on Rails edge ● ~ 85 releases since we moved to edge (Sep 2023) ● ~200 days passed since Rails World 2024

Slide 12

Slide 12 text

#storesrb @tn961ir gem “rails”, …, branch: “main” # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" ↓ # Gemfile gem "rails", github: "rails/rails", branch: "main" With Bundler: ~= git clone --depth 1 “https://github.com/rails/rails.git”

Slide 13

Slide 13 text

Build in environments

Slide 14

Slide 14 text

#storesrb @tn961ir On (my) local ● ~ 5-6 sec 🎉 ● (MacBook Air M2 24GB, N/W 2Gbps(max))

Slide 15

Slide 15 text

#storesrb @tn961ir On (my) local ● ~ 5-6 sec 🎉 ● (MacBook Air M2 24GB, N/W 2Gbps(max) Tokyo 23)

Slide 16

Slide 16 text

#storesrb @tn961ir On CI (AWS CodeBuild) ● ~ 34-35 sec ● (general1.large, Linux) ○ 8vCPU, 15GB, N/W ?? (ap-northeast-1)

Slide 17

Slide 17 text

#storesrb @tn961ir CI: caching gems (production) ● Cache strategy in CodeBuild ○ No Amazon S3/Local caching ● Cache in Docker Build ○ multi-stage build && docker build --cache-from. ○ Disadvantage for updating gems daily/weekly (=cache miss) ● ❗0.5 min out of 10 min (CI duration)

Slide 18

Slide 18 text

#storesrb @tn961ir Summary ● Rails edge in production: the hard way ○ … working as CxO ● ⚠We are hiring Rails enthusiasts⚠

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

https://x.com/stmn_eng