rails icon indicating copy to clipboard operation
rails copied to clipboard

Explore ways to reload gems

Open fxn opened this issue 2 months ago • 0 comments

(Discussion started in https://github.com/fxn/zeitwerk/issues/287.)

The purpose of this ticket would be to explore ways to let Rails reload some gems. This could be useful if the gem is being actively developed.

The documentation of Zeitwerk warns this may be tricky:

In a given process, ideally, there should be at most one loader with reloading enabled. Technically, you can have more, but it may get tricky if one refers to constants managed by the other one. Do that only if you know what you are doing.

In the proposed use case, the application refers to constants in the gem, and the gem does not refer to constants from the application. This is important.

/cc @matthewd

fxn avatar Feb 25 '24 11:02 fxn