Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: convert mermaid code blocks to SVGs client side #11690

Merged
merged 6 commits into from
Nov 4, 2024

Conversation

a-hariti
Copy link
Collaborator

@a-hariti a-hariti commented Oct 30, 2024

Converts mermaid code blocks to svg using mermaid.js using a minimal diff

this library comes with the limitation of working client side only (the same way it's handled on Github Readmes for example),

some solutions for node.js come with a whole browser environment to take a screenshot (clunky solution)

on the flip side, client side conversion causes some flickering on the pages with mermaid diagrams,

but this seems to be the most pragmatic way to do this

Note: to preview this, go to the developer docs preview under /application/architecture/

TODO:

  • port other mermaid diagrams source code to this PR

closes #11561

Copy link

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
changelog 🛑 Canceled (Inspect) Oct 31, 2024 4:34pm
develop-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 4:34pm
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 4:34pm

Copy link

codecov bot commented Oct 30, 2024

Bundle Report

Changes will increase total bundle size by 2.47MB (17.48%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
sentry-docs-server-cjs 7.38MB 529 bytes (0.01%) ⬆️
sentry-docs-edge-server-array-push 333.11kB 3 bytes (-0.0%) ⬇️
sentry-docs-client-array-push 8.91MB 2.47MB (38.42%) ⬆️⚠️

src/components/docPage/index.tsx Outdated Show resolved Hide resolved
src/components/docPage/index.tsx Outdated Show resolved Hide resolved
src/components/docPage/index.tsx Outdated Show resolved Hide resolved
src/components/mermaid.tsx Fixed Show resolved Hide resolved
a-hariti and others added 4 commits October 31, 2024 16:54
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

Thanks for adding this! @antonpirker will be happy 😄

@antonpirker
Copy link
Member

This is sooo cool @a-hariti !

@a-hariti a-hariti merged commit 947a467 into master Nov 4, 2024
13 checks passed
@a-hariti a-hariti deleted the mermaid-diagrams branch November 4, 2024 11:19
martinhaintz pushed a commit that referenced this pull request Nov 5, 2024
* master: (213 commits)
  Remove feature flag documentation from issue details page (#11734)
  docs(insights): Remove EA note from Queries re: MongoDB (#11735)
  docs(nuxt): `piniaIntegration` in Nuxt (#11684)
  feat(flags): Add OpenFeature and LaunchDarkly integration documentation (#11675)
  Cleaning up mermaid code and made it a bit more readable in dark mode (#11726)
  docs(scopes): Add graphics for scope forking (#11702)
  Unreal Engine plugin documentation update (#11625)
  Bump API schema to 25e528ff (#11728)
  Bump API schema to 12bd311c (#11725)
  fix dark theme resolution (#11718)
  Update sign in to go to sentry (#11723)
  getsentry/relay@4bdad17
  API examples syntax highlighting (#11715)
  feat: Convert mermaid code blocks to SVGs client side (#11690)
  Trace context is required for transactions (#11456)
  deps: Bump SDK to 8.36.0 (#11696)
  getsentry/relay@2e2587c
  MAUI screenshot `SetBeforeScreenshotCapture`(#11672)
  Add CSS rule to fix color of bold links (#11707)
  Fix small typo on web-vitals-concepts (#11706)
  ...
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.

Add MermaidJS plugin
3 participants