Repository navigation
Evolution vignette and compat lab - #731
Merged
Merged
Conversation
A manually-run harness (tools/evolution/) that verifies what happens to a downstream package when an upstream S7 package changes its generics or classes. Groundwork for the evolution vignette (#143).
vignette("evolution") explains how to change S7 generics and classes
without breaking downstream packages, from the perspective of an upstream
author. Every claim is verified by the compat lab in tools/evolution/,
which now covers 20 scenarios including generic moves, deprecating
wrappers, and NAMESPACE re-export vs binding-copy re-exports.
release_bullets() reminds us to re-run the lab before each release.
Spun off during verification: #726, #727, #728, #729, and the
abstract-parent gap reported on #717.
…s.Rmd Designing for evolution now leads the evolution vignette, since it's the part every upstream author should read even if they never change anything. The new_external_class() bullet moves to packages.Rmd: it's advice for the downstream package, not for the upstream author.
hadley
marked this pull request as draft
July 27, 2026 22:57
# Conflicts: # .Rbuildignore # .gitignore
Regenerates tools/evolution/results.md against the merged fixes and rewrites the affected sections: * Consistency checks between generic and method now only run in development contexts (#726, #728), so pkgB's users no longer see the warnings, and the two error cases surface at run time rather than blocking installation. * Moving a generic to another package now works for an already-installed pkgB (#729). * An abstract external parent can be subclassed (#717), so making a class abstract no longer breaks downstream subclasses. Also corrects the claim that a method's default wins over the generic's: dispatch passes on the generic's formals, so the generic's default is what methods actually receive.
t-kalinowski
added a commit
that referenced
this pull request
Sep 28, 2026
Resolve foreign generic targets in their owning namespaces so deprecated exports share downstream method registrations after installation. Allow explicit replacement labels for class and generic aliases, preserve validators when retiring properties, and document rebuilding requirements and property-signaling limits. Add installed-package regressions for existing and rebuilt downstream packages, renamed class exports, and saved instances. These changes address the package-evolution scenarios exercised in PR #731.
Expand the package-upgrade lab to cover generic and class aliases, package moves, property deprecations, saved instances, and lifecycle signaling. Validate version-1 baselines, distinguish namespace loading from calls, skip tests after failed rebuilds, and support parallel scenario runs. Update the vignette for the helpers in #734 and document their compatibility limits and design gaps. Record all 40 scenarios against the tested revision and include the deprecation design review. Refs #731 and #734.
Use new_label for export renames that preserve class or generic identity, show how to retain validators when retiring properties, and describe namespace-based resolution when moving a generic between packages. Add compatibility scenarios for export labels, property validation, and equal-value property uses under each signaling policy. Refresh the lab results and distinguish supported transitions from the documented limits on installed subclasses, saved instances, and property initialization. Refs #731 and #734.
Update #731 to describe class deprecation that preserves the original type, with explicit replacement methods and migration boundaries. Expand the package compatibility lab to 59 scenarios, including custom constructors, saved objects, property defaults, and signaling policies. Record the props() lifecycle warning defect and the rebuild requirement for installed direct property defaults as follow-ups for #734.
Use direct deprecated_generic() definitions for retirement and exercise custom functions and copied definitions under all signaling policies. Record the installed-package scenarios against main and clarify when downstream definitions require rebuilding.
Restructure with a closing "Designing for evolution" section and summary table, rewrite the generic "When things break" section, add linked subsection lists and process lists to each change subsection, rename myPackage to yourPackage, map subsections to tools/evolution/logs directories, add a validator-warning example, and use new instead of replacement in deprecated_class() calls (requires upstream rename).
# Conflicts: # NEWS.md
hadley
marked this pull request as ready for review
October 6, 2026 20:48
One scenario per "Changing a ..." section of vignette("evolution"),
consolidating the exploratory deprecation scenarios. Delete
deprecation-review.md and summarize results in the README.
Point log references at the new per-section scenarios, and refresh examples whose rendered output was stale or misleading.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #143.
Adds
vignette("evolution")for authors changing S7 generics and classes that downstream packages extend. It explains install-time, load-time, and runtime coupling, compatible changes, and deprecation recipes. The packages vignette links to this guidance and explains what external class references resolve at runtime and what remains stored in installed subclasses.The deprecation guidance covers generic aliases, moves, and retirement; class recommendations that preserve the original identity; and property renames and retirement. It describes when downstream packages need rebuilding and which changes require explicit argument adaptation or saved-object migration.
Adds a manual compatibility lab with 64 scenarios that install real package pairs and compare baseline, upstream-only upgrade, and downstream rebuild behavior, with committed results and a deprecation design review. A release-checklist item prompts maintainers to rerun the lab and update the guidance when behavior changes. This PR changes documentation and developer tooling; it does not change S7 dispatch or construction behavior.