Skip to content

fix(mermaid): make mermaid render client-side#121

Merged
toumorokoshi merged 2 commits intoaep-dev:mainfrom
toumorokoshi:yft/mermaid-client-side
Mar 1, 2026
Merged

fix(mermaid): make mermaid render client-side#121
toumorokoshi merged 2 commits intoaep-dev:mainfrom
toumorokoshi:yft/mermaid-client-side

Conversation

@toumorokoshi
Copy link
Copy Markdown
Member

playwright is a pretty heavy build-time dependency, increasing the complexity of rendering and development.

This dependency only exists for mermaid's server-side rendering. Replacing it with a light client-side rendering approach instead.

Although this means that the diagrams will no longer be SVGs and some javascript will be required, this also enables improvements like having the mermaid diagram honor the light/dark settings. So arguing that it is worth the tradeoffs.

playwright is a pretty heavy build-time dependency, increasing the
complexity of rendering and development.

This dependency only exists for mermaid's server-side rendering.
Replacing it with a light client-side rendering approach instead.

Although this means that the diagrams will no longer be SVGs and
some javascript will be required, this also enables improvements
like having the mermaid diagram honor the light/dark settings. So
arguing that it is worth the tradeoffs.
Copy link
Copy Markdown
Member

@rambleraptor rambleraptor left a comment

Choose a reason for hiding this comment

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

Ideally, we'd be able to create a Mermaid component that bakes in the logic being placed into Head.

That being said, I think this will be fine as is.

@toumorokoshi
Copy link
Copy Markdown
Member Author

Ideally, we'd be able to create a Mermaid component that bakes in the logic being placed into Head.

That being said, I think this will be fine as is.

Yeah I thought about that. Maybe I can see if we can inject it somehow via the plugin at least?

@toumorokoshi toumorokoshi merged commit 193979b into aep-dev:main Mar 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants