-
Notifications
You must be signed in to change notification settings - Fork 726
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: c3, use latest types for @cloudflare/workers-types
#6897
Conversation
🦋 Changeset detectedLatest commit: a017bbb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11194410995/npm-package-wrangler-6897 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6897/npm-package-wrangler-6897 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11194410995/npm-package-wrangler-6897 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11194410995/npm-package-create-cloudflare-6897 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11194410995/npm-package-cloudflare-kv-asset-handler-6897 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11194410995/npm-package-miniflare-6897 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11194410995/npm-package-cloudflare-pages-shared-6897 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11194410995/npm-package-cloudflare-vitest-pool-workers-6897 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11194410995/npm-package-cloudflare-workers-editor-shared-6897 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11194410995/npm-package-cloudflare-workers-shared-6897 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using @cloudflare/workers-types
without a version isn't the latest - it's in fact the oldest, so will be missing lots of stuff like stream constructors, getSetCookie
, FormData
parsing for File
, global navigator
and more.
Perhaps it would make more sense to default to /experimental
which is the latest, until said time the generated types are implemented?
good catch, yes |
We have some code that looks for the latest compat date generated in a workers-types dist, but that's been frozen for 202307-01 forever. We have upcoming work that'll replace this with generated types based on compat date/flags, but till then let's generate new projects with the default types.
7f5151c
to
a017bbb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof.. yes, this is quite out of date, but I'm not sure if using the /experimental entry point is the right intermediate step as that could result in unexpected breaking changes that can be quite tricky for people to debug and understand their source. This approach seems very fragile to me.
it might be better to instead introduce one more versioned/dated entry point into workers-types and update to that as an intermediate step towards dynamically generated types.
@andyjessop, @penalosa, and @petebacondarwin will likely have opinions/preferences on the next steps too.
Hi @IgorMinar, I don't really see a problem with the current setup in Is there something I'm missing here, or perhaps this would break the upcoming work mentioned? |
@DaniFoldi - this was my take on this too. I think the problem was that the current "latest" compat date seemed very old which made it look like it was wrong. That being said we actually did land a new compat date in 2024-09-23, which causes I would actually go further and say that changing the entry-point to something "generic" like The most effective solution I believe is to move away from |
Hi @petebacondarwin, Thanks for the Sunday response! I've looked at the flags again, and maaaybe
We've actually discussed this with This was before nodejs_compat was introduced, and the differences were minor, so most people, just using a date were fine. After the original nodejs_compat was introduced, I was hopeful that there would be a This is why My original idea for solving the entrypoint problem (to a degree) was to generate an entrypoint for every combination that was different. Then, Now, with the type generation system that can maybe replace workers-types and improve this experience, perhaps it would be useful to actually support nodejs_compat and nodejs_compat_v2 (my idea there is to mark shims as deprecated so developers know they won't actually do useful work at runtime) so |
We are actually close to solving that problem with generated types to! |
Closing in favour of #6883 |
We have some code that looks for the latest compat date generated in a workers-types dist, but that's been frozen for 202307-01 forever. We have upcoming work that'll replace this with generated types based on compat date/flags, but till then let's generate new projects with the default types.
What this PR solves / how to test
Fixes #000
Author has addressed the following