Any news or progress you can share on
Any news or progress you can share on the typegen with
wrangler types
becoming more cohesive with @types/node
? All the time the typegen doesn't actually match runtime behaviour here and include real nodejs_compat types, it just causes more problems in my experience, especially when you introduce third party libs that still have to use workers-types
.8 Replies
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
You can, yes, but you get a whole bunch of types for things that don't actually work in the runtime because they're node types, and not actually nodejs_compat types. https://x.com/CherryJimbo/status/1927004843345956961 for context.
James Ross (@CherryJimbo)
@vladlykhonis @CloudflareDev Outside of `@types/node` for `nodejs_compat`, this is generally true. And then you get conflicts when libraries rely on specific `workers-types` things that might not exist with your specific flavour of runtime types.
But in my opinion, if it claims to generate types to match
X
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
that's one of the main promised benefits, that with the knowledge of the specific compat date/flags, the types generated can be more accurate
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
yes, this would be the only compelling reason for typegen imo
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
indeed yep