-
Notifications
You must be signed in to change notification settings - Fork 753
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(wrangler): Add remote mode support for Workers + Assets #7380
Conversation
🦋 Changeset detectedLatest commit: 0f449e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
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/12374611637/npm-package-wrangler-7380 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7380/npm-package-wrangler-7380 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-wrangler-7380 dev path/to/script.js Additional artifacts:wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-cloudflare-workers-bindings-extension-7380 -O ./cloudflare-workers-bindings-extension.0.0.0-vcafe9975c.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vcafe9975c.vsix npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-create-cloudflare-7380 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-cloudflare-kv-asset-handler-7380 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-miniflare-7380 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-cloudflare-pages-shared-7380 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-cloudflare-unenv-preset-7380 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-cloudflare-vitest-pool-workers-7380 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-cloudflare-workers-editor-shared-7380 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-cloudflare-workers-shared-7380 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12374611637/npm-package-cloudflare-workflows-shared-7380 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
065afe9
to
aba3f32
Compare
try { | ||
const { workerAccount, workerContext } = await getWorkerAccountAndContext( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving this code higher in the call chain so we can extract the Worker scriptId
and pass it into createRemoteWorkerInit
. createRemoteWorkerInit
needs the Worker name to be defined so that it can make the assets upload API call, which would otherwise have unintended side effects
The logic of this code block has not changed!
aba3f32
to
eddd402
Compare
eddd402
to
619b25e
Compare
619b25e
to
5b20edd
Compare
b2c0f6d
to
ac26cc7
Compare
Just to clarify, this is just running the user worker in remote preview, right? The asset & router worker are both still just the production ones, I thought? |
yes, that is correct |
ac26cc7
to
0f449e9
Compare
Fixes DEVX-1522
This PR adds remote mode support in
wrangler dev
for Workers + Assets.The current implementation will always upload assets to the edge, before deploying the User Worker to Edge Preview (which is what
wrangler dev --remote
already does). This means that for Workers + Assets, the User Worker, Router Worker, Asset Workers, the assets and any other resources all run at the edge (see diagram below).Screenshots
wrangler dev --remote
support cloudflare-docs#18469