老插件迁移
Change the edges, not the internal business logic.
# Migration Overview
Inventory routes, hooks, callbacks, resources, data, configuration and lifecycle behavior. Separate business rules from Xiuno integration glue. Preserve intended behavior through a package adapter; do not restore the old runtime.
# Hook → Event
Replace a hook callback with a host-owned typed event and an onEvent() declaration. Normalize input at the host edge.
# Lifecycle Migration
Move install and upgrade work into ordered immutable migrations. Use lifecycle handlers only for bounded package effects.
# Data Migration
Adopt a validated immutable snapshot, normalize deterministically, then use only package-owned storage. Repeating adoption must not duplicate results.
# sa_rem Case Study
sa_rem preserves sponsor management, expiry/order rules, settings and views while replacing Xiuno tables/config coupling with declared migration input, scoped services and a narrow adapter boundary.