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

Feat(unstable_dev): Don't fetch from npm on boot #4347

Merged
merged 1 commit into from
Nov 7, 2023
Merged

Feat(unstable_dev): Don't fetch from npm on boot #4347

merged 1 commit into from
Nov 7, 2023

Conversation

Skye-31
Copy link
Contributor

@Skye-31 Skye-31 commented Nov 6, 2023

Remake of #2982
Fixes #2956.

What this PR solves / how to test:

Wrangler makes a HTTP request to the NPM registry, checking for updates to inform end users. While this makes sense in regular commands, it (generally) has little place in it's API, particularly when this is primarily used for tests.

This pull request adds an experimental option which disables the update check, and optionally allows users to enable it. (There are cases for this, such as pages dev)

Author has addressed the following:

  • Tests
    • Included
    • Not necessary because:
  • Changeset (Changeset guidelines)
    • Included
    • Not necessary because:
  • Associated docs
    • Issue(s)/PR(s):
    • Not necessary because: Bugfix

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.

@Skye-31 Skye-31 requested review from a team as code owners November 6, 2023 12:45
Copy link

changeset-bot bot commented Nov 6, 2023

🦋 Changeset detected

Latest commit: 9efd3ca

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

Copy link
Contributor

github-actions bot commented Nov 6, 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/6773272848/npm-package-wrangler-4347

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

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

Or you can use npx with this latest build directly:

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

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


wrangler@3.15.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20231025.1
workerd 1.20231030.0 1.20231030.0
workerd --version 1.20231030.0 2023-10-30

|

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

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Merging #4347 (9efd3ca) into main (675d216) will increase coverage by 0.01%.
Report is 4 commits behind head on main.
The diff coverage is 41.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4347      +/-   ##
==========================================
+ Coverage   75.35%   75.36%   +0.01%     
==========================================
  Files         223      223              
  Lines       12341    12344       +3     
  Branches     3190     3193       +3     
==========================================
+ Hits         9299     9303       +4     
+ Misses       3042     3041       -1     
Files Coverage Δ
packages/wrangler/src/api/dev.ts 82.85% <100.00%> (+0.24%) ⬆️
packages/wrangler/src/dev.tsx 83.73% <100.00%> (ø)
packages/wrangler/src/index.ts 86.73% <100.00%> (+3.29%) ⬆️
packages/wrangler/src/pages/dev.ts 16.20% <ø> (ø)
packages/wrangler/src/update-check.ts 21.42% <22.22%> (+1.42%) ⬆️

... and 4 files with indirect coverage changes

Copy link
Member

@WalshyDev WalshyDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add as an option to pages dev in the future but not at all critical.

Comment on lines +196 to +197
logLevel: options?.logLevel ?? defaultLogLevel,
port: options?.port ?? 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These properties were never being set
image

@Skye-31 Skye-31 merged commit 102e15f into cloudflare:main Nov 7, 2023
20 checks passed
@Skye-31 Skye-31 deleted the unstable-dev-no-update-fetch-2 branch November 7, 2023 08:06
@workers-devprod workers-devprod mentioned this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

🎉 Feature Request: Don't run an update check in unstable_dev
4 participants