atipugin / telegram-bot-ruby

Ruby wrapper for Telegram's Bot API
https://core.telegram.org/bots/api
Do What The F*ck You Want To Public License
1.35k stars 217 forks source link

Remove Zeitwerk #293

Closed AlexWayfer closed 1 year ago

AlexWayfer commented 1 year ago
  1. Less dependencies is better.
  2. Zeitwerk mutates requirements and loading globally. Usually it doesn't affect a project, which using this gem, but global mutation is still dangerous.

Firstly I've replaced it with require_relative, Dir[].each { require }, and little autoload (to resolve circular dependency).

Then I've decided to use autoload for everything.

What do you think?

atipugin commented 1 year ago

Not sure about this one. I added zeitwerk for convenience, to get rid of all those require calls. And dry-types already uses it anyway, so not a big win in terms of dependencies. Actually I've never had any problems with gems based on zeitwerk.

AlexWayfer commented 1 year ago

I added zeitwerk for convenience, to get rid of all those require calls.

As you can see, there are not a lot of require calls. And autoload works good for the large list of types.

And dry-types already uses it anyway, so not a big win in terms of dependencies.

Didn't know about that. Then yes, we're loosing the point…

Actually I've never had any problems with gems based on zeitwerk.

I feel uncomfortable when see third-party gems in exception call stack, especially for core features like require. But yeah, there are no problems (for now).


OK, since dry-types uses it, let's close this.