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

fix: update setTimeout return type in socket.ts #2860

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

vpontis
Copy link
Contributor

@vpontis vpontis commented Oct 14, 2024

When we install Viem we get a Typescript issue because Timer is not defined in some environments. Instead, we can look at the return type for setTimeout so that this works well across Node and web environments.


PR-Codex overview

This PR focuses on updating the type of the keepAliveTimer variable in the src/utils/rpc/socket.ts file to improve type safety and clarity.

Detailed summary

  • Updated the type of keepAliveTimer from Timer | undefined to ReturnType<typeof setInterval> | undefined.
  • Added a note in the .changeset/small-pianos-agree.md file indicating the patch for viem and the update to the internal keepAliveTimer type.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Oct 14, 2024

🦋 Changeset detected

Latest commit: 2888cd0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Oct 14, 2024

@vpontis is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@vpontis
Copy link
Contributor Author

vpontis commented Oct 14, 2024

This project is a bit confused between pnpm and bun. Timer is a bun-only type and in the screenshot below you can see the project says "pnpm" but links to "bun"...

CleanShot 2024-10-14 at 16 06 20@2x

@vpontis vpontis changed the title Update setTimeout return type in socket.ts fix: update setTimeout return type in socket.ts Oct 14, 2024
@jxom jxom merged commit 3effd71 into wevm:main Oct 14, 2024
11 of 23 checks passed
@jxom
Copy link
Member

jxom commented Oct 14, 2024

That contributing guide should be pnpm. Open to another PR to fix it!

@vpontis
Copy link
Contributor Author

vpontis commented Oct 15, 2024

Thank you for merging this in so quickly. Could you publish a version with this fix in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants