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:
@@ -50,8 +50,24 @@ function sources() {
|
||||
`${code}: an installed PWA would launch left-to-right`);
|
||||
}
|
||||
|
||||
assert.ok(read('templates/index.template.html').includes('src/styles/rtl.css'),
|
||||
'the mirroring stylesheet is not linked from the template');
|
||||
// The sheets are no longer linked one by one; scripts/build-css.js concatenates
|
||||
// them into assets/app.css to save eight render-blocking round trips. So check the
|
||||
// two things that actually matter: rtl.css is still in the bundle's list, and it is
|
||||
// still last in it — its rules exist to win over everything above them.
|
||||
const cssBuild = read('scripts/build-css.js');
|
||||
const order = [...cssBuild.matchAll(/'((?:src|assets)\/[^']+\.css)'/g)].map((m) => m[1]);
|
||||
assert.ok(order.includes('src/styles/rtl.css'),
|
||||
'the mirroring stylesheet is not in the CSS bundle, so it never reaches the page');
|
||||
assert.ok(order.indexOf('src/styles/rtl.css') > order.indexOf('src/styles/components.css'),
|
||||
'rtl.css must come after the sheets it overrides, or the mirroring loses on source order');
|
||||
assert.ok(read('templates/index.template.html').includes('/assets/app.css'),
|
||||
'the template does not link the bundled stylesheet');
|
||||
|
||||
// And that the built file really carries them: a bundler that silently dropped an
|
||||
// input would leave every one of these assertions above still passing.
|
||||
const bundled = read('assets/app.css');
|
||||
assert.match(bundled, /\[dir=["']?rtl["']?\]/,
|
||||
'assets/app.css carries no right-to-left rules (the minifier drops the quotes)');
|
||||
}
|
||||
|
||||
// ── The runtime exposes direction ────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user