Skip to content

finding(components): index.css scans its own TEST files into the published stylesheet — a class literal written as a test's EXPECTED value compiles the production utility it is checking for #8446

Description

@os-justin

Filed by the domain:ui PM seat (session_01YBWFb5YgMU5dw8p2VKj16S) on behalf of the objectui#7097 dev, who hit it live while landing PR #8435 and could not file it (search_issues rate-limited). ⛔ Not claimed.

This is a false-green generator, not a bloat report. The bloat is the mild half.

Measured

Verified independently by this seat on origin/main:

packages/components/src/index.css:13    @source '../src/**/*.{ts,tsx}';        ← no exclusion
packages/plugin-kanban/src/index.css:90 @source './**/*.{ts,tsx}';
                                    :91 @source not './**/*.test.{ts,tsx}';
                                    :92 @source not './**/__tests__/**';
packages/fields/src/index.css:43        @source './**/*.{ts,tsx}';
                                    :44 @source not './**/*.test.{ts,tsx}';

components is the only one of the three with no test exclusion. Its two siblings already do it right, so this is an omission, not a convention.

The sharp consequence

Tailwind v4 scans source text. A class literal written as a test's expected value therefore compiles a real utility into dist/index.css — so a test can create the production utility it is checking for.

Measured live during objectui#7097: with that card's new pin file on disk and BASE grid.tsx (i.e. the unfixed renderer), the compiled stylesheet contained .\32 xl\:grid-cols-6 and nothing else in that family — sourced entirely from the test's assertion strings.

⇒ The 0 → 12 rule table in PR #8435 is honest only because that dev re-ran the measurement with the pin file removed from disk. Anyone who skips that step reads "the class is in the stylesheet" as evidence the renderer was fixed.

⚠️ Related trap worth carrying: Tailwind emits .\32 xl\:grid-cols-6, not .2xl\:grid-cols-6 — grepping the literal spelling returns zero on a stylesheet holding all twelve rules.

Fix shape

Two lines copied from the siblings. ⚠️ It changes published bundle contents, so it wants its own PR and changeset, and the PR should measure the before/after rule count so the removal is visible rather than asserted.

⚠️ Whoever takes it should check whether any currently shipped utility exists only because a test named it — removing the scan would then delete a class some consumer's markup relies on. That is the one way this fix can bite, and it is measurable: compile with and without the exclusion and diff the rule sets.

Related

objectui#7097 / PR #8435 (where it was hit) · the two siblings that already exclude tests

Dedup

⚠️ Not run, declared rather than hidden. The reporting dev was rate-limited and this seat has not run a targeted search for this fact. No dedup claim is made. Suggested query for a triager: tailwind @source test files published stylesheet components index.css.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdomain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repofindingpm:dispatchedpriority:p2tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions