Changelog
[0.2.2] - 2026-11-25
Fixed
- Kotlin compilation failure: the three
StorageAdapterfields are nullable function types (the prerequisite for the bridge null guards); bare invocations ofadapter.get/adapter.set/adapter.removeingetStorageRaw/setStorageRaw/removeStorageRawgenerated non-null calls onFunction1<...>?in Kotlin, failing withReference has a nullable type 'Function1<...>?'. Use explicit '?.invoke'— all three call sites now narrow through a local val with a null check falling back to the default implementation (same pattern assetStorageAdapterImpl; Kotlin does not smart-cast fields)
[0.2.1] - 2026-11-24
Fixed
- Base-app runtime crash: under the base-app dynamic-dispatch runtime (UTSBridge method table), a plugin function returned by
createPersistPluginand passed back across the bridge as auseargument is materialized as UTSJSONObject, triggeringUTSJSONObject cannot be cast to UTSCallback— the documented 0.2.0 persistence-registration form fails to start on the base app
Added
- Bridge-safe plugin registration:
Pinia.usePersistPlugin(options)(chainable instance method) — keeps plugin construction and registration inside the plugin module to avoid that boundary;pinia.usePersistPlugin(options)is the recommended form for registering the persistence plugin,createPersistPluginis kept for pure-Kotlin direct-call scenarios StorageAdaptercallback fields are optional: null fields fall back to default uni storage behavior; the nullable declaration gives the bridge conversion null guards (same mechanism asPersistOptions.serializer)
[0.2.0] - 2026-10-31
Changed (breaking)
- Architecture upgrade: class + reactive: stores are now defined as
class XxxStore extends PiniaStoreBase— state wrapped in strongly-typedreactive<T>, derived values as class getters, actions as plain methods;defineStore<T>(id, factory)returns the useStore function - Setup-style APIs from 0.1.0 removed:
storeToRefs(reactive state is template-reactive directly, no destructuring needed), top-levelpatch(mutator)($patch(partial)is equivalent and type-safe),loadPersisted/savePersisted/getStorageKey(internalized by the built-in persistence plugin)
Added
- Full instance API:
$patch(partial)/$reset()/$subscribe(cb)/$onAction(cb)/$dispose()/$id/$state/$save()all available (driven by the three optionally-overridden Template Method hooks_doReset/_hydrate/_serialize) - Built-in persistence plugin:
createPersistPlugin(automatic restore on store creation, automatic_serializesnapshot save on$patch/$reset/$save) +clearPersistedState(clears one store's persisted data) - Persistence merged into the main package: the standalone ux-pinia-persist plugin is discontinued; swappable storage backend (
setStorageAdapter+StorageAdaptertype, uni storage by default, unix-storage / native preferences supported) - Verification: full suite passes on Web; Android cloud build (Kotlin toolchain, vapor mode) passes, on-device cases under re-verification
[0.1.0] - 2026-10-18
First public release.
Added
- Setup-style defineStore:
defineStore<T>(id, setup): () => T— state viaRef, getters viaComputedRef, actions via arrow functions; same-id duplicates warn and stay idempotent - Module-level singleton registry: app-lifetime stores shared across pages (verified on Web + Android)
- storeToRefs: template destructuring with auto-unwrapping
- Instance APIs as top-level functions:
patch(≙$patchmutator form) /dispose(≙$dispose) /getStoreId(≙$id) - Pinia instance & plugin system:
createPinia/setActivePinia/getActivePinia/pinia.use(plugin)(plugins return void — a UTS constraint) - Mount-free design: zero setup code for pure state management; plugins via top-level
setActivePinia(createPinia().use(plugin)) - Platform verification: vdom-mode Web and App-Android (Kotlin toolchain) full suites pass
Known differences
- Script state access requires
.value(UTS has no Proxy); templates auto-unwrap afterstoreToRefsdestructuring $subscribe/$onAction/$state/$patchobject form / Options-style defineStore are not supported — see "Differences from standard Pinia"
