Skip to content

Commit

Permalink
Fix typos (#4340)
Browse files Browse the repository at this point in the history
* Fix typos

* Revert a fix
  • Loading branch information
szepeviktor authored Oct 6, 2023
1 parent 2b0d5fc commit 8e1586b
Show file tree
Hide file tree
Showing 28 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .changeset/rare-phones-whisper.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'xstate': minor
---

Support for specifying states deep in the hierarchy has been added for the `initial` property. It's also now possible to specify multiple states as initial ones - so you can enter multiple descandants which have to be **parallel** to each other. Keep also in mind that you can only target descendant states with the `initial` property - it's not possible to target states from another regions.
Support for specifying states deep in the hierarchy has been added for the `initial` property. It's also now possible to specify multiple states as initial ones - so you can enter multiple descendants which have to be **parallel** to each other. Keep also in mind that you can only target descendant states with the `initial` property - it's not possible to target states from another regions.

Those are now possible:

Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
isTSX: true,
allExtensions: true,
disallowAmbiguousJSXLike: true,
// this is the only overriden option
// this is the only overridden option
// potentially we could just configure it for all the files but surprisingly something crashes when we try to do it
onlyRemoveTypeImports: true
}
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/theme/WORKAROUND.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Workaround based on [this comment](https://github.com/vuejs/vuepress/issues/1802#issuecomment-533890727)
Imlementation contained in this `.vuepress/theme` directory [details](https://github.com/rundeck/docs/commit/1e0f1cd066ee4dc1007c34a41b86929443f00fba)
Implementation contained in this `.vuepress/theme` directory [details](https://github.com/rundeck/docs/commit/1e0f1cd066ee4dc1007c34a41b86929443f00fba)

To remove this workaround, simply remove `docs/.vuepress/theme` directory
4 changes: 2 additions & 2 deletions docs/about/goals.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ If you're deciding if you should use XState, [John Yanarella](https://github.com

> When I was making that same choice as to whether to use and advocate for the use of XState where I work, the things that stood out for me were:
>
> 1. The **committment to understanding the relevant prior art** and informing the implementation based on existing research papers (Harel's [original paper on statecharts](https://www.sciencedirect.com/science/article/pii/0167642387900359/pdf)), books (Horrocks' ["Constructing the User Interface with Statecharts"](https://www.amazon.com/Constructing-User-Interface-Statecharts-Horrocks/dp/0201342782/ref=sr_1_3?ie=UTF8&qid=1548690916&sr=8-3&keywords=statecharts)), and standards ([W3C's SCXML](https://www.w3.org/TR/scxml/)).
> 1. The **commitment to understanding the relevant prior art** and informing the implementation based on existing research papers (Harel's [original paper on statecharts](https://www.sciencedirect.com/science/article/pii/0167642387900359/pdf)), books (Horrocks' ["Constructing the User Interface with Statecharts"](https://www.amazon.com/Constructing-User-Interface-Statecharts-Horrocks/dp/0201342782/ref=sr_1_3?ie=UTF8&qid=1548690916&sr=8-3&keywords=statecharts)), and standards ([W3C's SCXML](https://www.w3.org/TR/scxml/)).
>
> Many of the other libraries I reviewed along the way are projects that stop at the point of implementing simple finite state machines. (If that's all you need - and it might be - David's been quick to point out how few lines it takes to just roll your own.) Their reach is shortened, since they don't address the subsequent limitations that can be overcome via a statechart.
>
> XState stands on the shoulders of giants by embracing [W3C's SCXML spec](https://www.w3.org/TR/scxml/) - it gets the benefit of that working group's research into edge cases.
>
> 2. It's a **refuge from the "shiny object syndrome"** of embracing the latest flavor-of-the-month "state management library". It faithfully implements a 30+ year old formalism. You end up putting your most important logic into something you can take with you to any UI framework (and potentially to other statechart implementions in other languages). It's a zero-dependency library.
> 2. It's a **refuge from the "shiny object syndrome"** of embracing the latest flavor-of-the-month "state management library". It faithfully implements a 30+ year old formalism. You end up putting your most important logic into something you can take with you to any UI framework (and potentially to other statechart implementations in other languages). It's a zero-dependency library.
>
> The front-end development world is the wild west, and it could stand to learn from what other engineering disciplines have known and employed for years.
>
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/activities.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Activities

::: warning Deprecated
Activites are deprecated and will be removed in XState version 5. The recommended approach is to [invoke an actor](./actors.md) instead:
Activities are deprecated and will be removed in XState version 5. The recommended approach is to [invoke an actor](./actors.md) instead:

```diff
-activities: [(context, event) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/internal.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Internal Transitions

See [the **Internal Transtions** docs](./transitions.md#internal-transitions).
See [the **Internal Transitions** docs](./transitions.md#internal-transitions).
2 changes: 1 addition & 1 deletion docs/packages/xstate-test/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Throws an error if the last entered state does not match the `options.target`.

### `testModel.testCoverage(options?)`

Tests that all state nodes were covered (traversed) in the exected tests.
Tests that all state nodes were covered (traversed) in the executed tests.

**_Options_**

Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/deno.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Usage with Deno

[Deno](https://deno.land/) is an alternate TypeScript/JavaScript runtime, similar to NodeJS, but has built-in TypeScript support and is not intantly compatable with most npm packages.
[Deno](https://deno.land/) is an alternate TypeScript/JavaScript runtime, similar to NodeJS, but has built-in TypeScript support and is not intantly compatible with most npm packages.

So to run XState on Deno, you need to import it differently, via [Skypack](https://www.skypack.dev/). Packages are 'installed' at runtime; no more `/node_modules`!

Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/stencil.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add a `state` property to your component, decorated with `@State` so that it tri

On `componentWillLoad`, interpret the `toggleMachine` and listen for state transitions.

After a transition has occured, the `state` property is set to the machine's new state, triggering a re-render.
After a transition has occurred, the `state` property is set to the machine's new state, triggering a re-render.

```js
import { Component, h, State } from "@stencil/core";
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/about/goals.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

> When I was making that same choice as to whether to use and advocate for the use of XState where I work, the things that stood out for me were:
>
> 1. The **committment to understanding the relevant prior art** and informing the implementation based on existing research papers (Harel's [original paper on statecharts](https://www.sciencedirect.com/science/article/pii/0167642387900359/pdf)), books (Horrocks' ["Constructing the User Interface with Statecharts"](https://www.amazon.com/Constructing-User-Interface-Statecharts-Horrocks/dp/0201342782/ref=sr_1_3?ie=UTF8&qid=1548690916&sr=8-3&keywords=statecharts)), and standards ([W3C's SCXML](https://www.w3.org/TR/scxml/)).
> 1. The **commitment to understanding the relevant prior art** and informing the implementation based on existing research papers (Harel's [original paper on statecharts](https://www.sciencedirect.com/science/article/pii/0167642387900359/pdf)), books (Horrocks' ["Constructing the User Interface with Statecharts"](https://www.amazon.com/Constructing-User-Interface-Statecharts-Horrocks/dp/0201342782/ref=sr_1_3?ie=UTF8&qid=1548690916&sr=8-3&keywords=statecharts)), and standards ([W3C's SCXML](https://www.w3.org/TR/scxml/)).
>
> Many of the other libraries I reviewed along the way are projects that stop at the point of implementing simple finite state machines. (If that's all you need - and it might be - David's been quick to point out how few lines it takes to just roll your own.) Their reach is shortened, since they don't address the subsequent limitations that can be overcome via a statechart.
>
> XState stands on the shoulders of giants by embracing [W3C's SCXML spec](https://www.w3.org/TR/scxml/) - it gets the benefit of that working group's research into edge cases.
>
> 2. It's a **refuge from the "shiny object syndrome"** of embracing the latest flavor-of-the-month "state management library". It faithfully implements a 30+ year old formalism. You end up putting your most important logic into something you can take with you to any UI framework (and potentially to other statechart implementions in other languages). It's a zero-dependency library.
> 2. It's a **refuge from the "shiny object syndrome"** of embracing the latest flavor-of-the-month "state management library". It faithfully implements a 30+ year old formalism. You end up putting your most important logic into something you can take with you to any UI framework (and potentially to other statechart implementations in other languages). It's a zero-dependency library.
>
> The front-end development world is the wild west, and it could stand to learn from what other engineering disciplines have known and employed for years.
>
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/guides/internal.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 内部 Transitions

See [the **Internal Transtions** docs](./transitions.md#internal-transitions).
See [the **Internal Transitions** docs](./transitions.md#internal-transitions).
2 changes: 1 addition & 1 deletion docs/zh/packages/xstate-test/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Throws an error if the last entered state does not match the `options.target`.

### `testModel.testCoverage(options?)`

Tests that all state nodes were covered (traversed) in the exected tests.
Tests that all state nodes were covered (traversed) in the executed tests.

**_Options_**

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/recipes/deno.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 与 Deno 一起使用

[Deno](https://deno.land/) is an alternate TypeScript/JavaScript runtime, similar to NodeJS, but has built-in TypeScript support and is not intantly compatable with most npm packages.
[Deno](https://deno.land/) is an alternate TypeScript/JavaScript runtime, similar to NodeJS, but has built-in TypeScript support and is not intantly compatible with most npm packages.

So to run XState on Deno, you need to import it differently, via [Skypack](https://www.skypack.dev/). Packages are 'installed' at runtime; no more `/node_modules`!

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/recipes/stencil.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add a `state` property to your component, decorated with `@State` so that it tri

On `componentWillLoad`, interpret the `toggleMachine` and listen for state transitions.

After a transition has occured, the `state` property is set to the machine's new state, triggering a re-render.
After a transition has occurred, the `state` property is set to the machine's new state, triggering a re-render.

```js
import { Component, h, State } from "@stencil/core";
Expand Down
6 changes: 3 additions & 3 deletions examples/workflow-monitor-job/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const workflow = createMachine(
},
JobSucceeded: {
invoke: {
src: 'reportJobSuceeded',
src: 'reportJobSucceeded',
onDone: 'End'
}
},
Expand All @@ -95,8 +95,8 @@ export const workflow = createMachine(
console.log('Starting checkJobStatus', input);
return Promise.resolve({ jobStatus: 'SUCCEEDED' });
}),
reportJobSuceeded: fromPromise(({ input }) => {
console.log('Starting reportJobSuceeded', input);
reportJobSucceeded: fromPromise(({ input }) => {
console.log('Starting reportJobSucceeded', input);
return Promise.resolve();
}),
reportJobFailed: fromPromise(({ input }) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@
- [#3148](https://github.com/statelyai/xstate/pull/3148) [`7a68cbb61`](https://github.com/statelyai/xstate/commit/7a68cbb615afb6556c83868535dae67af366a117) Thanks [@davidkpiano](https://github.com/davidkpiano)! - `onSnapshot` is now available for invoke configs. You can specify a transition there to be taken when a snapshot of an invoked actor gets updated. It works similarly to `onDone`/`onError`.
* [#1041](https://github.com/statelyai/xstate/pull/1041) [`b24e47b9e`](https://github.com/statelyai/xstate/commit/b24e47b9e7a59a5b0527d4386cea3af16c84ca7a) Thanks [@Andarist](https://github.com/Andarist)! - Support for specifying states deep in the hierarchy has been added for the `initial` property. It's also now possible to specify multiple states as initial ones - so you can enter multiple descandants which have to be **parallel** to each other. Keep also in mind that you can only target descendant states with the `initial` property - it's not possible to target states from another regions.
* [#1041](https://github.com/statelyai/xstate/pull/1041) [`b24e47b9e`](https://github.com/statelyai/xstate/commit/b24e47b9e7a59a5b0527d4386cea3af16c84ca7a) Thanks [@Andarist](https://github.com/Andarist)! - Support for specifying states deep in the hierarchy has been added for the `initial` property. It's also now possible to specify multiple states as initial ones - so you can enter multiple descendants which have to be **parallel** to each other. Keep also in mind that you can only target descendant states with the `initial` property - it's not possible to target states from another regions.
Those are now possible:
Expand Down Expand Up @@ -3113,7 +3113,7 @@
It is recommended that all `spawn(...)`-ed actors are lazy, to avoid accidentally initializing them e.g., when reading `machine.initialState` or calculating otherwise pure transitions. In V5, this will be enforced.
- [`c1f3d260`](https://github.com/statelyai/xstate/commit/c1f3d26069ee70343f8045a48411e02a68f98cbd) [#1317](https://github.com/statelyai/xstate/pull/1317) Thanks [@Andarist](https://github.com/Andarist)! - Fixed a type returned by a `raise` action - it's now `RaiseAction<TEvent> | SendAction<TContext, AnyEventObject, TEvent>` instead of `RaiseAction<TEvent> | SendAction<TContext, TEvent, TEvent>`. This makes it comaptible in a broader range of scenarios.
- [`c1f3d260`](https://github.com/statelyai/xstate/commit/c1f3d26069ee70343f8045a48411e02a68f98cbd) [#1317](https://github.com/statelyai/xstate/pull/1317) Thanks [@Andarist](https://github.com/Andarist)! - Fixed a type returned by a `raise` action - it's now `RaiseAction<TEvent> | SendAction<TContext, AnyEventObject, TEvent>` instead of `RaiseAction<TEvent> | SendAction<TContext, TEvent, TEvent>`. This makes it compatible in a broader range of scenarios.
- [`8270d5a7`](https://github.com/statelyai/xstate/commit/8270d5a76c71add3a5109e069bd85716b230b5d4) [#1372](https://github.com/statelyai/xstate/pull/1372) Thanks [@christianchown](https://github.com/christianchown)! - Narrowed the `ServiceConfig` type definition to use a specific event type to prevent compilation errors on strictly-typed `MachineOptions`.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export class Actor<TLogic extends AnyActorLogic>

switch (status) {
case 'done':
// a state machine can be "done" upon intialization (it could reach a final state using initial microsteps)
// a state machine can be "done" upon initialization (it could reach a final state using initial microsteps)
// we still need to complete observers, flush deferreds etc
this.update(
this._state,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ describe('error handling', () => {
});
});

it(`uncaught error and an error thrown by the error listener should both be reported globally when not eveyr observer comes with an error listener`, (done) => {
it(`uncaught error and an error thrown by the error listener should both be reported globally when not every observer comes with an error listener`, (done) => {
const machine = createMachine({
initial: 'pending',
states: {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/predictableExec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe('predictableExec', () => {
expect(calledWith).toBe(1);
});

it('initial actions should receive context updated only by preceeding assign actions', () => {
it('initial actions should receive context updated only by preceding assign actions', () => {
const actual: number[] = [];

const machine = createMachine({
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/scxml.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const testGroups: Record<string, string[]> = {
// 'test0',
// 'test1'
],
// 'send-data': ['send1'], // <content> conversion not implementd
// 'send-data': ['send1'], // <content> conversion not implemented
// 'send-idlocation': ['test0'],
// 'send-internal': ['test0'],
'targetless-transition': ['test0', 'test1', 'test2', 'test3'],
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ describe('events', () => {
service.send({ type: 'UNKNOWN' });
});

it('event type should be inferrable from a simple state machine type', () => {
it('event type should be inferable from a simple state machine type', () => {
const toggleMachine = createMachine({
types: {} as {
context: {
Expand Down Expand Up @@ -724,7 +724,7 @@ describe('events', () => {
});

describe('interpreter', () => {
it('should be convertable to Rx observable', () => {
it('should be convertible to Rx observable', () => {
const s = createActor(
createMachine({
types: {
Expand Down Expand Up @@ -4008,7 +4008,7 @@ describe('tags', () => {
actor.getSnapshot().hasTag('a');
});

it('`hasTag` should not allow checking a tag ouside of the defined ones', () => {
it('`hasTag` should not allow checking a tag outside of the defined ones', () => {
const machine = createMachine({
types: {} as {
tags: 'a' | 'b' | 'c';
Expand Down
4 changes: 2 additions & 2 deletions packages/xstate-inspect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const inspector = inspect({
targetWindow: window
});

// In the same window, subsribe to messages from @xstate/inspector
// In the same window, subscribe to messages from @xstate/inspector
createWindowReceiver({}).subscribe(console.log);

// Start your machine, and all events generated are logged to the console
Expand Down Expand Up @@ -141,7 +141,7 @@ createWindowReceiver({}).subscribe((event) => {
} else if (event.type === 'service.stop') {
// Do something when a machine enters a terminal state
} else if (event.type === 'service.event') {
// Do something when a machine recieves an event
// Do something when a machine receives an event
} else if (event.type === 'service.state') {
// Do something when a machine enters to a new state
// Note: Does not handle transitional states.
Expand Down
2 changes: 1 addition & 1 deletion packages/xstate-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

### Patch Changes

- [#3799](https://github.com/statelyai/xstate/pull/3799) [`51d254692`](https://github.com/statelyai/xstate/commit/51d254692c2d267c24c65fc5802461540c012393) Thanks [@Andarist](https://github.com/Andarist)! - Fixed an issue that caused the internally used `useSyncExternalStore` to warn about the computed snapshot not being cached when a not-started machine servive was passed to `useActor`.
- [#3799](https://github.com/statelyai/xstate/pull/3799) [`51d254692`](https://github.com/statelyai/xstate/commit/51d254692c2d267c24c65fc5802461540c012393) Thanks [@Andarist](https://github.com/Andarist)! - Fixed an issue that caused the internally used `useSyncExternalStore` to warn about the computed snapshot not being cached when a not-started machine service was passed to `useActor`.

## 3.1.0

Expand Down
4 changes: 2 additions & 2 deletions packages/xstate-react/test/useActor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -844,14 +844,14 @@ describeEachReactMode('useActor (%s)', ({ suiteKey, render }) => {
types: {
context: {} as { value: number }
},
initial: 'intitial',
initial: 'initial',
context: ({ input }: { input: { value: number } }) => {
return {
value: input.value
};
},
states: {
intitial: {}
initial: {}
}
});

Expand Down
4 changes: 2 additions & 2 deletions packages/xstate-solid/test/useMachine.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1664,12 +1664,12 @@ describe('useMachine (strict mode)', () => {

it('custom data should be available right away for the invoked actor', () => {
const childMachine = createMachine({
initial: 'intitial',
initial: 'initial',
context: ({ input }: { input: { value: number } }) => ({
value: input.value
}),
states: {
intitial: {}
initial: {}
}
});

Expand Down
Loading

0 comments on commit 8e1586b

Please sign in to comment.