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

Warn if compat date < most recent compat date supported by installed Wrangler #7640

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

irvinebroque
Copy link
Contributor

We don't currently warn you at all if you're using an older compat date than what is supported by the version of Wrangler that you're running.

I think we should, because:

  1. Most compat date updates simply mean things get better, a bug gets fixed, a new API is supported, etc.
  2. There are a lot of projects out there that, unless they update their compat date to a more recent one, won't be able to use improved Node.js compat
  3. Not everyone is familiar with compatibility dates, and if you gloss past them, you don't realize that being on a very old compat date is kind of like (though for important reasons not the same as) being on an old version of Node.js

If you look at an issue like cloudflare/next-on-pages#908 — people get mixed up despite guidance. And the more that we're loud about — update your compatibility date — we make sure that this is one of the first things that people experiment when trying to get something to work. We're going to get higher signal bug reports if people report "yes I've tried this with the latest compat date" versus us asking people to do this and circle back.

Maybe this is a bit aggressive, showing this every time you run wrangler dev. I could see possibly:

  1. Only warning if your compat date is > n months older than the currently installed version of Wrangler
  2. Allowing people to suppress the warning (do we have a mechanism for this?)

Finally — we should link to the relevant docs in the warning. One of the most consistent pieces of feedback I've heard talking to people is, "I wish you linked to that docs page you just sent me in the error message I got.".

Copy link

changeset-bot bot commented Dec 27, 2024

🦋 Changeset detected

Latest commit: 3d49dfc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
miniflare Patch
wrangler Patch
@cloudflare/pages-shared Patch
@cloudflare/vitest-pool-workers Patch

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

Copy link
Contributor

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/12518514900/npm-package-wrangler-7640

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7640/npm-package-wrangler-7640

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-wrangler-7640 dev path/to/script.js
Additional artifacts:
wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-cloudflare-workers-bindings-extension-7640 -O ./cloudflare-workers-bindings-extension.0.0.0-v1ecabc81f.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v1ecabc81f.vsix
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-create-cloudflare-7640 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-cloudflare-kv-asset-handler-7640
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-miniflare-7640
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-cloudflare-pages-shared-7640
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-cloudflare-unenv-preset-7640
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-cloudflare-vitest-pool-workers-7640
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-cloudflare-workers-editor-shared-7640
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-cloudflare-workers-shared-7640
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12518514900/npm-package-cloudflare-workflows-shared-7640

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20241218.0
workerd 1.20241218.0 1.20241218.0
workerd --version 1.20241218.0 2024-12-18

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Untriaged
Development

Successfully merging this pull request may close these issues.

1 participant