Skip to content

Evolution vignette and compat lab - #731

Merged
hadley merged 25 commits into
mainfrom
evolution-vignette
Oct 6, 2026
Merged

hadley merged 25 commits into
mainfrom
evolution-vignette

Conversation

@hadley

@hadley hadley commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

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.

hadley added 4 commits July 27, 2026 17:01
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.
Describes intended behavior once #726, #727, #728, #729, #730, and the
abstract-parent fix on #717 are implemented, with a prominent TODO linking
to each issue so the text can be reconciled (and the lab re-run) as each
fix lands.
…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
hadley marked this pull request as draft July 27, 2026 22:57
hadley added 3 commits July 30, 2026 17:27
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.
t-kalinowski and others added 10 commits September 28, 2026 11:49
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.
Update #731's design review and package compatibility results against the
corrected lifecycle caller lookup. Describe installed direct property
defaults as a documented rebuild requirement, with regression coverage in
#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.
hadley added 3 commits October 6, 2026 15:40
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).
@hadley
hadley marked this pull request as ready for review October 6, 2026 20:48
hadley added 5 commits October 6, 2026 17:01
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.
@hadley
hadley merged commit 7c56e79 into main Oct 6, 2026
15 checks passed
@hadley
hadley deleted the evolution-vignette branch October 6, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evolution vignette

2 participants