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

JSR does not support viem's strong types #3057

Open
1 task done
allezxandre opened this issue Nov 25, 2024 · 1 comment
Open
1 task done

JSR does not support viem's strong types #3057

allezxandre opened this issue Nov 25, 2024 · 1 comment

Comments

@allezxandre
Copy link

Check existing issues

Viem Version

2.21.50

Current Behavior

The JSR page of viem does not provide types for some modules (see the documentation for the mainnet chain definition).

In editors like VSCode, this means that most types imported from JSR are cast to any, and do not leverage the type safety of Viem.

Expected Behavior

No response

Steps To Reproduce

No response

Link to Minimal Reproducible Example

No response

Anything else?

It is my understanding that it comes from what JSR calls "slow types", and there isn't much we can do about it for now.

Fortunately, we can still use the package published on npm. But I'm curious to know if there are any plans going forward to make viem work with JSR, or if JSR's no-slow types policy is just too much at odds with Viem's strong type guarantees.

@allezxandre
Copy link
Author

I should also add for the sake of completeness that TypeScript 5.5 has separately introduced an --isolatedDeclarations compiler option that goes in the direction of JSR's slow types policy.

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

No branches or pull requests

1 participant