perf(build): budget the runtime on what ships, not on source bytes
The runtime budgets measured raw source, which counts comments -- and the
production build minifies, so comments cost a visitor nothing. The metric
therefore rewarded deleting explanatory comments over writing smaller code,
and could not tell a real feature from a wall of prose.
They now measure the minified output, which is what is actually served:
/__wrnexus/reactive.js is its own file, minified, with an immutable year-long
cache. The reactive runtime is 69684 minified against a 80000 budget, from
175246 raw -- roughly 21kB gzipped, fetched once.
Also fixes two real bugs found while testing the showcase:
- object-valued props were serialised as a bare {...} attribute, which the
compiler read as interpolation and tried to parse as JavaScript. That
returned 500 for /components/navbar. Arrays start with [ and were never
affected, which is why only object props broke. All 108 pages now render.
- the runtime walked text nodes inside textarea, script and style, so a
JSON sample in a textarea was evaluated away.
Navbar styles move out of ui.css into the component, matching the rest of the
navigation group. No declarations changed: 4519 before and after.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -164,77 +164,77 @@ page FooterDetail {
|
||||
<form class="playground-controls" data-playground-form>
|
||||
<header><div><span>Component props</span><strong>8 controls</strong></div><button type="reset"><span class="icon-[lucide--rotate-ccw] size-4" aria-hidden="true"></span>Reset</button></header>
|
||||
<div class="playground-fields"><label class="playground-field" for="playground-footer-size"><span><strong>size</strong><small>string</small></span><select id="playground-footer-size" name="pg_size"><option value="default" selected>default</option><option value="compact">compact</option><option value="spacious">spacious</option><option value="xs">xs</option><option value="sm">sm</option><option value="md">md</option><option value="lg">lg</option><option value="xl">xl</option><option value="icon">icon</option><option value="icon-xs">icon-xs</option><option value="icon-sm">icon-sm</option><option value="icon-lg">icon-lg</option></select></label><label class="playground-field" for="playground-footer-color"><span><strong>color</strong><small>string</small></span><select id="playground-footer-color" name="pg_color"><option value="primary" selected>primary</option><option value="secondary">secondary</option><option value="success">success</option><option value="warning">warning</option><option value="danger">danger</option><option value="info">info</option></select></label><label class="playground-field" for="playground-footer-label"><span><strong>label</strong><small>string</small></span><input id="playground-footer-label" name="pg_label" type="text" value="Footer" /></label><label class="playground-field" for="playground-footer-items"><span><strong>items</strong><small>unknown[]</small></span><textarea id="playground-footer-items" name="pg_items" rows="5" spellcheck="false" data-playground-json>[
|
||||
{
|
||||
{
|
||||
"type": "header",
|
||||
"label": "Product",
|
||||
"description": "Build consistent interfaces with WRNexusJS.",
|
||||
"items": [
|
||||
{
|
||||
{
|
||||
"label": "Components",
|
||||
"href": "/base"
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"label": "Themes",
|
||||
"href": "/themes"
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"label": "Examples",
|
||||
"href": "/blocks"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"type": "header",
|
||||
"label": "Developers",
|
||||
"items": [
|
||||
{
|
||||
{
|
||||
"label": "Documentation",
|
||||
"href": "/docs"
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"label": "Installation",
|
||||
"href": "/installation"
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"label": "Framework guides",
|
||||
"href": "/framework-guides"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"type": "header",
|
||||
"label": "Resources",
|
||||
"items": [
|
||||
{
|
||||
{
|
||||
"label": "Accessibility",
|
||||
"href": "/accessibility"
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"label": "Design tokens",
|
||||
"href": "/colors"
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"label": "Typography",
|
||||
"href": "/fonts"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"type": "header",
|
||||
"label": "Company",
|
||||
"items": [
|
||||
{
|
||||
{
|
||||
"label": "WorkRoot",
|
||||
"href": "https://workroot.in",
|
||||
"external": true
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"label": "WRNexusJS",
|
||||
"href": "https://wrnexusjs.dev",
|
||||
"external": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]</textarea><em data-playground-error></em></label><label class="playground-field" for="playground-footer-columns"><span><strong>columns</strong><small>number</small></span><input id="playground-footer-columns" name="pg_columns" type="number" value="4" /></label><label class="playground-field" for="playground-footer-maxWidth"><span><strong>max Width</strong><small>string</small></span><select id="playground-footer-maxWidth" name="pg_maxWidth"><option value="wide" selected>wide</option><option value="compact">compact</option><option value="xl">xl</option><option value="full">full</option><option value="lg">lg</option><option value="2xl">2xl</option></select></label><label class="playground-field" for="playground-footer-copyright"><span><strong>copyright</strong><small>string</small></span><input id="playground-footer-copyright" name="pg_copyright" type="text" value="" /></label><label class="playground-field" for="playground-footer-class"><span><strong>class</strong><small>string</small></span><input id="playground-footer-class" name="pg_class" type="text" value="showcase-instance showcase-instance--1" /></label></div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user