Add instance aliases and bump zipx to 0.10.0 - #93
Merged
Merged
Conversation
zipx 0.10.0 reads the project-level scalaVersion (sbt 2 common settings) instead of ThisBuild, so the catalog can move off the metabuild Scala without a ThisBuild pin. Drop that workaround and use LocalRootProject for docs paths that must stay at the repo root.
FSMRuntime.lookup resolves an InstanceIndex alias then reconstructs as today. In-memory, Postgres, and IndexedDB backends keep uniqueness; optional extractors bind before append so a clash does not persist the event.
Constructor parameters marked @alias become unique index keys. Namespace defaults to the field name; scalars, Option, and collections are supported. AliasCodec encodes values, with a low-priority toString given.
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.
Two pieces on one pre-release PR.
Instance aliases
Look up a persistent FSM by a unique secondary key (campaign id, template id) without changing recover-on-construct.
InstanceIndexmapsAlias(namespace, key)to instance id. Uniqueness is per namespace; rebind to the same id is a no-op; a clash isUniqueAliasError.FSMRuntime.lookup(alias, machine, initial)resolves then reconstructs. Missing aliases fail withAliasNotFoundError.AliasExtractordiffs aliases onGoto, binds beforeEventStore.append, unbinds after. Recover reindexes once from rebuilt state.fsm_aliases(per-table schema init so existing DBs pick it up), IndexedDBaliasesstore (DB version 2) plusSharedFSMRuntime.lookup.Verified:
core/testFull,postgres/testFull,webJS/testFull,docs/testFull,scalafmtCheckAll.zipx 0.10.0
Takes zipx 0.10.0, which fixes early-effect/zipx#156:
zipxCheckDepsnow reads the project-levelscalaVersion(sbt 2 common settings) instead ofThisBuild / scalaVersion.That lets the catalog move to Scala 3.9.0 without a
ThisBuildpin.MyVersions.settingsis enough.Also:
ThisBuild /from commonbuild.sbtsettings (sbt 2 injects those into every module)LocalRootProject / baseDirectoryso they stay at the repo root, notmechanoid-docs/zipxWorkflowCheckis green locally. Workflow YAML did not change.