Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 05 17:01
    emaraschio starred dry-rb/dry-monitor
  • Apr 04 15:38
    nepalez closed #74
  • Apr 04 15:38
    nepalez commented #74
  • Apr 04 10:40
    qortex commented #400
  • Apr 04 08:47
    flash-gordon closed #400
  • Apr 04 08:47
    flash-gordon commented #400
  • Apr 03 21:18
    qortex starred dry-rb/dry-types
  • Apr 03 21:14
    qortex edited #400
  • Apr 03 21:14
    qortex labeled #400
  • Apr 03 21:14
    qortex opened #400
  • Apr 03 19:18
    landongrindheim commented #74
  • Apr 02 19:47
    kamilski81 starred dry-rb/dry-monads
  • Apr 02 17:26
    waleedasif322 starred dry-rb/dry-types
  • Apr 02 14:59
    sskylar starred dry-rb/dry-monads
  • Apr 02 13:51
    kirin121 starred dry-rb/dry-container
  • Apr 02 10:56

    davydovanton on performance-improvements-for-rack-monitorring

    (compare)

  • Apr 02 10:55

    davydovanton on master

    Improve memory allocation for R… Merge pull request #34 from dry… (compare)

  • Apr 02 10:55
    davydovanton closed #34
  • Apr 02 02:25
    DaiAoki starred dry-rb/dry-types
  • Apr 01 14:39
    davydovanton commented #34
Piotr Solnica
@solnic
will do
Andy Holland
@AMHOL
Cool :)
Piotr Solnica
@solnic
I’m thinking about an auto-loading container, where it infers deps from a dir structure
my container has grown into lots of things but it’s Foo.new in 90% of the cases
Andy Holland
@AMHOL
That would be interesting
If we had auto curry we could always new up and then just configure the arguments
Although i guess instantiation isnt always what you want
Piotr Solnica
@solnic
@AMHOL I don’t like two things in roda-flow
idea of controllers and messing with response object
Andy Holland
@AMHOL
Yeah, thats just in the example tbf, not actually part of the lib
Thats how i use ut tho
Piotr Solnica
@solnic
my motivation is to decouple my app’s code from 1) persistence 2) http stuff
Andy Holland
@AMHOL
Btw i used roda flow at work on a small, db hitting microservice, get 14ms response times
Piotr Solnica
@solnic
nice!
Andy Holland
@AMHOL
Perhaps i will see the light when i see your rodakase
Tim Riley
@timriley
Trying to stay ahead of the curve and use Dry::Data as a form attributes object
ended up needing to build a shim like this:
class FormAttributes < Dry::Data::Struct
  def self.new(attributes)
    schema_defaults = schema.keys.map { |key| [key, nil] }.to_h

    super(schema_defaults.merge(Hash(attributes)))
  end

  def [](attribute_name)
    send(attribute_name)
  end
end
Just so it's not so strict about missing values when initializing
and #[] in place so I can use it with a ROM::Model::Validator
Tim Riley
@timriley
Him, except I can't use a Dry::Data::Struct as an input for a ROM command
Tim Riley
@timriley
I handled it this way in the interim:
App.register "transformations.to_h" do |input|
  input.to_h
end

App.register("transactions.sign_up_customer") do
  CallSheet(container: App) do
    map :process, with: "attributes.customer_sign_up"
    try :validate, with: "validators.customer", catch: ROM::Model::ValidationError
    map :prepare_for_persist, with: "transformations.to_h"
    tee :persist, with: "persistence.commands.create_customer"
  end
end
Added a #to_h to that FormAttributes class and that prepare_for_persiststep in the business transaction.
Does not feel ideal, but it works for now at least ¯_(ツ)_/¯
Piotr Solnica
@solnic
@timriley I haven’t finish dry-data wrt web form handling
first cut of this lib is targeting defining domain data types, as the second step I was planning to work on form-specific logic (with custom builtin types/coercions dedicated for this concern)
Tim Riley
@timriley
@solnic yeah, I did see you mention something like this! I figured if we could get it going well enough as-is, then it'll be a nice transition later on to the built-in form handling stuff :)
Piotr Solnica
@solnic
@timriley I’ll be updating it very soon, just need to get the rodakase basic stuff up and running
Tim Riley
@timriley
No problems. I'll happily roadtest the thing for you.
Piotr Solnica
@solnic
@AMHOL would be nice to put together a roadmap for dry-* gems so that we can see the big picture and hopefuly get more people contributing; from my pov validation + data are currently number 1 prio, but there are also some things that we could improve in dry-container and auto_inject (actualy thinking about renaming it to dry-import)
ugh, sorry, I meant that number 1 prio is GETTING A LOGO FOR THE ORG :joy:
Andy Holland
@AMHOL
Lol, yeah, need to organise it more like ROM I guess
Piotr Solnica
@solnic
(byebug) view_class.config
#<struct engine=:slim, layout="app", template="users">
(byebug) Class.new(view_class).config
#<struct engine=nil, layout=nil, template=nil>
@AMHOL is this expected?
Andy Holland
@AMHOL
Hmm, nah, looks like a bug
Piotr Solnica
@solnic
@AMHOL it works with setting :foo, ‘bar’
this one will be inherited
but the configured settings won't
Andy Holland
@AMHOL
Ahh ok, i'll have a look tomorrow if thats ok?
Piotr Solnica
@solnic
no rush at all
Andy Holland
@AMHOL
Cool, going to meet friends for drinks soon
Andy Holland
@AMHOL
@solnic dryrb/dry-configurable@992d16a
Andy Holland
@AMHOL
@solnic dryrb/dry-container@7f905a6
Saw you mentioned that in a comment in Rodakase too
François Bernier
@fbernier
Hey, there is this API client at my workplace which uses Hashie::Mash and I don't like it. I am checking out dry-data. Looks like it could replace it right?
Piotr Solnica
@solnic
@fbernier kinda :) dry-data’s structs require you to define attributes
François Bernier
@fbernier
yeah that's mostly the part I want to replace.
Looks neat so I'll give it a try!
Piotr Solnica
@solnic
ok, that’s cool :) remember it’s very alpha though
I have big plans for this lib, but for now I’m busy with other stuff