fix(css): give the unminified-CSS warning a remedy that works - #3600
Conversation
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.
|
Warning Review limit reached
Next review available in: 8 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
There was a problem hiding this comment.
💡 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".
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.
Round-2 verification finding [9]: "Production builds emit unminified CSS behind an internal-sounding warning." Marked
still-broken-after-fixagainst published0.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 contractsresolve()guards are satisfied bybuiltin-deferredextensions, whichbuiltin-extensions.tsauto-imports the moment the package is installed.@veryfront/ext-css-lightningis not one of those. Its manifest declaresactivation: "explicit", anddiscoverBoundProjectExtensionsskips explicit-activation extensions outright: "only a materializedconfig.extensionsentry may activate them." Installing the package therefore registers nothing.deno addis also the wrong command for a scaffolded project, which is an npm project with apackage.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, thenveryfront build:npm install @veryfront/ext-css-lightning(the message's advice)extCssLightning()toextensionsinveryfront.config.tsThe middle row is the defect: the framework's own instruction, carried out, changes nothing.
The change
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 serveon the same scaffold, run against this branch'scli/main.ts:! 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.veryfront serveprints 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).
aabf75f45reworded 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-lightningisrootNpm: falseinfirst-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
extensionsarray inveryfront.config.ts, whichdocs/guides/extensions.md§ "Enable an extension" already documents.