diff --git a/.changeset/handler-owned-initial-edges.md b/.changeset/handler-owned-initial-edges.md deleted file mode 100644 index 72865501..00000000 --- a/.changeset/handler-owned-initial-edges.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -"@typeonce/effect-machine": minor -"@typeonce/effect-machine-react": minor -"@typeonce/effect-machine-devtools": minor -"@typeonce/oxlint-plugin-effect-machine": minor ---- - -Declare initial edges and data together in `.handle`. Remove `initial` from `Machine.state`, remove `initial` and `initialConfiguration` from `Machine.make`, and move shared startup data into the root handler's `root` value or input callback. Each compound declares `initial: { target, data? }`; parallel handlers use an `initial` map of region data. Initial targets must be direct children and remain inspectable without executing constructors. - -```ts -const root = Machine.state({ states: { Locked: {}, Unlocked: {} } }) -const targets = Machine.targets(root) -const machine = Machine.make({ root, events: Machine.events({ Coin: {} }) }).handle({ - initial: { target: targets.root.Locked }, - states: { Locked: { on: { Coin: { target: targets.root.Unlocked } } } } -}) -``` - -Replace declarative `from` callbacks with `data`, which accepts literals or callbacks. Supply already-decoded values with `{ decoded: true, data: valueOrCallback }`. For root or region data that itself contains `decoded: true` and `data` fields, use a callback returning the ordinary schema input. Bound branch and history builders retain `.from` and `.decoded`. Replace command-producing `initialize` callbacks with `entry`/`exit` handlers or invocations; definitions become executable only after `.handle` captures their initial declarations. diff --git a/packages/devtools/CHANGELOG.md b/packages/devtools/CHANGELOG.md index f39a96b4..e8913ed0 100644 --- a/packages/devtools/CHANGELOG.md +++ b/packages/devtools/CHANGELOG.md @@ -1,5 +1,30 @@ # @typeonce/effect-machine-devtools +## 0.35.0 + +### Minor Changes + +- e72b7f5: Declare initial edges and data together in `.handle`. Remove `initial` from `Machine.state`, remove `initial` and `initialConfiguration` from `Machine.make`, and move shared startup data into the root handler's `root` value or input callback. Each compound declares `initial: { target, data? }`; parallel handlers use an `initial` map of region data. Initial targets must be direct children and remain inspectable without executing constructors. + + ```ts + const root = Machine.state({ states: { Locked: {}, Unlocked: {} } }); + const targets = Machine.targets(root); + const machine = Machine.make({ + root, + events: Machine.events({ Coin: {} }), + }).handle({ + initial: { target: targets.root.Locked }, + states: { Locked: { on: { Coin: { target: targets.root.Unlocked } } } }, + }); + ``` + + Replace declarative `from` callbacks with `data`, which accepts literals or callbacks. Supply already-decoded values with `{ decoded: true, data: valueOrCallback }`. For root or region data that itself contains `decoded: true` and `data` fields, use a callback returning the ordinary schema input. Bound branch and history builders retain `.from` and `.decoded`. Replace command-producing `initialize` callbacks with `entry`/`exit` handlers or invocations; definitions become executable only after `.handle` captures their initial declarations. + +### Patch Changes + +- Updated dependencies [e72b7f5] + - @typeonce/effect-machine@0.35.0 + ## 0.34.0 ### Minor Changes diff --git a/packages/devtools/package.json b/packages/devtools/package.json index 6a79d9c3..79529638 100644 --- a/packages/devtools/package.json +++ b/packages/devtools/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/effect-machine-devtools", - "version": "0.34.0", + "version": "0.35.0", "description": "Local development tools for Effect Machine", "author": "Sandro Maglione", "repository": { diff --git a/packages/effect-machine-react/CHANGELOG.md b/packages/effect-machine-react/CHANGELOG.md index 02b6fa09..588ac085 100644 --- a/packages/effect-machine-react/CHANGELOG.md +++ b/packages/effect-machine-react/CHANGELOG.md @@ -1,5 +1,30 @@ # @typeonce/effect-machine-react +## 0.35.0 + +### Minor Changes + +- e72b7f5: Declare initial edges and data together in `.handle`. Remove `initial` from `Machine.state`, remove `initial` and `initialConfiguration` from `Machine.make`, and move shared startup data into the root handler's `root` value or input callback. Each compound declares `initial: { target, data? }`; parallel handlers use an `initial` map of region data. Initial targets must be direct children and remain inspectable without executing constructors. + + ```ts + const root = Machine.state({ states: { Locked: {}, Unlocked: {} } }); + const targets = Machine.targets(root); + const machine = Machine.make({ + root, + events: Machine.events({ Coin: {} }), + }).handle({ + initial: { target: targets.root.Locked }, + states: { Locked: { on: { Coin: { target: targets.root.Unlocked } } } }, + }); + ``` + + Replace declarative `from` callbacks with `data`, which accepts literals or callbacks. Supply already-decoded values with `{ decoded: true, data: valueOrCallback }`. For root or region data that itself contains `decoded: true` and `data` fields, use a callback returning the ordinary schema input. Bound branch and history builders retain `.from` and `.decoded`. Replace command-producing `initialize` callbacks with `entry`/`exit` handlers or invocations; definitions become executable only after `.handle` captures their initial declarations. + +### Patch Changes + +- Updated dependencies [e72b7f5] + - @typeonce/effect-machine@0.35.0 + ## 0.34.0 ### Minor Changes diff --git a/packages/effect-machine-react/package.json b/packages/effect-machine-react/package.json index c93e4083..cbe1ab21 100644 --- a/packages/effect-machine-react/package.json +++ b/packages/effect-machine-react/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/effect-machine-react", - "version": "0.34.0", + "version": "0.35.0", "description": "React ownership hooks for Effect Machine atoms", "author": "Sandro Maglione", "repository": { diff --git a/packages/effect-machine/CHANGELOG.md b/packages/effect-machine/CHANGELOG.md index 4511f25c..d8af467b 100644 --- a/packages/effect-machine/CHANGELOG.md +++ b/packages/effect-machine/CHANGELOG.md @@ -1,5 +1,25 @@ # @typeonce/effect-machine +## 0.35.0 + +### Minor Changes + +- e72b7f5: Declare initial edges and data together in `.handle`. Remove `initial` from `Machine.state`, remove `initial` and `initialConfiguration` from `Machine.make`, and move shared startup data into the root handler's `root` value or input callback. Each compound declares `initial: { target, data? }`; parallel handlers use an `initial` map of region data. Initial targets must be direct children and remain inspectable without executing constructors. + + ```ts + const root = Machine.state({ states: { Locked: {}, Unlocked: {} } }); + const targets = Machine.targets(root); + const machine = Machine.make({ + root, + events: Machine.events({ Coin: {} }), + }).handle({ + initial: { target: targets.root.Locked }, + states: { Locked: { on: { Coin: { target: targets.root.Unlocked } } } }, + }); + ``` + + Replace declarative `from` callbacks with `data`, which accepts literals or callbacks. Supply already-decoded values with `{ decoded: true, data: valueOrCallback }`. For root or region data that itself contains `decoded: true` and `data` fields, use a callback returning the ordinary schema input. Bound branch and history builders retain `.from` and `.decoded`. Replace command-producing `initialize` callbacks with `entry`/`exit` handlers or invocations; definitions become executable only after `.handle` captures their initial declarations. + ## 0.34.0 ### Minor Changes diff --git a/packages/effect-machine/package.json b/packages/effect-machine/package.json index 13713493..362b7fd7 100644 --- a/packages/effect-machine/package.json +++ b/packages/effect-machine/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/effect-machine", - "version": "0.34.0", + "version": "0.35.0", "description": "Schema-first state machines and statecharts for Effect", "author": "Sandro Maglione", "repository": { diff --git a/packages/oxlint-plugin/CHANGELOG.md b/packages/oxlint-plugin/CHANGELOG.md index c7ac4864..a8e6ec8f 100644 --- a/packages/oxlint-plugin/CHANGELOG.md +++ b/packages/oxlint-plugin/CHANGELOG.md @@ -1,5 +1,25 @@ # @typeonce/oxlint-plugin-effect-machine +## 0.35.0 + +### Minor Changes + +- e72b7f5: Declare initial edges and data together in `.handle`. Remove `initial` from `Machine.state`, remove `initial` and `initialConfiguration` from `Machine.make`, and move shared startup data into the root handler's `root` value or input callback. Each compound declares `initial: { target, data? }`; parallel handlers use an `initial` map of region data. Initial targets must be direct children and remain inspectable without executing constructors. + + ```ts + const root = Machine.state({ states: { Locked: {}, Unlocked: {} } }); + const targets = Machine.targets(root); + const machine = Machine.make({ + root, + events: Machine.events({ Coin: {} }), + }).handle({ + initial: { target: targets.root.Locked }, + states: { Locked: { on: { Coin: { target: targets.root.Unlocked } } } }, + }); + ``` + + Replace declarative `from` callbacks with `data`, which accepts literals or callbacks. Supply already-decoded values with `{ decoded: true, data: valueOrCallback }`. For root or region data that itself contains `decoded: true` and `data` fields, use a callback returning the ordinary schema input. Bound branch and history builders retain `.from` and `.decoded`. Replace command-producing `initialize` callbacks with `entry`/`exit` handlers or invocations; definitions become executable only after `.handle` captures their initial declarations. + ## 0.34.0 ### Minor Changes diff --git a/packages/oxlint-plugin/package.json b/packages/oxlint-plugin/package.json index 29489478..2ecffb06 100644 --- a/packages/oxlint-plugin/package.json +++ b/packages/oxlint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/oxlint-plugin-effect-machine", - "version": "0.34.0", + "version": "0.35.0", "description": "Oxlint rules for Effect Machine models", "author": "Sandro Maglione", "repository": {