Cleans up the section about exporting S3 methods for non-owned generics to recommend using exportS3Method in all scenarios (hard and soft dependencies).
For generics owned by hard dependencies (ie Depends and Imports), this previously described a workflow that required importing the generic into the NAMESPACE so that the method could be exported via @export - it seems like this can be skipped and we can use @exportS3Method directly in this scenario.
For generics owned by soft dependencies (ie Suggests), this described a methodology around registering S3 methods onLoad(), and suggested an s3_register() function that needed to be included in the package body. This is no longer required as of R 3.6, which now interprets the S3method() directive in NAMESPACE to automatically register the method on dependency load. This means we can use @exportS3Method for this scenario as well, and remove the section on conditional/delayed load entirely.
I'm unsure if it would be worth mentioning how to handle things for pre R3.6 (and hide the deleted section in a collapsed details block?) - R 3.6 is quite old now.
Closes #1032 and closes #1082.
Cleans up the section about exporting S3 methods for non-owned generics to recommend using
exportS3Method
in all scenarios (hard and soft dependencies).For generics owned by hard dependencies (ie
Depends
andImports
), this previously described a workflow that required importing the generic into the NAMESPACE so that the method could be exported via@export
- it seems like this can be skipped and we can use@exportS3Method
directly in this scenario.For generics owned by soft dependencies (ie
Suggests
), this described a methodology around registering S3 methodsonLoad()
, and suggested ans3_register()
function that needed to be included in the package body. This is no longer required as of R 3.6, which now interprets theS3method()
directive in NAMESPACE to automatically register the method on dependency load. This means we can use@exportS3Method
for this scenario as well, and remove the section on conditional/delayed load entirely.I'm unsure if it would be worth mentioning how to handle things for pre R3.6 (and hide the deleted section in a collapsed details block?) - R 3.6 is quite old now.