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: teach unstable_dev about the internet (remote mode) #1967

Merged
merged 14 commits into from Sep 30, 2022

Conversation

rozenmd
Copy link
Contributor

@rozenmd rozenmd commented Sep 30, 2022

How to review this PR:

  • Start in fixtures/local-mode-tests/tests/unstableDev.test.ts, where we call unstable_dev with local: false
  • We then modify packages/wrangler/src/api/dev.ts, and make it possible to configure the local setting in unstable_dev
  • We then pass that down to packages/wrangler/src/dev.tsx, in startApiDev
  • We then move to packages/wrangler/src/dev/start-server.ts, where we pass local to startDevServer, which uses it to decide whether to start a local, or remote server
  • Remote server is implemented in packages/wrangler/src/dev/remote.tsx
  • Finally, we define a proxy server here: packages/wrangler/src/proxy.ts, which gets called by startRemoteServer above

Closes #1780

@rozenmd rozenmd self-assigned this Sep 30, 2022
@changeset-bot
Copy link

changeset-bot bot commented Sep 30, 2022

🦋 Changeset detected

Latest commit: b62df56

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

This PR includes changesets to release 1 package
Name Type
wrangler 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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 30, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/3159311155/npm-package-wrangler-1967

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1967/npm-package-wrangler-1967

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/3159311155/npm-package-wrangler-1967 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.developers.workers.dev/runs/3159311155/npm-package-cloudflare-pages-shared-1967

@rozenmd rozenmd marked this pull request as ready for review September 30, 2022 12:16
@rozenmd
Copy link
Contributor Author

rozenmd commented Sep 30, 2022

This is ready for review, I just need a functioning API key + account ID to make the tests pass.

@codecov
Copy link

codecov bot commented Sep 30, 2022

Codecov Report

Merging #1967 (b62df56) into main (15ca338) will decrease coverage by 2.18%.
The diff coverage is 10.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1967      +/-   ##
==========================================
- Coverage   74.91%   72.73%   -2.19%     
==========================================
  Files         116      118       +2     
  Lines        7962     8230     +268     
  Branches     2079     2160      +81     
==========================================
+ Hits         5965     5986      +21     
- Misses       1997     2244     +247     
Impacted Files Coverage Δ
packages/wrangler/src/api/dev.ts 69.23% <ø> (ø)
packages/wrangler/src/proxy.ts 14.46% <0.00%> (-1.82%) ⬇️
packages/wrangler/src/dev/remote.tsx 6.70% <2.12%> (ø)
packages/wrangler/src/dev/start-server.ts 66.66% <50.00%> (-2.84%) ⬇️
packages/wrangler/src/dev.tsx 85.84% <100.00%> (+0.06%) ⬆️
packages/wrangler/src/create-worker-preview.ts 8.95% <0.00%> (ø)
...ackages/wrangler/src/__tests__/helpers/mock-bin.ts 100.00% <0.00%> (+5.26%) ⬆️

Copy link
Contributor

@JacobMGEvans JacobMGEvans left a comment

Choose a reason for hiding this comment

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

Looks great! I am excited to see this in action in the wild 😄

@rozenmd rozenmd merged commit 02261f2 into main Sep 30, 2022
@rozenmd rozenmd deleted the add-remote-mode-unstable_dev branch September 30, 2022 15:43
@github-actions github-actions bot mentioned this pull request Sep 30, 2022
@rozenmd rozenmd restored the add-remote-mode-unstable_dev branch October 3, 2022 13:00
@rozenmd rozenmd deleted the add-remote-mode-unstable_dev branch October 6, 2022 15:18
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: unstable_dev should work over remote mode
2 participants