This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
xstate@5.18.1
Patch Changes
#5055ad38c35c37 Thanks @SandroMaglione! - Exported RequiredActorOptionsKeys type meant to be used by integration packages like @xstate/react
@xstate/react@4.1.2
Patch Changes
#5055ad38c35c37 Thanks @SandroMaglione! - Updated types of useActor, useMachine, and useActorRef to require input when defined inside types/input.
Previously even when input was defined inside types, useActor, useMachine, and useActorRef would not make the input required:
const machine = setup({
types: {
input: {} as { value: number }
}
}).createMachine({});
function App() {
// Event if `input` is not defined, `useMachine` works at compile time, but risks crashing at runtime
const _ = useMachine(machine);
return <></>;
}
With this change the above code will show a type error, since input is now required:
const machine = setup({
types: {
input: {} as { value: number }
}
}).createMachine({});
function App() {
const _ = useMachine(machine, {
input: { value: 1 } // Now input is required at compile time!
});
return <></>;
}
This avoids runtime errors when forgetting to pass input when defined inside types.
@xstate/solid@0.2.1
Patch Changes
#5055ad38c35c37 Thanks @SandroMaglione! - Updated types of useActor, useMachine, and useActorRef to require input when defined inside types/input.
Previously even when input was defined inside types, useActor, useMachine, and useActorRef would not make the input required:
const machine = setup({
types: {
input: {} as { value: number }
}
}).createMachine({});
function App() {
// Event if `input` is not defined, `useMachine` works at compile time, but risks crashing at runtime
const _ = useMachine(machine);
return <></>;
}
With this change the above code will show a type error, since input is now required:
const machine = setup({
types: {
input: {} as { value: number }
}
}).createMachine({});
function App() {
const _ = useMachine(machine, {
input: { value: 1 } // Now input is required at compile time!
});
return <></>;
}
This avoids runtime errors when forgetting to pass input when defined inside types.
@xstate/svelte@3.0.4
Patch Changes
#5055ad38c35c37 Thanks @SandroMaglione! - Updated types of useActor, useMachine, and useActorRef to require input when defined inside types/input.
Previously even when input was defined inside types, useActor, useMachine, and useActorRef would not make the input required:
const machine = setup({
types: {
input: {} as { value: number }
}
}).createMachine({});
function App() {
// Event if `input` is not defined, `useMachine` works at compile time, but risks crashing at runtime
const _ = useMachine(machine);
return <></>;
}
With this change the above code will show a type error, since input is now required:
const machine = setup({
types: {
input: {} as { value: number }
}
}).createMachine({});
function App() {
const _ = useMachine(machine, {
input: { value: 1 } // Now input is required at compile time!
});
return <></>;
}
This avoids runtime errors when forgetting to pass input when defined inside types.
@xstate/vue@3.1.3
Patch Changes
#5055ad38c35c37 Thanks @SandroMaglione! - Updated types of useActor, useMachine, and useActorRef to require input when defined inside types/input.
Previously even when input was defined inside types, useActor, useMachine, and useActorRef would not make the input required:
const machine = setup({
types: {
input: {} as { value: number }
}
}).createMachine({});
function App() {
// Event if `input` is not defined, `useMachine` works at compile time, but risks crashing at runtime
const _ = useMachine(machine);
return <></>;
}
With this change the above code will show a type error, since input is now required:
const machine = setup({
types: {
input: {} as { value: number }
}
}).createMachine({});
function App() {
const _ = useMachine(machine, {
input: { value: 1 } // Now input is required at compile time!
});
return <></>;
}
This avoids runtime errors when forgetting to pass input when defined inside types.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
xstate@5.18.1
Patch Changes
ad38c35c37
Thanks @SandroMaglione! - ExportedRequiredActorOptionsKeys
type meant to be used by integration packages like@xstate/react
@xstate/react@4.1.2
Patch Changes
#5055
ad38c35c37
Thanks @SandroMaglione! - Updated types ofuseActor
,useMachine
, anduseActorRef
to requireinput
when defined insidetypes/input
.Previously even when
input
was defined insidetypes
,useActor
,useMachine
, anduseActorRef
would not make the input required:With this change the above code will show a type error, since
input
is now required:This avoids runtime errors when forgetting to pass
input
when defined insidetypes
.@xstate/solid@0.2.1
Patch Changes
#5055
ad38c35c37
Thanks @SandroMaglione! - Updated types ofuseActor
,useMachine
, anduseActorRef
to requireinput
when defined insidetypes/input
.Previously even when
input
was defined insidetypes
,useActor
,useMachine
, anduseActorRef
would not make the input required:With this change the above code will show a type error, since
input
is now required:This avoids runtime errors when forgetting to pass
input
when defined insidetypes
.@xstate/svelte@3.0.4
Patch Changes
#5055
ad38c35c37
Thanks @SandroMaglione! - Updated types ofuseActor
,useMachine
, anduseActorRef
to requireinput
when defined insidetypes/input
.Previously even when
input
was defined insidetypes
,useActor
,useMachine
, anduseActorRef
would not make the input required:With this change the above code will show a type error, since
input
is now required:This avoids runtime errors when forgetting to pass
input
when defined insidetypes
.@xstate/vue@3.1.3
Patch Changes
#5055
ad38c35c37
Thanks @SandroMaglione! - Updated types ofuseActor
,useMachine
, anduseActorRef
to requireinput
when defined insidetypes/input
.Previously even when
input
was defined insidetypes
,useActor
,useMachine
, anduseActorRef
would not make the input required:With this change the above code will show a type error, since
input
is now required:This avoids runtime errors when forgetting to pass
input
when defined insidetypes
.