Skip to content

Conversation

@RamIdeas
Copy link
Contributor

@RamIdeas RamIdeas commented Nov 23, 2023

This PR will merge changes already approved in #4413 onto main

This is the startDevWorker-release branch. Currently it holds the changes for Milestone 1 and is what this PR will merge into main for release.

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

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.

@RamIdeas RamIdeas requested a review from a team as a code owner November 23, 2023 15:58
@changeset-bot
Copy link

changeset-bot bot commented Nov 23, 2023

🦋 Changeset detected

Latest commit: c5d1b7b

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

RamIdeas and others added 2 commits November 23, 2023 16:20
* Revert "Revert "startDevWorker - Milestone 1" (#4171)"

This reverts commit 88f15f6.

* fix: don't show logs to ProxyWorker(s)
unless log level is debug

* fix: show console.log's in remote mode
remote inspector websocket upgrade request required auth headers
so use `fetch` with `Upgrade: websocket` header instead of `new WebSocket`

* use miniflare verbose mode only if debug log level

* use single Miniflare instance
for (Inspector)ProxyWorker

* port: clear remote runtime logs
upon UserWorker restarts

* default unstable_dev inspectorPort to 0

* parallelise cleanup to minimise chance of hanging
previously, sequential cleanups fail to fully cleanup if earlier steps in the sequence fail

* ensure InspectorProxyWorker unsafeDirectPort is set

* don't use file-system for (Inspector)ProxyWorker DOs

* prevent eviction of the Durable Objects
with (Inspector)ProxyWorker

* remove miniflare workaround for parallel requests

* considerations for race between control messages and user fetches

* use port: undefined vs 0 for UserWorker
to force different port across reloads to workaround workerd bug on Windows

* Don't try to parse `node-internal:* import specifiers

* improve InspectorProxyWorker debug logs

* only proxy consoleAPICalled events in remote mode

* enable consoleAPICalled events proxying if local mode AND service-worker format

* fix userWorkerInnerUrlOverrides host/hostname/port
mainly, base innerUrl off of request.url not userWorkerUrl

* use ProxyWorker ip/port for DEV_SERVER_READY event
instead of UserWorker ip/port

* always disable the UserWorker miniflare pretty error
using the MF-Disable-Pretty-Error header on the UserWorker request

the ProxyWorker will still interpret the json error response
depending on its own MF-Disable-Pretty-Error header

* recover from 'address in use' errors
by trying to start on a random port

* run unit tests in parallel again
by removing --runInBand flag for jest

* add handleRuntimeStdio option to ProxyWorker miniflare instance

* expand containsHexStack check for windows

* logger.debug runtime websocket errors from InspectorProxyWorker
+ remove miniflare log.error overrides no longer needed

* log workerd warnings with logger.warn
not logger.error/info

* enable Cloudflare Access auth for remote previews

* only send Runtime.discardConsoleEntries if currently connected to runtime

---------

Co-authored-by: Samuel Macleod <[email protected]>
Co-authored-by: MrBBot <[email protected]>
@RamIdeas RamIdeas force-pushed the startDevWorker-release branch from 29d7a4f to c5d1b7b Compare November 23, 2023 16:20
@github-actions
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/6972183860/npm-package-wrangler-4497

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

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

Or you can use npx with this latest build directly:

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

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.20231030.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.

@codecov
Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Merging #4497 (c5d1b7b) into main (961c8ea) will increase coverage by 0.25%.
The diff coverage is 50.83%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4497      +/-   ##
==========================================
+ Coverage   75.25%   75.51%   +0.25%     
==========================================
  Files         226      240      +14     
  Lines       12570    12851     +281     
  Branches     3261     3309      +48     
==========================================
+ Hits         9460     9704     +244     
- Misses       3110     3147      +37     
Files Coverage Δ
packages/wrangler/src/api/index.ts 100.00% <100.00%> (ø)
.../wrangler/src/api/startDevWorker/BaseController.ts 100.00% <100.00%> (ø)
...gler/src/api/startDevWorker/NotImplementedError.ts 100.00% <100.00%> (ø)
...ckages/wrangler/src/api/startDevWorker/devtools.ts 100.00% <100.00%> (ø)
packages/wrangler/src/api/startDevWorker/types.ts 100.00% <100.00%> (ø)
packages/wrangler/src/dev.tsx 82.00% <ø> (-0.41%) ⬇️
packages/wrangler/src/https-options.ts 100.00% <100.00%> (ø)
packages/wrangler/src/api/dev.ts 82.85% <80.00%> (ø)
packages/wrangler/src/dev/miniflare.ts 62.31% <95.00%> (+7.21%) ⬆️
packages/wrangler/src/api/startDevWorker/index.ts 50.00% <50.00%> (ø)
... and 13 more

... and 4 files with indirect coverage changes

@RamIdeas RamIdeas merged commit 01eda78 into main Nov 23, 2023
@RamIdeas RamIdeas deleted the startDevWorker-release branch November 23, 2023 18:54
mrbbot added a commit that referenced this pull request Nov 30, 2023
mrbbot added a commit that referenced this pull request Nov 30, 2023
mrbbot added a commit that referenced this pull request Nov 30, 2023
mrbbot added a commit that referenced this pull request Nov 30, 2023
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.

2 participants