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
{{ message }}
Repository navigation
Commit d4e7bc5
Browse filesBrowse the repository at this point in the historyBrowse files
test(build): gate query.ts out of a router-only app
The action gate now bundles a third app — createRouter and useNavigate,
no query, no action — through both resolution paths and fails if it
carries query.ts (its declarations; its one distinctive literal is
server-only). The query app must still carry them, so the markers can't
silently move.
Co-authored-by: Cursor <[email protected]>
Copy file name to clipboardExpand all lines: .changeset/flat-build-action-split.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,4 +4,4 @@
4
4
5
5
Router apps that never import `action` no longer bundle the action layer through the flat build (#655). The flat `dist/index.js` — what Rolldown, esbuild and webpack resolve without the `solid` condition — was built with `inlineDynamicImports`, which turned the server-function form fallback's lazy import into a static reference to all of `action.ts`: the form-submit handler, submission and `aria-busy` state, the single-flight consumer, and signals' `action`. The flat build now emits `action.ts` and `query.ts` as their own modules (`dist/index-action.js`, `dist/index-query.js`, with the rest in `dist/index-core.js` and `dist/index.js` as the re-exporting entry), so a bundler keeps the fallback's target as a lazy chunk exactly as it does for the `solid` condition's per-module output.
6
6
7
-
No behavior change. The action layer still installs itself into the router's seams on the first `action()` (form handler, form claims, flight consumer, flash decoder); a submit before that leaves client-only action urls to the browser and runs server-function forms through the lazily loaded action module. Measured with solidjs/solid's size harness (Rolldown, brotli): the router standalone drops from 32,480 B to 27,456 B minified (11,232 → 9,653 B br) for an app without `action`; the `page: base + router` scenario drops 8,372 B minified (2,565 B br). Apps that import `action` pay ~230 B minified (≤ 76 B br) for the module boundaries. `pnpm build` now runs `scripts/check-action-gate.mjs`, which bundles a router+ `query` app with and without `action` through both resolution paths and fails if the action layer reaches the read-only app's eager graph.
7
+
No behavior change. The action layer still installs itself into the router's seams on the first `action()` (form handler, form claims, flight consumer, flash decoder); a submit before that leaves client-only action urls to the browser and runs server-function forms through the lazily loaded action module. Measured with solidjs/solid's size harness (Rolldown, brotli): the router standalone drops from 32,480 B to 27,456 B minified (11,232 → 9,653 B br) for an app without `action`; the `page: base + router` scenario drops 8,372 B minified (2,565 B br). Apps that import `action` pay ~230 B minified (≤ 76 B br) for the module boundaries. `pnpm build` now runs `scripts/check-action-gate.mjs`, which bundles a router-only app, a router + `query` app, and the same with `action` through both resolution paths, and fails if the action layer reaches an app without `action` or query.ts reaches the router-only app.
0 commit comments