Repository navigation
Load diagram fallbacks only without JavaScript - #196
Merged
Merged
Conversation
Every diagram's static fallback was an <image> inside its svg, so every visitor downloaded all six (about 165 KB) although the scripts draw over them straight away. Each fallback is now an <img> in a <noscript> next to its svg, laid over the svg's box by CSS, for the hero and all 2D diagrams. Browsers running the scripts never fetch them; without JavaScript they show as before. Homepage download with JavaScript, measured locally: 937 KB to 772 KB uncompressed, about 541 KB to 498 KB with text compressed. - The scripts no longer remove a fallback, and the exporter no longer strips one from its copy. - Tests: with JavaScript, the hero and the 2D diagrams never request their fallbacks; without it, each fallback is visible, loads, and sits over its svg's box. The still-diagram test's HTML rewrite allows for the noscript before the pause button. - The regenerated fallbacks lose a blank line, and apis.svg picks up the reworded alpha sentence from #195, which was merged without it. - The skill explains why the fallback stays in its noscript. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Marc Duiker <4191277+marcduiker@users.noreply.github.com>
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.
Summary
Follow-up to #195. The fix below was pushed to #195's branch after that PR had been merged, so it never reached
master.Every homepage diagram's static fallback was an
<image>inside its svg. Every visitor downloaded all six fallbacks, about 165 KB, even though the scripts draw over them straight away.What changes
<img>in a<noscript>next to its svg, laid over the svg's box by CSS. This covers the hero and all five 2D diagrams.hero-diagram.jsanddiagrams.jsno longer remove a fallback, and the fallback exporter no longer strips one.apis.svgpicks up the reworded alpha sentence from Redraw the homepage value-prop videos as D3 diagrams #195, which was merged without regenerating it<noscript>.Homepage download, measured locally in Chrome
Tests
<noscript>before the pause button.Test plan
🤖 Generated with Claude Code