Skip to content

fix(void): better asset routing pipeline - #209

Merged
cpojer merged 3 commits into
mainfrom
fix/asset-routing-pipeline
May 19, 2026
Merged

cpojer merged 3 commits into
mainfrom
fix/asset-routing-pipeline

Conversation

@TheAlexLichter

@TheAlexLichter TheAlexLichter commented May 18, 2026 •

Copy link
Copy Markdown
Member

This PR aims to create a clear asset routing pipeline and avoids confusion about when the following components of the platform trigger:

  • The worker (middleware/api routes/pages)
  • The static assets via ASSETS binding
  • The fallback logic

Change overview table

Shape Current branch behavior Prior main behavior What changed in this PR
Static (non-SPA) App No worker. Assets and document requests are served by the asset platform. Misses return 404.html or a platform 404. Same. No behavioral change.
Static SPA deploy No worker. Assets and document requests are served by the asset platform. Unmatched navigations fall back to /index.html; user routing.fallbacks still layer in front of the implicit SPA fallback. Same. No behavioral change.
Void app with only /api routes Worker is deployed, but static assets and document navigations stay asset-first. API asset misses fall through to the worker route table. Any routes/ file was treated as worker-owned HTML. This preserved API-before-fallback semantics, but also routed frontend navigations through the worker instead of using platform SPA fallback directly. /api and /api/* no longer count as document routes. API-only apps are kept closer to static SPA behavior, with the tradeoff that API-before-fallback semantics depend on asset-platform fallthrough unless API paths are separately scoped worker-first.
Void app with middleware/, managed auth, non-/api routes, WebSockets, or live bindings Worker-first. Generated asset config uses not_found_handling: "none" and run_worker_first; after routes and middleware run, non-SSR/non-Pages apps serve /index.html for unmatched HTML requests. Middleware, auth, routes, and WebSockets could trigger worker-side SPA fallback, but the deploy/dev policy was split across multiple helpers and deploy did not carry the same explicit run_worker_first shape. Live bindings were not part of the shared asset-routing decision. Worker ownership is centralized and explicit. SPA fallback moves behind middleware/auth while preserving deep links. Live bindings also force worker-owned HTML.
Pages, SSR, and framework apps Worker-first. Asset misses stay 404 at the asset binding. Pages, SSR, or the framework own HTML responses, including intentional HTML 404s. Mostly same intent: these apps used not_found_handling: "none" and did not rely on platform SPA fallback for HTML. The policy is now expressed through the same shared helper for Void SSR/Pages paths, and generated run_worker_first is explicit where Void owns the worker config.

Follow-up of #165

@netlify

netlify Bot commented May 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for staging-void-cloud ready!

Name Link
🔨 Latest commit 768dbb8
🔍 Latest deploy log https://app.netlify.com/projects/staging-void-cloud/deploys/6a0b39065f010d0008138e61
😎 Deploy Preview https://deploy-preview-209--staging-void-cloud.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@TheAlexLichter
TheAlexLichter marked this pull request as draft May 18, 2026 14:51
@TheAlexLichter TheAlexLichter changed the title fix(void): clarify asset routing pipeline fix(void): better asset routing pipeline May 18, 2026
@TheAlexLichter
TheAlexLichter force-pushed the fix/asset-routing-pipeline branch from 306f9b3 to 4f6a6ee Compare May 18, 2026 15:11
@TheAlexLichter
TheAlexLichter marked this pull request as ready for review May 18, 2026 16:02
@cpojer
cpojer merged commit 9555488 into main May 19, 2026
9 checks passed
@cpojer
cpojer deleted the fix/asset-routing-pipeline branch May 19, 2026 00:44
cpojer pushed a commit that referenced this pull request Sep 11, 2026
…cates (#209)

Tests 5 (KV) and 8 (Queues) passed a predicate to page.waitForResponse
whose parameter is `response`, but the body referenced an undefined `r`,
so every run threw `page.waitForResponse: r is not defined`
(ReferenceError). `r` is a leftover from renaming the param `r` ->
`response` in #45 that missed these two `.request()` calls.

Latent since #45 (Mar 22) — the smoke test never reached the test phase
until the deploy step was unblocked in #208. With deploy fixed, 9/11
tests pass and only these two failed for this reason.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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