Writing a non-package using box, and then converting to a package
- Dominant language
- R
- Stars
- 979
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I like the look of `box`, but one concern I have is that the documentation doesn't really talk about its use within *packages*. I'm wondering if the `box::use` statements will work if inside a published package, considering that (from my limited understanding of packages), the entire script is never actually executed for a package, but rather single functions are exported in isolation. If this is true, then it feels like box has a significant downside over a regular script, in that it makes migrating ad-hoc code into a package even harder. It's possible to write an ad-hoc script that doesn't use `library`/`require` at all, only ever uses `::`, and `@export`s functions where relevant, and then it is then quite trivial to migrate this into a package. But if `box` doesn't work with modules, then there is no simple way to write code in a module-compatible way. Migration into a package will involve removing all the `box::use` calls, and replacing `module$function` with `module::function`, which is not trivial via find and replace.
Do the authors have any thoughts on how to solve this problem? I want to use box to replace the use of `source`, because I'm not a fan of the way it works, but I don't want to also lose the easy migration to a package for all my code.
Contributor guide
Research direction
Start by reviewing the documentation for box::use, modules, and published packages, then compare the described package behavior with the existing library/require, ::, and source workflows. Done would be a clear, decided explanation of whether box::use works in packages and, if not, documented migration guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100