These are chat archives for dry-rb/chat

9th
Sep 2016
John Backus
@backus
Sep 09 2016 00:25
@solnic dry-rb/dry-types#141 is up :)
John Backus
@backus
Sep 09 2016 00:44
@solnic I can't remember if we decided on doing anything new in dry-struct land to move away from the constructor_type thing
Do you remember?
In other words, are there other features / blocking changes you are waiting on for dry-struct / dry-types from me or should I dive into trying to resolve duplication for the hash schemas?
John Backus
@backus
Sep 09 2016 00:51
Darn time zones
Piotr Solnica
@solnic
Sep 09 2016 00:53
Let's leave constructor type for now until we figure out something nicer
John Backus
@backus
Sep 09 2016 00:54
kk
So to confirm you're not waiting on any other feature changes for dry-struct?
John Backus
@backus
Sep 09 2016 01:04
Ah I guess there is some work to be done with dry-logic being updated?
John Backus
@backus
Sep 09 2016 01:20
This message was deleted
It breaks dry-struct at least because it seems like the constrained type doesn't have a #failure method
John Backus
@backus
Sep 09 2016 01:25
I might be wrong though because the dependencies on dry-struct might still be out of sync
John Backus
@backus
Sep 09 2016 01:39
omg its because of a method_missing thing from the decorator
Boooo
:laughing:
In all seriousness, if method_missing is absolutely necessary then it would be nice to have SOME way of knowing that the failure reason is that a decorated type is not upholding its contract
But better would be to just not use method_missing
John Backus
@backus
Sep 09 2016 01:44
Ruby provides nicer tools out of the box for decoration like SimpleDelegator and DelegateClass
also Forwardable
John Backus
@backus
Sep 09 2016 06:28
k @solnic I'm not really sure how to update Dry::Struct to work with this dry-logic stuff
Would be faster for you to address I think
John Backus
@backus
Sep 09 2016 07:50
Eh ok I think I finally got stuff working
I'll just leave all of this as the sad lonely log of me debugging dry struct ^
Wilson Silva
@wilsonsilva
Sep 09 2016 08:12
@solnic it is good now
John Backus
@backus
Sep 09 2016 10:22
k the deduplication of the hash schemas is proving to be pretty tough so I'm going to extract some smaller PRs that might make it easier down the road
Piotr Solnica
@solnic
Sep 09 2016 10:57
@backus been there done that (and given up) :laughing:
John Backus
@backus
Sep 09 2016 10:58
heh
@solnic baby step up for review dry-rb/dry-types#142
Piotr Solnica
@solnic
Sep 09 2016 10:59
@backus merged
John Backus
@backus
Sep 09 2016 11:00
:)
Piotr Solnica
@solnic
Sep 09 2016 11:00
btw I finished last issue for dry-v’s 0.10.0
final result: ActiveModel::Validations: 1575.7 i/s - 5.64x slower :laughing:
John Backus
@backus
Sep 09 2016 11:01
nice
thats awesome
Piotr Solnica
@solnic
Sep 09 2016 11:07
Screen Shot 2016-09-09 at 13.06.37.png
^^ looks pretty straightforward :) that’s a profile of rule execution via dry-v
Piotr Solnica
@solnic
Sep 09 2016 11:18
@backus just managed to update icelab’s Berg app w/o any issues
John Backus
@backus
Sep 09 2016 11:18
Awesome
Do they use dry struct with constructor types?
Man these hash schemas
Tough
Piotr Solnica
@solnic
Sep 09 2016 11:20
inorite :D
John Backus
@backus
Sep 09 2016 11:22
I keep thinking I found a way to move things around to reduce duplication
and then one of the edge cases doesn't fit in
Piotr Solnica
@solnic
Sep 09 2016 11:22
yeah it’s tricky stuff as I mentioned
John Backus
@backus
Sep 09 2016 11:22
Should just deprecate :symbolized :P
Would make it easier
I'm joking
Piotr Solnica
@solnic
Sep 09 2016 11:22
haha
well, it’s a very crucial schema type you know that :)
John Backus
@backus
Sep 09 2016 11:23
heh
John Backus
@backus
Sep 09 2016 11:49
Oh I might actually have something for the schemas lol
work in progress if the commits don't make that obvious lol
Just LMK if you think that is moving in the right direction
Piotr Solnica
@solnic
Sep 09 2016 12:06
@backus looks good, although I’m a bit worried about perf impact of this :)
John Backus
@backus
Sep 09 2016 12:13
Which part?
It avoids a lot of exception for control flow
So that should be beneficial
I'm fine with tweaking it for perf and forgetting it altogether if it's like 10+% slower
Piotr Solnica
@solnic
Sep 09 2016 12:21
sure
Wilson Silva
@wilsonsilva
Sep 09 2016 19:38
dry-system doesn't seem to like modules and nested modules
for auto-import
Piotr Solnica
@solnic
Sep 09 2016 19:38
@wilsonsilva what do you mean?
Wilson Silva
@wilsonsilva
Sep 09 2016 19:39
I'm going to create a gist to exemplify my issue. I've tried many different configurations but it always seems to ignore my modules and folder structure.
Piotr Solnica
@solnic
Sep 09 2016 19:40
@wilsonsilva best to report an issue
this way I won’t forget :)
Wilson Silva
@wilsonsilva
Sep 09 2016 19:43
let's see if is just an issue or a misunderstanding
Dry::System::FileNotFoundError: could not resolve require file for models.gender
I get that error when I do Embryo::App.finalize!
Piotr Solnica
@solnic
Sep 09 2016 21:30
@wilsonsilva make sure Embryo::App.config.root is correct
Wilson Silva
@wilsonsilva
Sep 09 2016 22:36
Screen Shot 2016-09-09 at 23.34.49.png
Thanks. I will try different strategies to find out what is wrong. Do you think that this might be a bug?
Piotr Solnica
@solnic
Sep 09 2016 23:23
Path must be absolute in such cases
@wilsonsilva ^^
John Backus
@backus
Sep 09 2016 23:51
:( Yeah big perf impact from yielding a block in the hash schema refactoring
Ugh