feat: add Start CSS crawl filtering - #316
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 1634ae5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
ryansolid
added a commit
that referenced
this pull request
Aug 19, 2026
…FilterOptions = turnkey?.css?.filter` against the old local name while a6a13f2 renamed that local to `startOptions` — the rebase composed the two without a textual conflict, so tsc (TS2304) caught it in CI instead of the pre-merge local gate. One-line internal rename completion, no behavior or API change, so changeset-free like the commit it repairs. css-matrix suite green locally post-fix (82/82 + bridge 19/19). Co-authored-by: Cursor <cursoragent@cursor.com>
ryansolid
added a commit
that referenced
this pull request
Aug 19, 2026
…'s stated use case — opting a node_modules dependency's graph into dev SSR CSS collection — could not work under the raw createFilter composition, twice over: the default /node_modules/ exclude was applied whenever the user set no exclude and createFilter's exclude-wins rule vetoed the included package, and a non-empty include turned the filter into a strict allowlist that rejected the app's own sources, pruning the crawl at the entry roots — an include-only config silently stripped ALL dev SSR CSS (live-repro'd in examples/start-ssr: include /some-ui-lib/ lost App.css from the streamed head while the page still rendered). The crawl walks the graph from the app's entries, so allowlist semantics are structurally wrong for this option; include now RESCUES files on top of the baseline (everything except exclude, which still defaults to /node_modules/ and still gets replaced — not extended — by a user exclude), composed from two createFilters so a file matching both patterns stays excluded, exactly createFilter's own conflict rule. Default and exclude-only behavior are byte-identical to before; empty-array includes are treated as absent (createFilter would read them as allow-all). Coverage the exclude side always had, now mirrored for include: the css-filter mode grew from 2 to 9 assertions across four dev-server sub-runs (exclude / include / conflict / default) against a temp node_modules package written by the harness — a real directory, not a symlink or file: dep, which Vite would realpath outside node_modules and dodge the default exclusion under test — whose JS imports its own CSS (the filter sees JS modules; CSS files bypass it), ssr.noExternal'd so the SSR env can transform the CSS import. Docs that both next.31 start options were missing: README options.start now documents css.filter (include/exclude semantics, dev-only scope) and #315's errorBoundary (generic 500 fallback, no leaked details, dev untouched, errorBoundary: false when middleware owns errors), and the option list gains the absent setup/errorBoundary/css entries; the StartOptions JSDoc for css.filter spells the same semantics. No new changeset — nothing has shipped (#316's changeset is queued unreleased in #313), so the existing start-css-filter changeset's wording is corrected to describe the fixed semantics instead. Full local gate green: start-ssr 349/349 + http-bridge 10/10, css-matrix 82/82 + bridge 19/19, build + tsc clean. Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
start.css.filter.includeandstart.css.filter.excludenode_modulesexcluded by defaultThis ports the CSS crawl option from SolidStart PR #2276. It lets applications opt selected dependency graphs into SSR CSS collection and avoid development FOUC.
Validation
pnpm buildpnpm checknode examples/turnkey/test/run.mjs dev(57/57)node examples/turnkey/test/run.mjs css-filter(2/2)