hanami in production @ 1º hanami sao paulo meetup

19

Upload: ruby-hanami-sao-paulo-meetups

Post on 13-Apr-2017

87 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Hanami in Production @ 1º Hanami Sao Paulo meetup
Page 2: Hanami in Production @ 1º Hanami Sao Paulo meetup

in production?

Page 3: Hanami in Production @ 1º Hanami Sao Paulo meetup

?why

Page 4: Hanami in Production @ 1º Hanami Sao Paulo meetup
Page 5: Hanami in Production @ 1º Hanami Sao Paulo meetup

”What's this application do?”

”Why should the top level directory structure communicate that information?”

Ruby Midwest 2011 - Keynote: Architecture the Lost Years by Robert Martin (https://www.youtube.com/watch?v=WpkDN78P884)

Page 6: Hanami in Production @ 1º Hanami Sao Paulo meetup

”The web is a detail”

”The web is a delivery mechanism!”

Ruby Midwest 2011 - Keynote: Architecture the Lost Years by Robert Martin (https://www.youtube.com/watch?v=WpkDN78P884)

Page 7: Hanami in Production @ 1º Hanami Sao Paulo meetup
Page 8: Hanami in Production @ 1º Hanami Sao Paulo meetup

Back in October/2015 – Hanami was called Lotushttp://hanamirb.org/blog/2016/01/22/lotus-is-now-hanami.html

Starting up a Proof of Concept

Page 9: Hanami in Production @ 1º Hanami Sao Paulo meetup

The selection• Hanami Model• Repositories• Entities• Object Mapping• Sequel abstraction

• Hanami Validation• Input Filtering• Input Validation

Page 10: Hanami in Production @ 1º Hanami Sao Paulo meetup

The Requirement

• Asset Pipeline• ERB-like Views• Javascript helpers

We’re asked to keep Rails under the hood due frontend requirements

Page 11: Hanami in Production @ 1º Hanami Sao Paulo meetup

The Plan

Page 12: Hanami in Production @ 1º Hanami Sao Paulo meetup

PoC’s Final PresentationThe idea was gain the ”green card” from our tech team to starting the project with this structure

https://github.com/hlegius/hanami-rails-as-frontend

Page 13: Hanami in Production @ 1º Hanami Sao Paulo meetup

Right after* PoC’s approval

All frontend-related stuff goes to

applications

Actually, it was 5-7 days after PoC’s approval =P

Page 14: Hanami in Production @ 1º Hanami Sao Paulo meetup

Release v0.99

=> /web

Form Objects

Grape gem

JSON API Spec Representation

Hanami Validations

Domain Model(Hanami Model)

DDD Boundaries(Infra & Application layers)

Rake Tasks

Page 15: Hanami in Production @ 1º Hanami Sao Paulo meetup

in production! <3

Page 16: Hanami in Production @ 1º Hanami Sao Paulo meetup

Rails autoloading Hell

http://urbanautomaton.com/blog/2013/08/27/rails-autoloading-hell/

After 7 months, Rails decided to demand attention

Page 17: Hanami in Production @ 1º Hanami Sao Paulo meetup

Good bye Rails; Hello Hanami (again)

Changes applied in Production env in 5 working days

Page 18: Hanami in Production @ 1º Hanami Sao Paulo meetup

Final considerations• Your team must be engaged and

accept the adoption• You can not do this alone! (read it

multiple times)

• PoC is a game changer• Practice; Practice; Practice*

• Hanami v0.7.3 is not ready for production, they say.

* The Passionate Programmer - Chad Fowler – The Pragmatic Bookshelf

Page 19: Hanami in Production @ 1º Hanami Sao Paulo meetup

Thank you!

@hanamirb

http://hanamirb.org

@hanamirb_sp Presented by @hlegius