v6.7.3: faster loading, and pages search engines can read
The bundles carried all thirteen translations at once and a page fetched them a third time as raw source; each page now loads only its own language. Alongside that: JavaScript is minified, the eight stylesheets are served as one file, the QR scanner is fetched after the app is up instead of on every visit, Inter ships once rather than five copies of the same file, and Font Awesome is subset to the 82 icons this app draws instead of all 2468. 1.85 MB across 43 requests becomes under 700 KB across 33. On mobile the page starts drawing in 1.6 s instead of 6.3 s and is usable in 4.5 s instead of 11 s. Pages also carry their text in the HTML now. Everything was drawn by JavaScript into an empty div, so crawlers saw correct metadata around nothing, and twelve of the thirteen language pages had never been shown to anyone. The documentation is published under /docs/ with a new FAQ, and unknown addresses return a real 404. Separately: the localized shells were served with the year-long immutable cache header meant for static assets, which pinned anyone who opened /de/ or /ru/ to that build. The header is fixed and the service worker refreshes what it cached. Claude-Session: https://claude.ai/code/session_014KjzTXxrhzYoDDWChYQ4u2
This commit is contained in:
@@ -255,10 +255,16 @@ assert.ok(!app.includes("behavior: 'smooth'"),
|
||||
"no raw behavior:'smooth' — it must go through scrollBehavior()");
|
||||
assert.match(app, /const scrollBehavior = \(\) =>/);
|
||||
|
||||
// The stylesheet has to load, and it has to load last.
|
||||
assert.match(html, /apple-motion\.css/, 'apple-motion.css must be linked');
|
||||
const idxMotion = html.indexOf('apple-motion.css');
|
||||
const idxComponents = html.indexOf('components.css');
|
||||
// The stylesheet has to reach the page, and it has to come after the one it argues
|
||||
// with. The sheets are no longer linked individually — scripts/build-css.js concatenates
|
||||
// them into assets/app.css to save eight render-blocking round trips — so the order that
|
||||
// matters is the order in that list, which is the order they end up in the file.
|
||||
assert.match(html, /\/assets\/app\.css/, 'the page must link the bundled stylesheet');
|
||||
const cssOrder = [...readFileSync(new URL('../scripts/build-css.js', import.meta.url), 'utf8')
|
||||
.matchAll(/'((?:src|assets)\/[^']+\.css)'/g)].map((m) => m[1]);
|
||||
const idxMotion = cssOrder.indexOf('src/styles/apple-motion.css');
|
||||
const idxComponents = cssOrder.indexOf('src/styles/components.css');
|
||||
assert.ok(idxMotion !== -1, 'apple-motion.css is not in the CSS bundle, so it never reaches the page');
|
||||
assert.ok(idxMotion > idxComponents,
|
||||
'apple-motion.css must come after components.css — it settles arguments on source order');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user