Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TypeScript to 5.7.2 #5128

Merged
merged 9 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
"prettier-plugin-jsdoc": "^1.3.0",
"svelte-jester": "^2.3.2",
"synckit": "^0.8.5",
"typescript": "^5.6.2",
"typescript-eslint": "^8.0.1",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0",
"vue": "^3.0.11"
},
"husky": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xstate-inspect/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function inspect(options: ServerInspectorOptions): Inspector {
return;
}

const jsonMessage = JSON.parse(String(data));
const jsonMessage = JSON.parse(String(data as unknown));
inspectService.send({
...jsonMessage,
client
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 @@ -815,7 +815,7 @@ describeEachReactMode('useActor (%s)', ({ suiteKey, render }) => {
return (
<>
<ChildTest send={send} />
{state.value}
{state.value as string}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need those casts out of a sudden?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TS now complains that state.value can be an invalid child, which is true - it technically can be an object here, which is not allowed anymore I suppose.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use setup here to avoid those casts :) b798338

</>
);
};
Expand Down Expand Up @@ -1044,7 +1044,7 @@ describeEachReactMode('useActor (%s)', ({ suiteKey, render }) => {

const App = () => {
const [state] = useActor(machine);
return <>{state.value}</>;
return <>{state.value as string}</>;
};

const { container } = render(<App />);
Expand Down
2 changes: 1 addition & 1 deletion packages/xstate-react/test/useSelector.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ describeEachReactMode('useSelector (%s)', ({ suiteKey, render }) => {

return (
<>
{value}
{value as number}
<button
type="button"
onClick={() => forceRerender((s) => s + 1)}
Expand Down
Loading