You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let extensions upgrade their own data via versioned @extensions (#403)
mizer could upgrade core slots across mizer versions, but extensions had
no hook to migrate their own data and no record of which extension version
last conformed an object. This adds per-extension version tracking and an
upgrade dispatch path so extensions can upgrade their objects independently
of the mizer version.
- The `@extensions` slot (now typed "ANY") may hold either the legacy named
character vector of requirement strings or a named list of
`c(requirement, version)` entries. `objectExtensions()` returns the
requirement-only view, so all dispatch/suffix logic is unchanged. New
helpers: `recordExtension()` (exported), `extensionRequirements()`,
`extensionVersions()`, `extensionVersion()`, `makeExtensions()`.
- `upgradeParams()`/`upgradeSim()` are now the `upgrade.MizerParams()` /
`upgrade.MizerSim()` methods of `utils::upgrade()`; the old names remain as
thin internal wrappers.
- `validParams()` orchestrates upgrades: it runs the core upgrade when
`@mizer_version` is stale, then `runExtensionUpgrades()` calls each
out-of-date extension's `upgrade` method directly (no `NextMethod()`) and
re-stamps it. `needs_upgrading()` now also fires on a missing or stale
extension stamp.
- `registerExtensions()` / `readParams()` / `requiredExtensionPackages()`
accept the versioned list form via the requirement view.
- Documented the pattern in the creating-extension-packages vignette and
added tests in test-extension-versions.R.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
warning("Your MizerParams object was created with an earlier version of mizer. You can upgrade it with `params <- validParams(params)` where you should replace `params` by the name of the variable that holds your MizerParams object.")
0 commit comments