Skip to content

feat(mermaid): upgrade to v12.2.0 and use redux-color themes - #368

Merged
youyongsong merged 2 commits into
mainfrom
feat/mermaid-v12
Oct 30, 2026
Merged

youyongsong merged 2 commits into
mainfrom
feat/mermaid-v12

Conversation

@timonwong

Copy link
Copy Markdown
Contributor

Mermaid 12 changes what unconfigured diagrams look like. Doom was still forcing the old palettes, so an upgrade by itself would not have shown the new defaults.

Why

mermaid.initialize() always set theme: default in light mode and theme: dark in dark mode. Mermaid 12's light default is redux-color, with the neo look and ELK layout for flowchart, class, state, ER, sequence and a few others. Dark mode does not pick redux-dark-color from theme: dark; that palette has to be named.

Leaving those two values in place would have kept every diagram on the v11 appearance after the dependency bump.

What changed

  • mermaid ^11.15.0 → ^12.2.0
  • Light mode initializes redux-color; dark mode initializes redux-dark-color
  • look: neo and ELK are not set in Doom; they come from Mermaid 12's per-diagram defaults
  • Diagrams that already set theme, look, or layout in front matter are unchanged; anything that does not will look different

Mermaid 12 makes redux-color and the neo look the default for many
diagram types, and lays those types out with ELK. Doom forced
theme: default in light mode and theme: dark in dark mode, which
would have kept the old palette after the upgrade.

Light mode now names redux-color; dark mode names redux-dark-color,
because Mermaid does not pick that palette from dark on its own.
Diagrams that do not set theme, look, or layout in front matter
will look different.
@changeset-bot

changeset-bot Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1a35cc7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/doom Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@368.tgz
yarn add https://pkg.pr.new/@alauda/doom-export@368.tgz

commit: 1a35cc7

A file next to the components is imported as a global MDX identifier.
`mermaid-theme.ts` became `import Mermaid-theme`, which is not valid JS,
and every docs page failed to build.
@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.94%. Comparing base (feecfff) to head (1a35cc7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #368   +/-   ##
=======================================
  Coverage   66.94%   66.94%           
=======================================
  Files         100      100           
  Lines        3903     3903           
  Branches     1152     1155    +3     
=======================================
  Hits         2613     2613           
  Misses       1026     1026           
  Partials      264      264           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timonwong

Copy link
Copy Markdown
Contributor Author

Same diagram source. Left is the old Doom initialize config; right is this PR.

Light: theme: default + look: classic + layout: dagre → theme: redux-color (v12 neo / ELK)

Light before vs after

Dark: theme: dark + look: classic + layout: dagre → theme: redux-dark-color (v12 neo / ELK)

Dark before vs after

@timonwong

Copy link
Copy Markdown
Contributor Author

Same always-set-cookie flowchart. Left is the old Doom initialize config; right is this PR.

Light: theme: default + look: classic + layout: dagre → theme: redux-color (v12 neo / ELK)

Light before vs after

Dark: theme: dark + look: classic + layout: dagre → theme: redux-dark-color (v12 neo / ELK)

Dark before vs after

@youyongsong
youyongsong merged commit cf746f4 into main Oct 30, 2026
16 checks passed
@youyongsong
youyongsong deleted the feat/mermaid-v12 branch October 30, 2026 06:20
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