Skip to content

fix(css): give the unminified-CSS warning a remedy that works - #3600

Merged
kojiwakayama merged 2 commits into
mainfrom
fix/dx-20260811-r2-9
Aug 11, 2026
Merged

fix(css): give the unminified-CSS warning a remedy that works#3600
kojiwakayama merged 2 commits into
mainfrom
fix/dx-20260811-r2-9

Conversation

@kojiwakayama

@kojiwakayama kojiwakayama commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Round-2 verification finding [9]: "Production builds emit unminified CSS behind an internal-sounding warning." Marked still-broken-after-fix against published 0.1.1229.

Why the previous fix missed

#3575 changed two things: it reported the missing optimizer once per process instead of once per session acquisition, and it appended Install one with: deno add @veryfront/ext-css-lightning.

The frequency half worked. The actionability half did not, because the hint was borrowed from resolve(), where it is correct — the contracts resolve() guards are satisfied by builtin-deferred extensions, which builtin-extensions.ts auto-imports the moment the package is installed.

@veryfront/ext-css-lightning is not one of those. Its manifest declares activation: "explicit", and discoverBoundProjectExtensions skips explicit-activation extensions outright: "only a materialized config.extensions entry may activate them." Installing the package therefore registers nothing. deno add is also the wrong command for a scaffolded project, which is an npm project with a package.json.

So the diagnosis in #3575 was right about the noise and wrong about the remedy: it made a dead end read as a next step.

Reproduction against published 0.1.1229

veryfront init support-agent --template ai-agent, then veryfront build:

step CSS bytes warning
untouched scaffold 90,684 shown
after npm install @veryfront/ext-css-lightning (the message's advice) 90,684 still shown
after also adding extCssLightning() to extensions in veryfront.config.ts 71,466 gone

The middle row is the defect: the framework's own instruction, carried out, changes nothing.

The change

- No CSSOptimizationEngine registered; emitting unminified CSS. Install one with: deno add @veryfront/ext-css-lightning
+ Veryfront emits unminified CSS because no CSS optimizer is active. Install @veryfront/ext-css-lightning, then add it to "extensions" in veryfront.config.ts

Effect first, package named, second step named, package manager left to the project. The contract name leaves the instruction — it is an internal registration hook no guide mentions, and the record already carries component=css-compiler. Once-per-process reporting and the re-arm on observing an engine are unchanged.

This aligns the styles-builder path with src/build/asset-pipeline/index.ts, which already said "Install and explicitly compose @veryfront/ext-css-lightning".

Verification against the finding's own command

veryfront build ; veryfront serve on the same scaffold, run against this branch's cli/main.ts:

  • no config entry → ! Veryfront emits unminified CSS because no CSS optimizer is active. Install @veryfront/ext-css-lightning, then add it to "extensions" in veryfront.config.ts, CSS 90,740 bytes.
  • following that message exactly → no warning, CSS 71,506 bytes, minified.
  • veryfront serve prints it once before ✓ Ready; two HTTP renders add no further occurrences (grep -c = 1), so fix(css): report a missing CSS optimizer once, and say how to add one #3575's once-per-process behaviour is preserved.

The regression test was written first and failed for the right reason (no emitted record contained the expected phrase).

aabf75f45 reworded the message into active voice per AGENTS.md § Public copy rules, after review; the byte counts above are from that build.

Scope

Not addressed here, deliberately: the default production build still emits unminified CSS, because ext-css-lightning is rootNpm: false in first-party-defaults.ts — a documented policy that keeps native-FFI and output-changing extensions out of the root install. Shipping a minifier by default is a product decision, not a bug fix. What this PR fixes is that a developer who wants minification can now reach it by following the message.

No doc change is required: the message points at the extensions array in veryfront.config.ts, which docs/guides/extensions.md § "Enable an extension" already documents.

The missing-optimizer warning told developers to run
`deno add @veryfront/ext-css-lightning`. Following it changes nothing.

`@veryfront/ext-css-lightning` declares `activation: "explicit"`, so
installing the package registers no CSSOptimizationEngine on its own --
only a `veryfront.config.ts` `extensions` entry activates it. The hint was
borrowed from `resolve()`, where it is correct because those contracts are
satisfied by auto-activating extensions. `deno add` is also the wrong
command for a scaffolded project, which is an npm project.

So the warning read as actionable, the developer acted on it, and the build
still shipped unminified CSS with the same warning. On the 0.1.1229 ai-agent
scaffold: 90,684 bytes before, and 90,684 bytes after `npm install
@veryfront/ext-css-lightning`. Installing *and* adding the factory to
`extensions` drops it to 71,506 bytes and clears the warning.

State the effect first, name the package, and name the second step. The
contract name leaves the instruction -- it is an internal registration hook
no guide mentions, and `component=css-compiler` already identifies the
source. Reporting stays once per process, as before.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kojiwakayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c43a2ea3-c0e4-48cb-95fa-b5364b136fc8

📥 Commits

Reviewing files that changed from the base of the PR and between 6f30f87 and aabf75f.

📒 Files selected for processing (2)
  • src/html/styles-builder/css-provider-session.test.ts
  • src/html/styles-builder/tailwind-compiler.ts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 266bc3e558

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/html/styles-builder/tailwind-compiler.ts Outdated
AGENTS.md "Public copy rules" require present tense and active voice for
warnings exposed to users, and name the product as "Veryfront". "CSS is not
minified" is passive. Name the actor.

Re-verified on the 0.1.1229 ai-agent scaffold: 90,740 bytes and the warning
without the config entry, 71,506 bytes and no warning with it.
@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 00ae06b Aug 11, 2026
33 checks passed
@kojiwakayama
kojiwakayama deleted the fix/dx-20260811-r2-9 branch August 11, 2026 21:00
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.

1 participant