Skip to content

perf(site): optimize website performance to A grade#66

Merged
kascit merged 2 commits into
mainfrom
fix-site-performance
Jul 21, 2026
Merged

perf(site): optimize website performance to A grade#66
kascit merged 2 commits into
mainfrom
fix-site-performance

Conversation

@kascit

@kascit kascit commented Jul 21, 2026

Copy link
Copy Markdown
Owner

This PR optimizes website performance to achieve at least an A grade by: 1. Lazy loading the WebMCP bridge JS module dynamically on idle. 2. Inlining page-specific LQIP stylesheet rules instead of loading a global lqip.css file. 3. Transitioning opacity instead of filter (blur) to use composited card hover glow animations.

Copilot AI review requested due to automatic review settings July 21, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Performance-focused PR that shifts some work off the critical path (idle-time module loading), reduces render-blocking CSS, and tweaks hover effects to rely more on composited properties.

Changes:

  • Defer WebMCP initialization by dynamically importing it during requestIdleCallback/idle time.
  • Remove the global lqip.css include and instead inline page-specific LQIP background rules during the HTML post-processing step.
  • Update feature/testimonial card glow hover behavior to transition opacity (rather than animating blur).

Reviewed changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
templates/macros/landing_sections.html Adjusts hover glow classes to transition opacity for better compositor-friendly animation.
templates/macros/head.html Removes global lqip.css stylesheet references.
static/js/shell.min.js Large update to the minified shell bundle output included in static/js/.
static/js/core/main.js Moves WebMCP init into idle-time dynamic import to reduce eager startup cost.
scripts/validate-xml-xsl.js Changes missing-xmllint behavior from hard-fail to skip-with-warning.
scripts/minify-js.js Uses repo-root-relative JS paths when invoking terser/esbuild.
scripts/lib/shared.js Adds a 1s spawnSync timeout to runCapture() used by multiple build scripts.
scripts/inject-responsive-image-markup.js Collects per-page LQIP keys and injects inline <style> rules into HTML <head>.
justfile Removes the “generate LQIP stylesheet” post-build step.

Comment thread scripts/lib/shared.js
Comment on lines 34 to 36
encoding: "utf8",
timeout: 1000,
});
Comment on lines +188 to +199
let finalHtml = after;
if (collectedKeys.size > 0) {
const rules = [];
for (const key of collectedKeys) {
const data = manifest[key];
const className = lqipClassName(key);
const lqip = escapeCssUrl(data.lqip);
rules.push(`.${className}{background-image:url("${lqip}");background-size:cover;background-position:center;}`);
}
const styleTag = `<style>${rules.join("\n")}</style>`;
finalHtml = finalHtml.replace("</head>", `${styleTag}</head>`);
}
Comment on lines 80 to 84
if (xmllintCheck.status !== 0) {
console.error("xmllint is required for XML/XSL validation.");
console.error("Install via Scoop: scoop install libxml2");
process.exit(1);
console.warn("xmllint is not installed. Skipping XML/XSL validation.");
console.warn("To run this check, install via Scoop: scoop install libxml2");
return;
}
@kascit
kascit merged commit 593c54c into main Jul 21, 2026
15 checks passed
@kascit
kascit deleted the fix-site-performance branch July 21, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants