These are chat archives for dry-rb/chat

Jan 2018
Spencer Goh
Jan 30 2018 10:48
question on Dry::System::Settings::Configuration the Dry::Struct constructor_type is hardcoded to :strict_with_defaults I'm registering a component with passed in config, however for any missing values, I want the underlying concrete implementation class to decide the actual defaults. However settings { } doens't allow missing keys
Piotr Solnica
Jan 30 2018 10:54
@dymaxionuk this will be addressed in next dry-system version
Spencer Goh
Jan 30 2018 10:54
Dry::System.register_component(  blah ) do
  settings do 
    key :my_param, Types::String.optional

  start do
    register :my_component,

I'd like ComponentImpl to set master/failsafe defaults

@my_param = config[:my_param] ||   "Some default value"

I that logic doesn't really belong in Dry::System component registration.

aah ok thanks @solnic :smile:

also dry-web-roda I'm not a big fan of fact that it creates such a deep nested namespace for subapps.

I want my subapps to be easily exportable, and pulled out later, so starting with monolith first, then pulling out apps into micro-services later.
problem is the namespace of the subapps is polluted with the master app that it currently lives in.

I noticed in berg-master subapps you don't nest the subapp inside the berg namespace.

is there any plan to make some configurable namespace option to the thor generator code?
Spencer Goh
Jan 30 2018 11:02
btw, just wanted to say I really like your dry-rb gems in general. I met Tim Riley at RedDotRubyConf 2016 and have since tried out your gems and like where they are going. Thanks !
Piotr Solnica
Jan 30 2018 11:03
@dymaxionuk we'll be making namespacing more flexible in dry-system 1.1
also, I don't recall using umbrella app namespace in sub-apps, we don't do it
Spencer Goh
Jan 30 2018 11:12
I just checked.. the umbrella is mandatory, and the web example puts the master umbrella app into the namespace of subapp. however just realised if I give it value '' empty string.. it ollapses out the umbrella from the namespace
but can't just omit the umbrella param as command line validation kicks out the code gen :smile:
Piotr Solnica
Jan 30 2018 11:16
this surprises me
I consider referring to any umbrella constants from within a sub-app to be a code smell
the whole idea with subapps is that you can always a) move a subapp to a separate project b) turn lib into a shared gem c) have it work standalone OOTB
also, thanks for your kind words
Spencer Goh
Jan 30 2018 11:21
also have you ever got rack-unreloader working with dry-web-roda ? I got as far as patching reloader.rb#commit() method which blew up on log statement, but still couldn't get it working . didn't give much time to it yet, but just wondering if you had any reloader working?
I'm constrained by Windows at work, unfortunately, so can't use shotgun or other solutions :worried:

Re: subapp generation

dymaxion-mpb:dev tiger$ dry-web-roda generate sub_app test_subapp --umbrella test
      create  apps/test_subapp/lib/test/test_subapp/view/context.rb
      create  apps/test_subapp/lib/test/test_subapp/view/controller.rb
      create  apps/test_subapp/lib/test/test_subapp/views/welcome.rb
      create  apps/test_subapp/system/test/test_subapp/web.rb
      create  apps/test_subapp/system/test/test_subapp/container.rb
      create  apps/test_subapp/system/test/test_subapp/import.rb
      create  apps/test_subapp/system/boot.rb
      create  apps/test_subapp/web/routes/example.rb
      create  apps/test_subapp/web/templates/layouts/application.html.slim
      create  apps/test_subapp/web/templates/welcome.html.slim

if umbrella was optional that would be fine, as by default the subapp wouldn't be nested under [Test]

Spencer Goh
Jan 30 2018 11:30
actually the --umbrella '' hack doesn't work ! it messed up the codegen , with blank module names :)
anyway I'll await the next dry-system update with eager anticipation!
Andy Holland
Jan 30 2018 14:13
@dymaxionuk the idea with that is that everything is name-spaced under your organisation name, to prevent clashes, for example if you have a sub-app called Reporting it would define that as a top-level constant, I don't think that's a good practice personally, but I guess having the flexibility to do so isn't bad either