@cloudflare/workers-types v5#3741
Conversation
|
The generated output of |
|
Hi @penalosa 👋, Would it perhaps make more sense to have it defined as an alias to the "latest stable" date? Right now, that would be 2023-07-01, which more closely maps to types available to users. Experimental has some methods which aren't yet accessible to users, but if they show up in types, it might cause confusion. |
|
(converting to draft so that this doesn't get accidentally merged while still under discussion) |
|
@DaniFoldi The problem with the "latest stable" compatibility date is that it doesn't really represent anything in the runtime. It's just the last time the typings changed in a significant way, but it also means users miss out on types added since then. Using the experimental entrypoint has a slight risk of experimental APIs being available in user code, but it also means that everything else is always up to date. |
|
So basically this means — if you want types that match a specific compat date — then you need to use |
| // Latest compatibility date with experimental features | ||
| { compatDate: "experimental" }, | ||
| ]; | ||
| const ENTRYPOINTS = [{ compatDate: "experimental", name: "" }]; |
There was a problem hiding this comment.
Can we move the spawning of workerd to bazel now?
I don't think it does, the only types that are unavailable are ones that haven't been default on that date, such as some stream related ones in the oldest date. |
578f6d4 to
d4e8785
Compare
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
After the stabilisation of
wrangler types-based runtime type generation in Wrangler v4, the confusing entrypoint system in@cloudflare/workers-typesis no longer needed. As such, this PR changes@cloudflare/workers-typesto only include the latest version of the runtime types (previously this was the/experimentalentrypoint).After some analysis of open source repos with Sourcegraph, it's clear that the usage of the alternative entrypoints to
@cloudflare/workers-typesis very low to 0, and so this shouldn't have a practical impact on users. However, it's still a breaking change, and so this will be released as@cloudflare/workers-types@5. There are two migration paths available to users:@cloudflare/workers-types, but be aware that the typing environment may not be 100% compatible with runtime behaviour, depending on your compatibility date + flags, orwrangler typescc @anonrig this will also cut the build time of workers-types by 90%
cc @irvinebroque @korinne for visibility