perf(site): optimize website performance to A grade#66
Merged
Conversation
There was a problem hiding this comment.
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.cssinclude 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 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; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.