Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.0.0 and discontinue active development #127

Open
timriley opened this issue Jun 30, 2019 · 5 comments
Open

Release 1.0.0 and discontinue active development #127

timriley opened this issue Jun 30, 2019 · 5 comments

Comments

@timriley
Copy link
Member

@timriley timriley commented Jun 30, 2019

A lot has changed since dry-transaction was brought into the dry-rb family in 2016: dry-monads was later created, and for the last year, it has offered its Do Notation feature, which provides an expressive API for chaining dependent sequences of commands. Do notation is far more flexible than dry-transaction's simple "step" definitions while being just as easy to use, and it is now our recommended solution for this kind of behaviour.

As such, we'll be soon releasing dry-transaction 1.0.0, then ceasing further development.

Here's what will happen:

  • Ship an upgraded Result matcher in dry-matcher, to support matching on Failure codes (this will provide an equivalent to dry-transaction's built-in result matching)
  • Address any legitimate bugs remaining in dry-transaction's current feature set
  • Move dry-transaction documentation from dry-rb.org into the dry-transaction README (or alternatively, a set of markdown files in a docs/ dir)
  • Add some examples of using dry-monads Do notation as a replacement for dry-transaction
  • Add a notice to the top of dry-transaction's README stating that active maintenance and development within within the dry-rb project has ceased, and that the project can be forked and renamed if anyone wishes to create a successor.
  • Release 1.0.0
  • Remove dry-transaction from dry-rb.org, and add a redirect from dry-rb.org/gems/dry-transaction to the README of this repo

The purpose of this issue is to track all these steps.

If you have any questions, feel free to reach out on https://discourse.dry-rb.org!

@michaelherold

This comment has been minimized.

Copy link

@michaelherold michaelherold commented Jul 13, 2019

A nice-to-have would be clear, concise examples for how to replicate the behavior of the different dry-transaction step adapters in Do Notation. For example, tee is very useful. I'm not sure if it's able to be 100% implemented in Do Notation, can it? A naive implementation would be something like:

class MyCommand
  include Dry::Monads::Result::Mixin
  include Dry::Monads::Do.for(:call)

  def call(params)
    values = yield validate(params)
    yield log(params)
    Success(values)
  end

  def validate(params)
    # ...
  end

  def log(values)
    Logger.new.info(values)
    Success(values)
  end
end

That seems like it would be right? It's a little clumsy though.

What do you think?

@timriley

This comment has been minimized.

Copy link
Member Author

@timriley timriley commented Jul 14, 2019

@michaelherold this is a good idea, I'll add it to the TODO list in the main issue body above.

As for replicating the tee behaviour, I don't think we need to do anything so special, it's just this:

def call(params)
  values = yield validate(params)
  
  # nothing special, just a plain old method call
  log(params)

  # do more steps here
end
@no-reply

This comment has been minimized.

Copy link

@no-reply no-reply commented Oct 1, 2019

Is this something there's interest in following through on?

A few times now I've had folks react with confusion when I mention that I'm not developing dependent code anymore, since there's no mention(?) of development being phased out in the README or on dry-rb.org

no-reply added a commit to samvera/hyrax that referenced this issue Oct 15, 2019
This is a first hack at `Dry::Transaction`-like behavior with Do notation.

See: dry-rb/dry-transaction#127
and: https://dry-rb.org/gems/dry-monads/1.0/do-notation/
@jdickey

This comment has been minimized.

Copy link

@jdickey jdickey commented Oct 30, 2019

Move dry-transaction documentation from dry-rb.org into the dry-transaction README (or alternatively, a set of markdown files in a docs/ dir)

I'd vote for the separate-docs-directory approach; a quick-and-dirty render-everything-in-a-single-Markdown-file experiment yielded a ~480-line, seven-and-a-half-rendered-pages (on a large monitor) file that felt far clunkier than the existing docs. I've added an item to my personal TODOs to write a PR for this sometime next week, health and time permitting.

I agree enthusiastically with the overall point of this issue; do notation is a far more flexible, low-DSL way to get the job done.

@graudeejs

This comment has been minimized.

Copy link

@graudeejs graudeejs commented Nov 15, 2019

FYI, link to Do Notation is broken in description of the issue. It should be something like: https://dry-rb.org/gems/dry-monads/1.0/do-notation/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.