These are chat archives for dry-rb/chat

15th
Mar 2016
Tim Riley
@timriley
Mar 15 2016 00:39
It’s a shame that GitHub reactions don’t show up on the mobile view.
Piotr Solnica
@solnic
Mar 15 2016 11:24
@timriley I just fixed these issues you reported in dry-v
Chris Richards
@cmrichards
Mar 15 2016 11:26
Hey, is there a blog post somewhere that shows how we might use this library as a replacement for virtus and how it's used in rails to do form objects?
Piotr Solnica
@solnic
Mar 15 2016 11:27
@cmrichards hey! there’s nothing special to do, a form schema replaces virtus + validations, that’s pretty much it
if you define a form schema with type expectations you’re gonna get coercions
I guess I need to hear specific questions in order to know what I should document, it’s very hard for me to figure this out on my own
Tim Riley
@timriley
Mar 15 2016 11:38
@solnic thanks! You’re fast!
Piotr Solnica
@solnic
Mar 15 2016 11:39
@timriley I’m releasing this stuff tomorrow mate, I had to be :D
Tim Riley
@timriley
Mar 15 2016 11:39
Glad I got to do some testing in time!
Piotr Solnica
@solnic
Mar 15 2016 11:43
yes, very helpful
after seeing/fixing those I’m really close to decide to remove nested keys syntax in favor of nested schemas, it would simplify the lib significantly
Tim Riley
@timriley
Mar 15 2016 11:45
Yeah, I think the nested schema feels more natural too, from a user’s perspective.
Piotr Solnica
@solnic
Mar 15 2016 11:46
yes, with nested schemas stuff like error processing becomes 10 x simpler, inferring type coercions becomes 10 x simpler too
it’s basically a very narrow functionality which is triggered recursively
right now we support both, and it’s crazy complex
FWIW I won’t be showing nested keys in docs anymore, only nested schemas
and I finally have to measure the actual perf difference heh
Piotr Solnica
@solnic
Mar 15 2016 11:51
@timriley any chance we could get call_sheet ported for tomorrow? would be sweet to launch the site with it :)
Tim Riley
@timriley
Mar 15 2016 11:52
I would totally love to do that. I’m travelling tomorrow so I won’t be working. I could try doing it now though...
But it’s 11pm :grimacing:
Chris Richards
@cmrichards
Mar 15 2016 11:52
Tim Riley you in Australia?
Tim Riley
@timriley
Mar 15 2016 11:53
@cmrichards yep.
Chris Richards
@cmrichards
Mar 15 2016 11:53
Ha
My powers of deduction are strong today
Piotr Solnica
@solnic
Mar 15 2016 11:54
haha
Tim Riley
@timriley
Mar 15 2016 11:55
I realised that becoming dry-transaction has some effects on the API, since I already have a CallSheet::Transaction class
So I’d probably have to drop the CallSheet() constructor, and make it Dry::Transaction.define() or something.
maybe .build()
Thoughts?
timriley @timriley is taking a quick stab at porting code now.
Tim Riley
@timriley
Mar 15 2016 11:58
I suppose Dry::Transaction::Transaction isn’t the worst...
Piotr Solnica
@solnic
Mar 15 2016 11:58
Dry.Transaction do … end
and have Dry::Transaction::Steps or sth
Tim Riley
@timriley
Mar 15 2016 11:59
That works well enough.
Dry::Transaction::Sequence
Piotr Solnica
@solnic
Mar 15 2016 12:04
:+1:
Andy Holland
@AMHOL
Mar 15 2016 12:16
@nepalez @marshall-lee are you guys doing anything with dry-function?
Vladimir Kochnev
@marshall-lee
Mar 15 2016 12:17
@AMHOL yeah, i'm still preparing it, sorry
Andy Holland
@AMHOL
Mar 15 2016 12:17
@marshall-lee that's cool, was just checking whether we still needed the repo :+1:
Piotr Solnica
@solnic
Mar 15 2016 12:20
We gotta come up with better names for initializer/constructor
Any ideas? :trollface:
Tim Riley
@timriley
Mar 15 2016 12:21
dry-transaction specs are green!
Andy Holland
@AMHOL
Mar 15 2016 12:22
xD nice one
Andy Holland
@AMHOL
Mar 15 2016 12:36
Thanks @timriley, that was fast!
Tim Riley
@timriley
Mar 15 2016 12:36
Luckily it’s a small gem :)
Andy Holland
@AMHOL
Mar 15 2016 12:37
:D just the way we like them ;)
lol
Tim Riley
@timriley
Mar 15 2016 12:37
Indeed! haha
OK, I’m going to :zzz: now. Happy to have +1’ed the dry-universe tonight.
Andy Holland
@AMHOL
Mar 15 2016 12:38
Yeah, thanks for that Tim, night mate
Any ideas for dry-universe anyone? :p
Alexander Chernik
@achernik
Mar 15 2016 14:44

hi @solnic !

Dry::Validation.Schema.Form do
end

is giving me
LocalJumpError: no block given from /Users/achernik/.gem/ruby/2.3.0/bundler/gems/dry-validation-b027cfd67590/lib/dry/validation.rb:23:in `instance_exec'

ahh, got it, it seems like there's a typo in docs here http://dry-rb.org/gems/dry-validation/forms/
should be Dry::Validation.Form
Piotr Solnica
@solnic
Mar 15 2016 14:52
@achernik ooops
Alexander Chernik
@achernik
Mar 15 2016 14:53
also new
configure do
   def custom_predicate?(value)
   end
end
isn't mentioned in docs
Piotr Solnica
@solnic
Mar 15 2016 14:57
Docs are not finished
So you will find some holes/mistakes there :)
Alexander Chernik
@achernik
Mar 15 2016 14:59
I can find anything I need in the spec suit :+1:
Piotr Solnica
@solnic
Mar 15 2016 15:32
@achernik that is good news
Piotr Solnica
@solnic
Mar 15 2016 16:15
Warming up --------------------------------------
         nested keys   390.000  i/100ms
       nested schema   308.000  i/100ms
Calculating -------------------------------------
         nested keys      3.916k (± 3.4%) i/s -     19.890k
       nested schema      3.093k (± 5.0%) i/s -     15.708k

Comparison:
         nested keys:     3916.4 i/s
       nested schema:     3092.7 i/s - 1.27x slower
uhm, that’s not a huge perf diff
Alexander Chernik
@achernik
Mar 15 2016 17:01
Have you considered displaying lookup keys when raising Dry::Validation::MissingMessageError? It would significantly reduce time spent "debugging" yaml files with error messages :)
Piotr Solnica
@solnic
Mar 15 2016 17:54
@achernik I haven’t but it’s a good idea
Piotr Solnica
@solnic
Mar 15 2016 18:04
I just updated dry-v docs and added more info, please check it out: http://dry-rb.org/gems/dry-validation/ /cc @achernik
Fran Worley
@fran-worley
Mar 15 2016 18:10
@solnic I'll test and update the AR comparison guide tonight. Just so I know what are your plans For a general number Predicate? The numericality part of my original guide was always a bit of a mess and it would be good to point people in the direction of best practise.
Piotr Solnica
@solnic
Mar 15 2016 18:11
@fran-worley thanks that’s great
I plan to add number? predicate :)
Fran Worley
@fran-worley
Mar 15 2016 18:17
@solnic are you planning to add styling (bold headers and borders) to tables on the docs site or should I reformat the guide not to use them?
Piotr Solnica
@solnic
Mar 15 2016 18:18
@fran-worley we gotta remove tables
code blocks don’t work there and it’s messy
if we want to show things side-by-side maybe just use a <ul/> and we can style it properly
Fran Worley
@fran-worley
Mar 15 2016 18:54
That's fine I'll update it. Do you want markdown or HTML?
Piotr Solnica
@solnic
Mar 15 2016 18:54
markdown please, you can use html tags there too when md is missing some syntax
Fran Worley
@fran-worley
Mar 15 2016 18:55
Did not know that. Will do.
Andy Holland
@AMHOL
Mar 15 2016 22:10
If anyone gets a chance would it be possible to get some feedback on dry-rb/dry-rb.org#18
Piotr Solnica
@solnic
Mar 15 2016 22:10
@AMHOL I just reacted to it :D
Andy Holland
@AMHOL
Mar 15 2016 22:11
:) Loving the new reactions
I just force pushed it, so now you can add a negative reaction :laughing:
Forgot to save the file before I committed :p
Piotr Solnica
@solnic
Mar 15 2016 22:12
no worries :)