Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 17:32
    reedlaw starred dry-rb/dry-types
  • 11:31
    timriley synchronize #155
  • 11:31

    timriley on rich-component-dirs-config

    Clarify names Fixup naming Total messy WIP (compare)

  • Dec 02 22:38
    diegocasmo starred dry-rb/dry-initializer
  • Dec 02 17:58

    flash-gordon on wrapper-type

    Add wrapper type It's a POC of… (compare)

  • Dec 01 23:13
    hguerrerojaime synchronize #154
  • Dec 01 05:18
    timriley opened #155
  • Dec 01 05:10

    timriley on rich-component-dirs-config

    Fix wording of spec Add Rubocop rule Start getting component_dirs in… and 3 more (compare)

  • Nov 29 13:21
    flash-gordon commented #130
  • Nov 29 13:19
    flash-gordon commented #130
  • Nov 29 10:29
    bigsolom commented #87
  • Nov 29 07:42

    flash-gordon on master

    Add note about Do::All caveat … Merge pull request #134 from ma… (compare)

  • Nov 29 07:42
    flash-gordon closed #134
  • Nov 29 07:42
    flash-gordon commented #134
  • Nov 29 07:37
    flash-gordon closed #130
  • Nov 29 07:37
    flash-gordon commented #130
  • Nov 28 22:36

    dry-bot on master

    [devtools] sync (compare)

  • Nov 28 22:35

    flash-gordon on keep-method-visibility

    (compare)

  • Nov 28 22:35

    flash-gordon on master

    Add specs that demonstrate the … When wrapping methods, be expli… Visbility-preserving API for Do… and 3 more (compare)

Hannes Nevalainen
@kwando
hola!
Piotr Solnica
@solnic
how would you call an object that is a result of running validation?
@AMHOL @timriley ^^ ???
hola @kwando :)
leaning towards Schema::Outcome
Hannes Nevalainen
@kwando
whats wrong with Schema::Result?
Piotr Solnica
@solnic
we have Validation::Result already
which is a result-per-rule
and we have Validation::Result::Set which is a result per rule-set
I actually need another concept, an array of result objects
no idea how to call it either
ok I know what to do
Tim Riley
@timriley
“Result” seems most natural, but since it’s already in use, “Outcome” isn’t too bad.
Piotr Solnica
@solnic
Validation::Result will become the enumerable containing Result::Value and Result::Set
Tim Riley
@timriley
“Product” is another possibility but it’s a term that’s already too loaded
Piotr Solnica
@solnic
question is, how to call abstract class for value and set lol
damn
it’s gonna be silly to have Schema::Result containing a…validation result
NAMING
;(
otoh it should be private
we want access to successes and failures
@timriley btw how does successes sound?
Tim Riley
@timriley
Sounds fine to me.
Piotr Solnica
@solnic
ok :)
Tim Riley
@timriley
It’s clear.
Piotr Solnica
@solnic
I’m about to break things /cc @timriley @kwando
timriley @timriley stops upgrading ;)
Piotr Solnica
@solnic
schema.messages(input) => schema.(input).messages
YOU CAN UPGRADE USING sed OK?!
Tim Riley
@timriley
oh, this is a nice upgrade!
Piotr Solnica
@solnic
almost there with refactor
Piotr Solnica
@solnic
so, for fun, I stubbed I18n in AM::V and ran the benchmark
Calculating -------------------------------------
ActiveModel::Validations
                       628.000  i/100ms
      dry-validation     1.948k i/100ms
-------------------------------------------------
ActiveModel::Validations
                          5.933k (± 1.5%) i/s -     30.144k
      dry-validation     20.386k (± 7.6%) i/s -    103.244k

Comparison:
      dry-validation:    20385.8 i/s
ActiveModel::Validations:     5932.6 i/s - 3.44x slower
this is AM::V WITHOUT COERCION AND WITHOUT I18n
BUT
dry-v is WITH coercion and WITH message compilation
and it’s ~3.5x faster :joy:
Tim Riley
@timriley
:tada:
Piotr Solnica
@solnic
@timriley @AMHOL dryrb/dry-validation#23
as discussed with Andy we will be able to configure error compiler per schema, so ie you can set up a schema with I18n-compatible compiler and your localized errors will be used
Tim Riley
@timriley
This makes a lot of sense.
Piotr Solnica
@solnic
there’s a bit more to it, but it’s a bigger subject: validation hints :)
in the near future we’re gonna have a way to generate user-friendly representation of validation rules, even for those that were not used in the validation process
Tim Riley
@timriley
Yeah, that sounds handy!
Piotr Solnica
@solnic
so ie when you have age.int? & age.gt?(18) and it turned out to be an empty string we still need to provide meaningful info to the user
since we have access to all the rules we can simply use the same technique to produce validation hints (as I call it)
we can automatically drop type expectations, since it’s too low level IMO, and just do things like gt?(18) => “age must be greater than 18”
Tim Riley
@timriley
Wonderful :)
Piotr Solnica
@solnic
we can actually be pretty precise here, and take into consideration whether or not a value was present