-
Notifications
You must be signed in to change notification settings - Fork 774
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 dev
with dynamic sites + miniflare assets plugin
#6564
Conversation
🦋 Changeset detectedLatest commit: 3b4d90f The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
96da898
to
6ef84d5
Compare
wrangler dev
with dynamic siteswrangler dev
with dynamic sites + miniflare assets plugin
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/10634012860/npm-package-wrangler-6564 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6564/npm-package-wrangler-6564 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10634012860/npm-package-wrangler-6564 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10634012860/npm-package-create-cloudflare-6564 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10634012860/npm-package-cloudflare-kv-asset-handler-6564 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10634012860/npm-package-miniflare-6564 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10634012860/npm-package-cloudflare-pages-shared-6564 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10634012860/npm-package-cloudflare-vitest-pool-workers-6564 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10634012860/npm-package-cloudflare-workers-editor-shared-6564 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10634012860/npm-package-cloudflare-workers-shared-6564 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
6ab6490
to
1c8d39b
Compare
a2883c9
to
0077d5e
Compare
1431074
to
5e56c5c
Compare
|
||
`workers-with-assets` is a test fixture that showcases Workers with Assets. This particular fixture sets up an assets-only Workers project. | ||
`workers-assets-with-user-worker"` is a test fixture that showcases Workers with Assets. This particular fixture sets up a User Worker, assets, and a binding from the user Worker to the assets. |
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.
:meouw-heart:
5e56c5c
to
83fcef8
Compare
packages/miniflare/src/index.ts
Outdated
@@ -1250,6 +1250,7 @@ export class Miniflare { | |||
loopbackPort, | |||
log: this.#log, | |||
proxyBindings, | |||
hasWorkerAssets: !!this.#workerOpts[0].assets.assets, |
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.
This is a fun assignment 😆
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.
hmmm...that is true
1048a0f
to
514e943
Compare
61909d3
to
3b4d90f
Compare
What this PR solves / how to test
This creates a new
assets
miniflare plugin. The Asset Worker and Router Worker are imported fromworkers-shared
and used as miniflare services. If assets are detected, the miniflare entry worker will always point towards the Router Worker instead of the User Worker like it usually does.We also add in a config object that can be passed to Router Worker. Currently this only contains
{hasUserWorker: boolean}
, but will be used later for other routing config.User Worker + Assets diagram. If there is no UW, this remains the same except wrangler provides a no-op worker that cannot be reached.
Author has addressed the following