Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 22 09:25
    masroorhussainv starred dry-rb/dry-monads
  • Oct 22 08:41
    zgid123 starred dry-rb/dry-auto_inject
  • Oct 22 08:39
    zgid123 starred dry-rb/dry-monads
  • Oct 19 21:13
  • Oct 19 07:15
  • Oct 18 11:05
    timriley synchronize #181
  • Oct 18 11:05

    timriley on explicit-two-way-component-dir-namespaces

    Introduce component dir namespa… Add initial user docs for compo… Rename component_for_identifier… and 8 more (compare)

  • Oct 14 17:35
    patrickgramatowski starred dry-rb/dry-types
  • Oct 14 12:15
    timriley synchronize #181
  • Oct 14 12:15

    timriley on explicit-two-way-component-dir-namespaces

    Reboot RSpec setup Use the sta… Introduce component dir namespa… Add initial user docs for compo… and 9 more (compare)

  • Oct 14 12:08
    timriley synchronize #181
  • Oct 14 12:08

    timriley on explicit-two-way-component-dir-namespaces

    Reboot RSpec setup Use the sta… Introduce component dir namespa… Add initial user docs for compo… and 9 more (compare)

  • Oct 14 12:07

    timriley on remove-unused-errors

    (compare)

  • Oct 14 12:07

    timriley on master

    Remove unused errors Merge pull request #194 from dr… (compare)

  • Oct 14 12:07
    timriley closed #194
  • Oct 14 12:05
    timriley synchronize #194
  • Oct 14 12:05

    timriley on remove-unused-errors

    Remove unused errors (compare)

  • Oct 14 12:05
    timriley review_requested #194
  • Oct 14 12:05
    timriley opened #194
  • Oct 14 12:05

    timriley on remove-unused-errors

    Remove unused error (compare)

Nikita Shilnikov
@flash-gordon
though it can have types that dups and freezes values
list of types I mean
like strict but frozen of something
/cc @solnic
Gustavo Caso
@GustavoCaso
Something in the lines of Types::Freeze::Array
Markus Unterwaditzer
@untitaker
What do you think about having Types::Strict::Array.frozen as constructor?
I'm wishing for something that would automatically load that constructor for me in any dry-struct (since I want everything in my models to be immutable without me explicitly specifying it for each attribute)
Also not sure what to do with coercible types etc... you'd need Types::CoercibleFrozen, Types::StrictFrozen, ...
Nikita Shilnikov
@flash-gordon
you probably want to benchmark it. Anyway, we won’t add a new method to the API because it affects everything
you can just redefine Struct.attribute to make it work the way you want
Markus Unterwaditzer
@untitaker
This message was deleted
isn't the entire point of using dry-struct to have everything as immutable?
Gustavo Caso
@GustavoCaso
I think using dry-struct is to have something like a value object
Or application data if you will
Represent something from your system
But I’m sure @flash-gordon will be able to provide a better answer
Markus Unterwaditzer
@untitaker
well if that's all there is to it I might as well keep on using activemodel ;)
Nikita Shilnikov
@flash-gordon
you certainly can
dry-struct by itself doesn’t provide an interface for mutating attributes
as in, setters
but it doesn’t do anything with values
Markus Unterwaditzer
@untitaker
I was just being facetious. My point is that I am using dry-struct not because it doesn't support mutation, but because it prevents it
Nikita Shilnikov
@flash-gordon
it’s not the point
Markus Unterwaditzer
@untitaker
or at least I thought it did
Nikita Shilnikov
@flash-gordon
you don’t need a mutable interface, that’s why you don’t get it
Markus Unterwaditzer
@untitaker
right, I'm not asking for a mutable interface
Nikita Shilnikov
@flash-gordon
but if you're using other ruby primitives, such as arrays and strings, they're mutable
but since they're more efficient we stick to them
otherwise we would have to go with our own
or freezing everything which is, as I mentioned, is slow
so what we do instead is discouraging
from mutating values
Markus Unterwaditzer
@untitaker
I'll figure something out. But thanks.
Nikita Shilnikov
@flash-gordon
and if you want to enforce immutability it will cost you some performance but can do it
Markus Unterwaditzer
@untitaker
I might have underestimated runtime cost of freeze. I thought it could be O(1)
Nikita Shilnikov
@flash-gordon
I personally only watched a talk by @solnic where he measured this
tldr we just don't mutate anything thus don't have a problem with mutation :)
Piotr Solnica
@solnic
it is too slow, deep freezing kills perf. Do it only with memoized objects that are instantiates once per process
Gustavo Caso
@GustavoCaso
:clap: :clap:
Hamza Khan-Cheema
@hamzakc
Hi, Just a quick question. I am using dry-web-roda and making a API application. I am toying with a few ideas on how to test it. How do other people test API apps? I was playing with the idea of using bacon, but would like to use Rspec. Capybara is not really used to test API's so feature tests are out. The other option is just to use rack-test directly
Oskar Szrajer
@gotar
I use rack-test always
workings great
Hamza Khan-Cheema
@hamzakc
Thanks, I was leaning towards that as well.
you got any links on getting that working with dry-web by any chance
Hamza Khan-Cheema
@hamzakc
isn't that using RSpec
Oskar Szrajer
@gotar
i uses rack-tests too
for requests
I can extract you some tests from my projects