[AAASM-4320] 🔧 (docs): Self-host mermaid.min.js, remove unpkg CDN dependency#226
Merged
Merged
Conversation
…endency) The docs previously loaded mermaid at runtime from https://unpkg.com/mermaid@11/dist/mermaid.min.js (auto-injected by mkdocs-material when the pymdownx-superfences `mermaid` custom fence is detected). That CDN began failing with an "Invalid script" error on every page load (correlated with intermittent SSL failures to unpkg), rendering no mermaid diagrams and spamming the console. Vendor a pinned copy of mermaid@11 into the repo so the docs never depend on a third-party CDN at read time. This commit only adds the file; the follow-up commit rewires mkdocs to load it instead of unpkg. Source: https://unpkg.com/mermaid@11/dist/mermaid.min.js SHA-384: 4ffd25314749a5dd92d591ed462a1f1b786d537c4f0ab1557804355141364c9c25109495e4d5309f7d243f6f27db7f04 Refs AAASM-4320.
mkdocs-material auto-injects a mermaid runtime from https://unpkg.com/mermaid@11/dist/mermaid.min.js the moment it sees the pymdownx-superfences `mermaid` custom fence (configured immediately below, lines 149-153). That CDN was throwing "Invalid script" on every page load — no fallback, no SRI, and a third-party runtime SPOF in the docs. Adding the self-hosted copy to `extra_javascript` makes the browser load the pinned local blob *before* the theme's superfences integration wires up its custom fence, so mkdocs-material treats mermaid as already-loaded and skips the unpkg fetch. No console errors, no CDN dependency, no supply-chain exposure at read time. The vendored blob was added in the previous commit and is pinned to mermaid@11. Closes AAASM-4320.
Contributor
Author
Claude Code — 11th-sweep reviewVerdict: READY to merge
Reviewed by Claude Code as part of the AAASM-4307 fix wave. |
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.
Description
The python-sdk docs loaded mermaid from
unpkg.com/mermaid@11, which was failing withInvalid scripterrors on every page load (correlated with intermittent SSL failures to unpkg). Vendors mermaid@11 into the repo and points the theme at the local copy — removes a third-party CDN as a runtime SPOF and eliminates the console errors.Type of Change
Breaking Changes
Related Issues
Testing
mkdocs serve; Playwright shows 0 pageerror events on a page with a mermaid diagram, and no network requests tounpkg.com.Checklist
🤖 Generated with Claude Code