Zeitwerk ergonomics question:
Say that I have a pack path like `packs/parent/child/app/models/grandchild.rb`
Most files today would define that as:
class Grandchild < ApplicationRecord; end
....but I would prefer it _also_ supports:
class Parent::Child::Grandchild
(inline nesting for space)
Say that I have a pack path like `packs/parent/child/app/models/grandchild.rb`
Most files today would define that as:
class Grandchild < ApplicationRecord; end
....but I would prefer it _also_ supports:
class Parent::Child::Grandchild
(inline nesting for space)
Comments
packs/parent/child/app/models/parent/child/grandchild.rb
This feels redundant, as the pack path already informs this.
That means we have three cases here, two supported and one I want to work.
`packs/parent/child/app/models/grandchild.rb` (class Grandchild)
2. Double Nesting
`packs/parent/child/app/models/parent/child/grandchild.rb` (class Parent::Child::Grandchild)
3. Implied Nesting
`packs/parent/child/app/models/grandchild.rb` (class Parent::Child::Grandchild)
cc @fxn.bsky.social
What made me consider that? Shared names lead to unintended monkeypatching because everything is top level, but fixing that is involved and completely changes hierarchy.
You cannot have 1 and 3 at the same time in the same subtree, but you could have app/models2 during the transition.
1. packs/a
2. packs/b
...in which I can make `packs/a` work with namespaces and `packs/b/` is unaffected?