Rails Upgrade Casual Talks

Rails Upgrade Casual Talks

Rails Upgrade Casual Talks の基調講演「10年戦えるフレームワークのバージョンアップ戦略」の発表スライド https://cw-meetup.doorkeeper.jp/events/40728

76a777ff80f30bd3b390e275cce625bc?s=128

Akira Matsuda

March 28, 2016
Tweet

Transcript

  1. 10೥ઓ͑ΔϑϨʔϜϫʔΫ ͷόʔδϣϯΞοϓઓུ @a_matsuda Rails Upgrade Casual Talks

  2. self ⤴GitHub: amatsuda ⤴Twitter: @a_matsuda

  3. ୅ද࡞ ⤴ stateful_enum
 https://github.com/amatsuda/ stateful_enum

  4. Railsίϛολʔ ⤴ݱ࣌఺Ͱ͸།Ұͷ೔ຊਓ

  5. Asakusa.rb

  6. RubyKaigi2015, 2016ͷ
 ʮνʔϑɾΦʔΨφΠβʔʯ = ͟ ͟͞͞

  7. begin

  8. Railsͷྺ࢙ ⤴ 10೥ ⤴ఆظతͳόʔδϣϯΞοϓ ⤴৽͍͠ύϥμΠϜͷ਺ʑ ⤴ઈ͑ؒͷͳ͍มԽ

  9. 10೥ؒ׆ൃʹ։ൃ͞Εଓ͚Δ
 ൿ݃ ⤴ఆظతͳόʔδϣϯΞοϓ ⤴೩ྉ ⤴ݹ͍ίʔυΛͲΜͲΜࣺͯΔ ⤴มߋʹڧ͍࡞Γ ⤴มԽΛࢧ͑ΔςΫϊϩδʔ ⤴มԽ͢ΔίϛϡχςΟ

  10. ఆظతͳόʔδϣϯΞοϓ ⤴ ެ։: 2004೥ ⤴ 1.0: 2005೥ ⤴ 2.0: 2007೥

    ⤴ 3.0: 2010೥ ⤴ 4.0: 2013೥ ⤴ 5.0: 2016೥
  11. ϝδϟʔόʔδϣϯ͝ͱͷ
 ৽͍͠ύϥμΠϜ (= ೩ྉ) ⤴ 1.x: CoC, DRY , TDD,

    generator, … ⤴ 2.x: REST ⤴ 3.x: Modularity, Asset Pipeline ⤴ 4.x: Strong Parameters ⤴ 5.x: ?
  12. ݹ͍ίʔυΛࣺͯΔ

  13. Rails͕αϙʔτ͢Δ
 Rubyͷόʔδϣϯͷมભ ⤴ 1.0: ʙ1.8.6 ⤴ 2.0: 1.8.6, 1.8.7 ⤴

    3.0: 1.8.7 , 1.9 ⤴ 4.0: 1.9, 2.0, 2.1 ⤴ 5.0: 2.2, 2.3
  14. ੵۃతʹݹ͍όʔδϣϯͷRuby ͷαϙʔτΛଧͪ੾Δ ⤴ Railsͷίʔυϕʔε಺ͰRubyͷ
 ৽ػೳΛͲΜͲΜ׆༻Ͱ͖Δ ⤴ Railsͷϝϯςָ͕ʹͳΔ ⤴ RubyνʔϜ͸ݹ͍RubyͷϝϯςΛ
 ͦΕ΄ͲؤுΒͳͯ͘΋Ϣʔβʔʹ


    ͋·ΓౖΒΕͳ͘ͳΔ
  15. ίʔυͷ৽௠୅ँ ⤴৽͍͠ػೳΛͲΜͲΜ
 औΓೖΕΔ ⤴ͦͷ൓໘ɺ࢖ΘΕͳ͘ͳͬͯ ͖ͨػೳΛੵۃతʹഁغ͢Δ

  16. มߋʹڧ͍࡞Γ ⤴ ϓϥάΠϯγεςϜ(࠷ॳ͔Β) ⤴ RailsϓϥάΠϯΛRubyGemsʹ (2.x) ⤴ Bundlerͷൃ໌ (3.0) ⤴

    agnosticͳߏ଄ (3.0) ⤴ AMCͷൃ໌ (1.2) ⤴ Module#prependͷఏҊ (wycats)
  17. มԽ͢ΔίϛϡχςΟ ⤴ community == ϑϨʔϜ ϫʔΫࣗମͷ։ൃ
 ίϛϡχςΟͷ͜ͱ ⤴ http://rubyonrails.org/community/

  18. Community ⤴ community = core team + committers + contributors

    ⤴ΦϨΦϨ (since 2008) ⤴࣮͸3൪Ίʹݹגʂʁ
  19. ݈શͳίϛϡχςΟ ⤴ڧྗͳಠࡋऀ ⤴༗ೳͳ෭׭ ⤴ͦͷଞͷϝϯόʔ͸ৗʹ
 ೖΕସΘ͍ͬͯΔ ⤴ΈΜͳ͛͢ʔए͍

  20. มԽΛࢧ͑Δٕज़ ⤴ Git, GitHub ⤴ contributors app ⤴ Travis CI

  21. ݱࡏͷRailsϓϩδΣΫτͷ
 όʔδϣϯΞοϓϙϦγʔ ⤴ SemVer? ⤴ ϒϥϯνϙϦγʔ ⤴ αϙʔτ͢ΔRubyͷόʔδϣϯΛ্͛Δͱ͖͸ϝδϟʔ όʔδϣϯΛ্͛Δ ⤴

    େ͖ͳAPIมߋ͸ϚΠφʔόʔδϣϯΛ্͍͛ͨ ⤴ ηΩϡϦςΟύον͸ಠཱͰ ⤴ ϝιου͕ͳ͘ͳͬͨΓ͢Δ৔߹͸deprecation warning Λग़͢
  22. SemVer? https://twitter.com/dhh/status/550744752145321985

  23. ϒϥϯνϙϦγʔ ⤴ ϝϯςφϯεϒϥϯνͷຊ਺ ⤴ ܾ·ͬͯͳ͍ ⤴ ͍͍ͩͨ 1ʙ̎ຊ ⤴ ୲౰ऀ

    ⤴ ܾ·ͬͯͳ͍ ⤴ ΍Γ͍ͨਓ͕ډΕ͹΍Δ
  24. ϒϥϯνϙϦγʔ(Rubyͷ৔߹) ⤴ RubyνʔϜ಺Ͱ̎όʔδϣϯ
 ͙Β͍͸αϙʔτ͍ͯ͠Δ ⤴͞Βʹ΋͏1ͭલ͸RubyAssnͷ
 ͓ۚͰαϙʔτ͍ͯ͠Δ ⤴ͭ·Γɺαϙʔτظؒ͸3೥͙Β͍

  25. αϙʔτ͢ΔRubyͷόʔδϣϯΛ্͛ Δͱ͖͸ϝδϟʔόʔδϣϯΛ্͛Δ ⤴ઌड़ͷͱ͓Γ ⤴ 5.0͔Β͸Ruby 2.2Ҏ্

  26. େ͖ͳAPIมߋ͸
 ϚΠφʔόʔδϣϯΛ্͍͛ͨ ⤴ Tinyόʔδϣϯؒͷࠩҟ ͸جຊతʹ͸όάfixͷΈ

  27. ηΩϡϦςΟύον͸ಠཱͰ ⤴ଞͷύονͱࠞͥͯ
 ϦϦʔε͠ͳ͍

  28. ϝιου͕ͳ͘ͳͬͨΓ͢Δ
 ৔߹͸deprecation warningΛग़͢ ⤴લͷόʔδϣϯ·Ͱಈ͍ ͍ͯͨίʔυ͕͍͖ͳΓ ಈ͔ͳ͘ͳͬͨΓ͠ͳ͍ Α͏ʹ(ͳΔ΂͘)

  29. ͱ͍͏۩߹ʹɺ࠷ۙ͸͚ͬ͜͏ ͪΌΜͱ΍ͬͯΔ ⤴աڈͷࣦഊ͔Βֶश

  30. աڈͷࣦഊྫ(Α͋ͬͨ͘) ⤴ηΩϡϦςΟύονΛؚΜͩ
 ϏοάϦϦʔε ⤴ඇޓ׵ͳAPIมߋΛؚΜͰͨΓ… ⤴͔͠΋ͦΕ͕·ͨόάͬͯͨΓ… ⤴ => ηΩϡϦςΟύονΛ౰ͯΔͱΞϓϦ ͕յΕΔ

  31. Railsͷ࢓༷͸҆ఆͤ͞Δ΂͖ʁ ⤴ͦ͏͍͏ҙݟͷίϛολʔ΋ډΔ ⤴҆ఆੑͱύϑΥʔϚϯεʹ஫ྗ ⤴ݸਓతʹ͸ɺͦΕͰ͸ίϛϡχ ςΟ͕཭Εͯߦͬͯ͠·͏ͱࢥ͏ ⤴ Strutsతͳ

  32. RailsͷόʔδϣϯΞοϓʹ
 ͓͚Δ՝୊(۪ஒͱ΋͍͏) ⤴ຖճ୭͔͕ARΛյ͢ ⤴όʔδϣϯ্͕Δͱ஗͘ͳΔ ⤴ issue triage͕௥͍͔ͭͳ͍ ⤴ edgeҎ֎୭΋ݟͯͳ͍

  33. ղܾࡦ ⤴ಛʹͳ͍ͱࢥ͏ ⤴ΈΜͳ͕͕Μ͹Δ͔͠ ⤴ͦͷ఺Ruby͸͍͢͝ʂ

  34. Ϩʔϧʹ৐Γଓ͚Δίπ ⤴ͱʹ͔͘࠷৽൛Λ࢖͏ ⤴ϑϨʔϜϫʔΫ΍ϓϥΪϯͷίʔυ͸
 ͪΌΜͱಡΉ ⤴ϑϨʔϜϫʔΫͷόάΛڪΕͳ͍ ⤴෗Γͦ͏ͳϓϥΪϯΛݟۃΊΔ ⤴ࣗ෼ͰͲ͏ʹ͔͢Δ

  35. end