biagiojs

Business weights

biagiojs doesn't ask "how do we render faster?" but "what should hit the wire first to maximize business outcomes?"

Every component declares weights (0–1) and costs (numeric). The framework computes priority automatically.

Weight table

WeightWhat it controls
conversionHydration & preload priority — and HTML source order in contentOrder: 'priority'
seoSEO-critical content, SCRT metric
interactionUser interaction probability → hydration
cpuRender cost (1–10)
networkKB transferred for asset preload

Reference values

Don't invent random numbers. Use this guide:

Component typeconversionseointeraction
Hero / headline0.8–0.91.00.1–0.2
Primary CTA1.00.30.8–0.9
Price / offer0.90.80.1
Article body0.41.00.05
Navigation0.20.30.4
Chat widget (300 KB)0.050.10.03
Footer0.050.10.02

Formulas

Rendering:priority = businessValue / (cpuCost + 0.5 × memoryCost)

Hydration:priority = interaction × businessValue × cpuAvailability

Network:priority = businessValue / networkCost_KB

businessValue combines the three signals with BUSINESS_WEIGHTS:

businessValue = 0.6 × conversion + 0.25 × seo + 0.15 × interaction

These coefficients are a documented, overridable knob — not magic numbers. Override them globally via site.weights (auto-normalized to sum 1), and the optimizer recalibrates them from field data:

// biagio.config.js
site: { weights: { conversion: 0.7, seo: 0.2, interaction: 0.1 } }

Concrete example

A 300 KB chat widget with conversion="0.05" and interaction="0.03":

  • Hydration priority: 0.03 × 0.05 = 0.0015 → below lazy threshold (0.05)
  • Result: static HTML, zero JavaScript shipped

A CTA with conversion="1" and interaction="0.85":

  • Priority: 0.85 × 1.0 = 0.85eager (hydrates right after paint)

Optimizer and field data

Put JSON in reports/ (CrUX, analytics, heatmap) and each build recalibrates interactionProbability and hydration thresholds from real data.

biagio pull-vitals https://yoursite.com .

Golden rule

Static is the desired default. Every hydrate must justify a real interaction.

Try the interactive playground on the homepage — move the sliders and watch the plan update live.

Weights inspector (dev)

In biagio dev, every page with overlay: true (default in dev) shows a Weights inspector panel (top-right):

  • Sliders for conversion, seo, interaction per component
  • Live eager / lazy / static plan
  • Export copies weight snippets to the clipboard

Analyze without building

biagio explain pages/index.page.js

Prints render order, hydration tiers and estimated island KB for a single file.