klmr / box

Write reusable, composable and modular R code
https://klmr.me/box/
MIT License
862 stars 48 forks source link

Explore infrastructure requirements to allow nesting modules inside packages #292

Open klmr opened 2 years ago

klmr commented 2 years ago

Please describe your feature request

Can the following ever work?

box::use(foo/bar)

Loads a module bar that’s defined inside the package foo.

Open questions

What happens when users say library(foo) (or indeed loadNamespace("foo"))? Is there some boilerplate code inside the package that (a) forbids this, (b) does nothing or (c) provides an alternative way of interacting with the modules nested under ‘foo’?

How does this work with the existing R package infrastructure (testing, checking, vignette building, static analysis/‘codetools’)?

(Why) is this desirable? (In particular: people like packages because of the convenience afforded by the infrastructure around packages, but what part of this are we giving up by having the code inside the package hidden away in submodules?)

How ergonomic is this? — Both for the users of the package as well as the developers of it?

Requirements

klmr commented 2 years ago

See also #216.