Fix Slow Types Warning When Publishing to JSR?
Does anybody know how to fix the slow types warning when exporting an arktype type validator in a JSR package?
I'm not exactly sure how to add an explicit type for my Arktype types. I'm guessing it's not exactly possible to add an explicit type that satisfies the fast type checking that JSR is looking for, but I wanted to make sure.
5 Replies
You can add a type annotation like
const clientMessage: Type<...>
but you'd be duplicating your types
I really dislike slow types as a concept and am fairly convinced just publishing js + .d.ts is better
Even within ArkType, it disallows really useful constructs like this for allowing global configuration:
https://arktype.io/docs/configuration#prototypes
And there's nothing I can do to work around so people consuming arktype through JSR would just get a worse experience than people consuming it through npm (or generally .d.ts)Oh, interesting, I was assuming it was some mechanism to more easily generate
.d.ts
files.
I don't really know how it works.
Well, for now I'm fine just allowing it.That is kind of what it is but there are a lot of cases where you'd want more control over your
.d.ts
output and it just blocks useful features of TS like I mentioned so it really needs to be reconsideredMaybe there'll be less of a concern once the go TS implementation comes and makes everything faster.
Ehh it has more to do with the actual logic of how they're generating the .d.ts than whats actually slow