You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
turnkey: fold the response stub at the handler edge with commitEventResponse
A middleware that returns its own Response (an API handler that never calls
next()) bypasses createSSRResponse, so stub writes made inside the request
scope — cookies appended to event.response.headers, status — never reached
the wire. The generated handler now applies the runtime's
commitEventResponse(response, event) unconditionally at the handler edge,
strictly after the outermost middleware returns: headers stay mutable
through the whole unwind, committed page responses pass through untouched
(the fold is idempotent), and the per-path applyResponseStub folds (raw
entry.render Responses, server-function responses) collapse into the one
edge fold.
Resolved off a namespace import with a local fallback preserving the old
partial-fold semantics until the .40 repin ships the export in @solidjs/web
(TODO(.40-repin) in the codegen — a named import of a missing export is
fatal in ESM). Turnkey e2e: codegen string assertions (the fold resolves
off the runtime and runs after the unwind) pass against the pinned deps;
the new wire assertion — a /blocked early-return's stub cookie arrives
exactly once — verified 34/34 with the middleware mode against a local
post-repin @solidjs/web build (the mode as committed requires
> 2.0.0-beta.31 for composeMiddleware, per the previous changeset).
Co-authored-by: Cursor <cursoragent@cursor.com>
Turnkey SSR closes the middleware early-return gap with the runtime's `commitEventResponse`: a middleware that answers without calling `next()` (an API handler) bypasses `createSSRResponse`, so its request-scope stub writes — cookies appended to `event.response.headers`, status — never reached the wire. The generated handler now applies `commitEventResponse(response, event)` unconditionally at the handler edge, strictly after the outermost middleware returns: headers stay mutable through the whole unwind, committed page responses pass through untouched (the fold is idempotent), and the inner per-path folds (`applyResponseStub` on raw `entry.render` Responses and server-function responses) collapse into the one edge fold.
6
+
7
+
Until the next `@solidjs/web` repin ships `commitEventResponse` (TODO(.40-repin) in the codegen), the handler resolves it off a namespace import with a local fallback that preserves the previous partial fold semantics — a named import of a missing export would be fatal in ESM — so generated modules keep working against the current beta.31 line and upgrade to the runtime's fold (protocol-header denylist, committed-stub loudness) automatically at the repin.
0 commit comments