dry-rb / dry-rails

The official dry-rb railtie
https://dry-rb.org/gems/dry-rails
MIT License
270 stars 27 forks source link

Add support for dry-system 0.20.0 #48

Closed zlw closed 2 years ago

zlw commented 3 years ago

👋 Hi all,

Follow up on discussion on dry-rb discourse

This PR makes all necessary changes to support latest dry-rb stack (namely, dry-system 0.20.0)

Thanks for the feedback 🙇‍♂️

alex-lairan commented 3 years ago

Tested with my company app, everything work like a charm and removes all deprecation warning :heart_eyes:

zlw commented 2 years ago

@jodosha @timriley 👋 I saw that you had PRs with attempts at this before, maybe you could give it a look? 😄

vsuhachev commented 2 years ago

AutoRegistrar#relative_path private method was removed and app-based dirs not worked with dry-system v0.20

https://github.com/dry-rb/dry-system/commit/68827f98aaa1bf4a14a9ebac602499a9544538e8#diff-fc89812a49544a3a1113c3308b12512ee9073599a471c5ed1d0f3aa20a3a4341

vsuhachev commented 2 years ago

BTW, this fixes the problem

require "dry/system/loader/autoloading"

Dry::Rails.container do
  config.component_dirs.add "app/operations" do |dir|
    dir.loader = Dry::System::Loader::Autoloading
  end
end
jodosha commented 2 years ago

@zlw Sorry, I don't have enough knowledge to judge this code, not an app to test the changes.

timriley commented 2 years ago

Sorry for the delay folks, I should be able to look at this next week. In the meantime I'll be doing another dry-system release, so hopefully that makes for the smoothest order of changes here :)

pusewicz commented 2 years ago

@timriley Hey! Is there anything we can help with to push this forward?

solnic commented 2 years ago

@pusewicz 👋🏻 I'll help with getting this merged in and released

solnic commented 2 years ago

@pusewicz done https://github.com/dry-rb/dry-rails/releases/tag/v0.4.0

pusewicz commented 2 years ago

@zlw & @solnic Thanks!