Repository navigation
feat(cloudflare/workers): assets-only Workers (no script) - #969
Merged
Merged
Conversation
…tory with no script Omitting both main and script (with assets set) now uploads a script-less Worker: Cloudflare's asset layer serves every request and applies htmlHandling/notFoundHandling itself, matching assets-only wrangler deploy. Local dev serves a stub that delegates to the ASSETS binding. Website.StaticSite drops its injected passthrough stub and deploys assets-only when no main/script is given. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Install the packages built from this commit: alchemy bun add alchemy@https://pkg.ing/alchemy/4169d6a@alchemy.run/better-auth bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/4169d6a@alchemy.run/pr-package bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/4169d6a |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sam-goodwin
added a commit
that referenced
this pull request
Jul 28, 2026
Conflict: main's assets-only Workers (#969) added its dev-mode support to LocalWorkerProvider's old runInstance structure, which this branch replaced with LocalProvider.make. Resolved by porting the feature into the new structure: an `assetsOnly` flag on the resolved (hashed) config and a runAssetsOnly branch in the start dispatch serving the ASSETS-delegating stub. Added AssetsOnly.local.test.ts to pin the dev-mode path (main only covered the live deploy). Co-authored-by: Cursor <cursoragent@cursor.com>
john-royal
added a commit
that referenced
this pull request
Jul 30, 2026
Brings in 94 commits from main (local vs live provider modes #963, workersDev/domain props #977, Worker.URL self-binding #964, assets-only Workers #969, Prisma provider #416, version affinity #985, telemetry #860) while preserving this branch's SourceProvider architecture and Website framework integrations. - Worker providers take main's side wholesale; the SourceProvider integration is re-grafted as a dispatch: `props.source` routes through `resolveSource`/`loadSource` (build, hash slots, and local dev in both server and bundle modes via the make-before-break serve path), while script/vite/python/prebuilt/assets-only workers keep main's paths. - Apply.ts: both sides landed the resolved-bindings persistence fix (#874 / ef08f4c); merged as the union, keeping `providerMode` and `bindings` on replaced-state commits. - test Utils/Http.ts: keep main's generalized retryResponse machinery (expectUrlRedirect/expectUrlHeader) and re-add expectDirectStatus on top of it. - Website tests track main's API: `url`/`subdomain` props fold into `workersDev`; dev-mode R2 cleanup skips virtual `dev:` buckets. - cloudflare-tools submodule bumped to this branch's merge of its own upstream main (59c3861); distilled synced to main's pointer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Worker with only an assets directory — no
main, noscript, no build — now deploys as a true assets-only Worker, matching an assets-onlywrangler deploy:No script is uploaded at all (the PUT carries no
main_moduleand no modules — the same wire shape the Vite assets-only path already uses), so Cloudflare's asset layer serves every request and applieshtmlHandling/notFoundHandling(including SPA fallback) itself. Static asset requests are free and never invoke a Worker.prepareAssetsAndBundleskips bundling whenmain/script/viteare all absent; a Worker with none ofmain/script/assetsdies with a clear errorhasChangedgains the matching diff branch (a stored bundle hash means "converting from a script Worker" → deploy)ASSETSbinding (the local runtime requires a user worker module); the assets worker applies the routing config itselfWebsite.StaticSitedrops its injected passthrough stub and deploys assets-only when nomain/scriptis givenWorker, updatedStaticSiteJSDoc, andstatic-site.mdxnow shows the plain-Worker form for no-build sitesLive-tested: fresh assets-only deploy (custom 404 page served by the asset layer), asset update, conversion to a script Worker and back (AssetsOnlyWorker.test.ts); all 7 existing StaticSite tests pass with the stub removed.
🤖 Generated with Claude Code