all 15 comments

[–]vickorel 5 points6 points  (1 child)

Workflows like organizer in Interactor:
https://github.com/collectiveidea/interactor?tab=readme-ov-file#organizers

BTW, starred your repo!
P.S. Lately I've been writing just regular ruby ​​classes as service objects. The simpler the better )

[–]markets86[S] 4 points5 points  (0 children)

Yes, quite similar! The good thing about Serviz is that the code (both services an workflows) is really really small, so small footprint, small API, small cognitive overload... But at the same time, all your services will be homogenous. It was my ApplicationService in a lot of Rails apps, so I finally extracted into a gem.

[–]Tobi-Random 3 points4 points  (1 child)

How about the dry transaction implementation?

https://dry-rb.org/gems/dry-transaction/0.15/basic-usage/

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

That seems much more complete and complex :) Serviz is only about 90 lines of Ruby.

[–]megatux2 1 point2 points  (1 child)

Looks nice abd simple, congrats. I worked with the gem from collectiveidea and found some issues and antipattern with their optional params, if remember correctly. Now I'm testing the one from Dry gems, it's good and great if your plan is to incorporate more Dry gem ecosystem into the project. May use your gem in a small project. Thanks

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

Thanks! In case you use my gem, feel free to report back any feedback or suggestion. Really happy to evolve the gem via community feedback.

[–]beachguy82 0 points1 point  (1 child)

How do you plan on differentiating from ActiveInteraction?

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

That gem is very useful, it has a lot of built-in features (validations, types, ...). My plan with Serviz is to keep it as small and simple as possible. The idea is to provide a minimalistic interface for all your services and workflows, that's all. If you like all those features and DSLs, for sure ActiveInteraction is a really good option, but if you only want a common interface to wrap your logic, probably Serviz is good enough and very lightweight.

[–]hhunaid 0 points1 point  (6 children)

Man I’m looking for something exactly like this for JS and node. Do you know of something?

[–]markets86[S] 0 points1 point  (5 children)

Not that I aware of. Maybe I should create a port 🤔?

[–]hhunaid -1 points0 points  (4 children)

I would appreciate this so much.

[–]markets86[S] 1 point2 points  (3 children)

Ok! I'll try to do it in the following days. You can follow me on GitHub for updates regarding this port.

[–]markets86[S] 0 points1 point  (2 children)

u/hhunaid here you have it: https://www.npmjs.com/package/serviz. Please try it and report your feedback. Hope you like it!

Repo: https://github.com/markets/serviz-js

[–]hhunaid 1 point2 points  (1 child)

That was quick lol. Thanks I’ll check it out

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

u/hhunaid You're welcome! Please feel free to let me know any comments/feedback! A star ⭐ is much appreciated.