Skip to content

Commit

Permalink
Merge branch 'main' into knip
Browse files Browse the repository at this point in the history
  • Loading branch information
with-heart committed Jul 28, 2024
2 parents 08b6b07 + ccaeb44 commit f233b2f
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 42 deletions.
15 changes: 0 additions & 15 deletions .changeset/nervous-snails-help.md

This file was deleted.

4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# prettier formatting
71183da18ae6b0b6b2e8f0c52ea9976232e54f41
94037fe9c429839f0508ddcd287718b659276e3b
f51bf4d8907307ace083a0decb34668176c7fad3
13 changes: 6 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ Please read [our code of conduct](https://github.com/statelyai/xstate/blob/main/
Pull requests are encouraged. If you want to add a feature or fix a bug:

1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) and [clone](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) the [repository](https://github.com/statelyai/xstate).
2. [Create a separate branch](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/managing-branches) for your changes.
3. Make your changes, and ensure that it is formatted by [Prettier](https://prettier.io) and type-checks without errors in [TypeScript](https://www.typescriptlang.org/).
4. Write tests that validate your change and/or fix.
5. Run `yarn build` and then run tests with `yarn test` (for all packages) or `yarn test:core` (for only changes to core XState).
6. For package changes, add docs inside the `/packages/*/README.md`. These docs will be copied on build to the corresponding `/docs/packages/*/index.md` file.
7. Create a changeset by running `yarn changeset`. [More about changesets](https://github.com/atlassian/changesets).
8. Push your branch and open a PR 🚀
1. [Create a separate branch](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/managing-branches) for your changes.
1. Make your changes, and write tests that validate your change and/or fix.
1. Run `yarn test` (for all packages) or `yarn test:core` (for only changes to core XState).
1. Run `yarn typecheck` to make sure that there are no type errors.
1. Create a changeset by running `yarn changeset`. [More about changesets](https://github.com/atlassian/changesets).
1. Push your branch and open a PR 🚀

PRs are reviewed promptly and merged in within a day or two (or even within an hour) if everything looks good.

Expand Down
18 changes: 18 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# xstate

## 5.16.0

### Minor Changes

- [#4996](https://github.com/statelyai/xstate/pull/4996) [`5be796cd2`](https://github.com/statelyai/xstate/commit/5be796cd252f024ed29a589d1f2d6c8e626167db) Thanks [@ronvoluted](https://github.com/ronvoluted)! - The actor snapshot `status` type (`'active' | 'done' | 'error' | 'stopped'`) is now exposed as `SnapshotStatus`

- [#4981](https://github.com/statelyai/xstate/pull/4981) [`c4ae156b2`](https://github.com/statelyai/xstate/commit/c4ae156b278779e898aeb8d86b089de2cf959683) Thanks [@davidkpiano](https://github.com/davidkpiano)! - Added `sendParent` to the `enqueueActions` feature. This allows users to enqueue actions that send events to the parent actor within the `enqueueActions` block.

```js
import { createMachine, enqueueActions } from 'xstate';

const childMachine = createMachine({
entry: enqueueActions(({ enqueue }) => {
enqueue.sendParent({ type: 'CHILD_READY' });
})
});
```

## 5.15.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xstate",
"version": "5.15.0",
"version": "5.16.0",
"description": "Finite State Machines and Statecharts for the Modern Web.",
"main": "dist/xstate.cjs.js",
"module": "dist/xstate.esm.js",
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/State.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import type {
Snapshot,
ParameterizedObject,
IsNever,
MetaObject
MetaObject,
SnapshotStatus
} from './types.ts';
import { matchesState } from './utils.ts';

Expand Down Expand Up @@ -96,7 +97,7 @@ interface MachineSnapshotBase<
*/
value: TStateValue;
/** The current status of this snapshot. */
status: 'active' | 'done' | 'error' | 'stopped';
status: SnapshotStatus;
error: unknown;
context: TContext;

Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/StateMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ import type {
StateMachineDefinition,
StateValue,
TransitionDefinition,
ResolvedStateMachineTypes
ResolvedStateMachineTypes,
SnapshotStatus
} from './types.ts';
import { resolveReferencedActor, toStatePath } from './utils.ts';

Expand Down Expand Up @@ -212,7 +213,7 @@ export class StateMachine<
value: StateValue;
context?: TContext;
historyValue?: HistoryValue<TContext, TEvent>;
status?: 'active' | 'done' | 'error' | 'stopped';
status?: SnapshotStatus;
output?: TOutput;
error?: unknown;
} & (Equals<TContext, MachineContext> extends false
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ export interface StateConfig<
/** @internal */
_nodes: Array<StateNode<TContext, TEvent>>;
children: Record<string, AnyActorRef>;
status: 'active' | 'done' | 'error' | 'stopped';
status: SnapshotStatus;
output?: any;
error?: unknown;
machine?: StateMachine<
Expand Down Expand Up @@ -2133,6 +2133,8 @@ export type AnyActorScope = ActorScope<
any // TEmitted
>;

export type SnapshotStatus = 'active' | 'done' | 'error' | 'stopped';

export type Snapshot<TOutput> =
| {
status: 'active';
Expand Down
4 changes: 2 additions & 2 deletions packages/xstate-graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"url": "https://github.com/statelyai/xstate/issues"
},
"peerDependencies": {
"xstate": "^5.15.0"
"xstate": "^5.16.0"
},
"devDependencies": {
"xstate": "5.15.0"
"xstate": "5.16.0"
},
"dependencies": {}
}
4 changes: 2 additions & 2 deletions packages/xstate-immer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"dependencies": {},
"peerDependencies": {
"immer": "^9.0.6 || ^10",
"xstate": "^5.15.0"
"xstate": "^5.16.0"
},
"devDependencies": {
"immer": "^10.0.2",
"xstate": "5.15.0"
"xstate": "5.16.0"
}
}
4 changes: 2 additions & 2 deletions packages/xstate-inspect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
"devDependencies": {
"@types/ws": "^8.2.2",
"ws": "^8.4.0",
"xstate": "5.15.0"
"xstate": "5.16.0"
},
"peerDependencies": {
"@types/ws": "^8.0.0",
"ws": "^8.0.0",
"xstate": "^5.15.0"
"xstate": "^5.16.0"
},
"peerDependenciesMeta": {
"@types/ws": {
Expand Down
4 changes: 2 additions & 2 deletions packages/xstate-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"xstate": "^5.15.0"
"xstate": "^5.16.0"
},
"peerDependenciesMeta": {
"xstate": {
Expand All @@ -74,6 +74,6 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"rxjs": "^7.8.0",
"xstate": "5.15.0"
"xstate": "5.16.0"
}
}
4 changes: 2 additions & 2 deletions packages/xstate-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"peerDependencies": {
"solid-js": "^1.6.0",
"xstate": "^5.15.0"
"xstate": "^5.16.0"
},
"peerDependenciesMeta": {
"xstate": {
Expand All @@ -53,6 +53,6 @@
"devDependencies": {
"solid-js": "^1.7.6",
"solid-testing-library": "^0.3.0",
"xstate": "5.15.0"
"xstate": "5.16.0"
}
}
4 changes: 2 additions & 2 deletions packages/xstate-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"peerDependencies": {
"svelte": "^3.24.1 || ^4",
"xstate": "^5.15.0"
"xstate": "^5.16.0"
},
"peerDependenciesMeta": {
"xstate": {
Expand All @@ -58,6 +58,6 @@
"svelte": "^3.55.1",
"svelte-check": "^3.2.0",
"svelte-preprocess": "^5.0.0",
"xstate": "5.15.0"
"xstate": "5.16.0"
}
}
4 changes: 2 additions & 2 deletions packages/xstate-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"peerDependencies": {
"vue": "^3.0.0",
"xstate": "^5.15.0"
"xstate": "^5.16.0"
},
"peerDependenciesMeta": {
"xstate": {
Expand All @@ -65,6 +65,6 @@
"@testing-library/vue": "^6.6.1",
"@vue/compiler-sfc": "^3.0.11",
"vue": "^3.0.11",
"xstate": "5.15.0"
"xstate": "5.16.0"
}
}

0 comments on commit f233b2f

Please sign in to comment.