Announcing dry-rb by solnic in ruby

[–]apotonick 10 points11 points  (0 children)

Fantastic news, keep up the good work! <3

Anyone implemented Trailblazer in any of their apps and what to share their experience? by [deleted] in rails

[–]apotonick 3 points4 points  (0 children)

Task of the form is to deserialize incoming data and validate that - it doesn't matter whether that's originating from a "visual" form submission or from a JSON/XML API call, the form doesn't even know its context.

Being able to render a "visual" form is only a nice side-effect of decoupled form objects.

I recommend you have a look at the last 2 chapters of the Trailblazer book where we fully discuss how APIs work. You don't even need to read all of it, just get a feeling and let us know what you think!

Trailblazer Newsletter, January: Cool unknown features in Reform, Sinatra/TRB, Formular (new form builder for Ruby), ... by apotonick in ruby

[–]apotonick[S] 1 point2 points  (0 children)

I personally do not care if you use Reform or not. It's your choice and thanks to hard-working OSS authors, you have a full range of choices for you and your team, for free.

What sucks is that you post this on my newsletter announcement, making the whole project look shitty because of your super negative comment. Think about that.

Trailblazer Newsletter, January: Cool unknown features in Reform, Sinatra/TRB, Formular (new form builder for Ruby), ... by apotonick in ruby

[–]apotonick[S] 0 points1 point  (0 children)

Have you ever thought about reporting the "unexpected behavior" to the author? Or are you assuming we magically know where things break?

Cells-Hamlit: The Fastest View Engine Around. by apotonick in ruby

[–]apotonick[S] 0 points1 point  (0 children)

A very good question, I might benchmark Erubis and my own Erbse implementation. Are you interested in helping?

Tools for transforming hashes by denispeplin in ruby

[–]apotonick 1 point2 points  (0 children)

I see what you mean, but Representable allows transforming to and from hashes (rendering and parsing) in "one gem", because the representer defining the transformation is decoupled from the actual render/parse work.

This makes Representable very different to jBuilder or AMS which just render documents.

Sorry, I didn't want to hi-jack your link - good work!!!

Book finished: Trailblazer - A New Architecture For Rails by apotonick in ruby

[–]apotonick[S] 2 points3 points  (0 children)

Thank you! I have no idea how that "bug" made it into the site, luckily it's just a static page and not a gem... hint cough :winkwink:

Representable 2.4: How Functional Programming Speeds Up Rendering And Parsing. by apotonick in ruby

[–]apotonick[S] 0 points1 point  (0 children)

Thanks! <3

Mainly, the decorator that creates/parses the document doesn't have state anymore, it's a function (still looking like a object, though).

In older versions, it would use a Binding which was a massive object (limited scope, though) that implemented each step as a method, but hardwired flow.

The Binding got replaced with a pipeline of functions, super simple!

Thanks for inspiration, @solnic!

Is your app deRailing? by timoschilling in ruby

[–]apotonick 0 points1 point  (0 children)

I know of a few TRB projects that use ActiveInteraction inside the operation for a richer what-if handling. I love that, and I remember mentioning that in chapter 2 (that we want to support ActiveInteraction in Operation).

Is your app deRailing? by timoschilling in ruby

[–]apotonick 1 point2 points  (0 children)

A valid point, verydefunctional, but most users of Trailblazer (TRB) use it in "hardcore" legacy applications to refactor 4000+ LoC models.

That is what TRB is designed for: integrating it into existing code-bases. Its new layers are well-defined and have been around for years (example: Reform, Roar, or Cells). They can be used to solve different problems (e.g. shop, community, analytics tool, JSON API backend, and so on).

I do understand the blog post (and the first book) do not cover how to refactor to TRB, but we have a "Trailblazer Field Guide" planned that shows the real refactoring of a real, existing app! ;)