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

[wrangler] Clean up compatibility fallback warnings #4209

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Oct 17, 2023

Fixes cloudflare/miniflare#666 and #3784

What this PR solves / how to test:

Hey! 👋 When a compatibility date greater than the installed workerd version is selected, Miniflare logs a warning. The intention here is to warn users if they've set a compatibility date, but haven't updated workerd, so features they've requested won't be available. The problem is that this warning is only actionable if there's an update available. This change suppresses the warning if there's no new version available.

wrangler dev would previously use the current date as the default compatibility date if one wasn't set in wrangler.toml. Whilst using the current date as the default would no longer log a warning with this change, if there was an update available it would. So this change also sets the default to the workerd version instead.

To test this, create a new Wrangler project with today's compatibility date. Verify that you don't see any fallback warnings.

Associated docs issue(s)/PR(s):

N/A

Author has included the following, where applicable:

Reviewer is to perform the following, as applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2023

🦋 Changeset detected

Latest commit: 7c3e500

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

This PR includes changesets to release 1 package
Name Type
wrangler Minor

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2023

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/6564553983/npm-package-wrangler-4209

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6564553983/npm-package-wrangler-4209 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6564553983/npm-package-cloudflare-pages-shared-4209

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


wrangler@3.13.2 includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20231016.0 3.20231016.0
workerd 1.20231016.0 1.20231016.0
workerd --version 1.20231016.0 2023-10-16

|

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

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #4209 (7c3e500) into main (c2457cb) will decrease coverage by 0.04%.
Report is 2 commits behind head on main.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4209      +/-   ##
==========================================
- Coverage   75.37%   75.34%   -0.04%     
==========================================
  Files         223      223              
  Lines       12217    12229      +12     
  Branches     3159     3161       +2     
==========================================
+ Hits         9209     9214       +5     
- Misses       3008     3015       +7     
Files Coverage Δ
packages/wrangler/src/index.ts 83.44% <100.00%> (+0.22%) ⬆️
packages/wrangler/src/update-check.ts 20.00% <0.00%> (-5.00%) ⬇️
packages/wrangler/src/dev/miniflare.ts 60.84% <20.00%> (-4.38%) ⬇️

... and 4 files with indirect coverage changes

@mrbbot mrbbot force-pushed the bcoll/fix-compat-date-warnings branch from 8154bf6 to b07bd1d Compare October 18, 2023 13:12
@mrbbot mrbbot marked this pull request as ready for review October 18, 2023 13:15
@mrbbot mrbbot requested a review from a team as a code owner October 18, 2023 13:15
When a compatibility date greater than the installed `workerd` version
is selected, Miniflare logs a warning. The intention here is to warn
users if they've set a compatibility date, but haven't updated
`workerd`, so features they've requested won't be available.
The problem is that this warning is only actionable if there's an
update available. This change suppresses the warning if there's no
new version available.
`wrangler dev` would previously use the current date as the default
compatibility date if one wasn't set in `wrangler.toml`. Before the
previous commit, this would show a warning if it was greater than the
installed `workerd` version. Whilst using the current date as the
default would no longer log a warning with this change, if there was
an update it would. This change sets the default to the `workerd`
version instead.
@mrbbot mrbbot merged commit 24d1c5c into main Oct 24, 2023
20 checks passed
@mrbbot mrbbot deleted the bcoll/fix-compat-date-warnings branch October 24, 2023 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compatibility date warnings
2 participants