Upgrade beautiful-mermaid from @theletterf fork to lukilabs v1.0.1#2771
Open
theletterf wants to merge 1 commit intomainfrom
Open
Upgrade beautiful-mermaid from @theletterf fork to lukilabs v1.0.1#2771theletterf wants to merge 1 commit intomainfrom
theletterf wants to merge 1 commit intomainfrom
Conversation
Replaces the scoped fork `@theletterf/beautiful-mermaid@0.1.5` with the upstream `beautiful-mermaid@1.0.1` published by lukilabs/Craft Docs. Key changes: - Switch package name and update to v1.0.1 - Replace `copy:mermaid` (cp of pre-built bundle) with `build:mermaid` using esbuild, since v1.0.0+ ships TypeScript source only (no dist/) - Add esbuild@0.27.3 as a dev dependency for the bundle step - Update `window.__mermaid` call from deprecated `renderMermaid` to `renderMermaidSVGAsync`, and extend the type declaration with the new layout options (nodeSpacing, layerSpacing, componentSpacing, thoroughness) Notable size change: the bundle grows from ~134 KB to ~1.5 MB because v1.0.0 replaced dagre with elkjs (elk.bundled.js, ~1.6 MB uncompressed). The file is lazy-loaded and only downloaded by users viewing pages with Mermaid diagrams. Co-authored-by: Claude <claude@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.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
@theletterf/beautiful-mermaid@0.1.5with the upstreambeautiful-mermaid@1.0.1published by lukilabs (Craft Docs).dist/folder), thecopy:mermaidstep is replaced by abuild:mermaidstep using esbuild, which bundlessrc/browser.tsinto an IIFE browser global.esbuild@0.27.3as a dev dependency.window.__mermaidcall from the deprecatedrenderMermaidalias torenderMermaidSVGAsync, and extends the type declaration with the new layout options (nodeSpacing,layerSpacing,componentSpacing,thoroughness,padding).The embedded
mermaid.min.jsgrows from ~134 KB → ~1.5 MB (uncompressed, embedded asEmbeddedResourcein the binary). The increase is entirely due to v1.0.0 replacingdagrewithelkjs(elk.bundled.js, ~1.6 MB). This is a deliberate upstream trade-off for better layout quality and synchronous rendering.The file is lazy-loaded — only fetched by users who visit pages that contain Mermaid diagrams.
Test plan
npm run build:mermaidinsrc/Elastic.Documentation.Site/and confirm_static/mermaid.min.jsis produced.dotnet buildto confirm the asset embeds cleanly.Made with Cursor