Update Mermaid to 11.16.1

What does this MR do and why?

Updates the bundled Mermaid (mermaid-v11 alias) from 11.13.0 to 11.16.1, which adds the treeView-beta diagram (file and directory trees, Mermaid 11.14.0+) to Markdown rendering.

Closes #612879 (closed)

Notes for the reviewer

  • The bump made yarn.lock resolve two DOMPurify versions (3.4.12 at the root, 3.4.13 nested under mermaid-v11). app/assets/javascripts/lib/mermaid_sandbox.js registers its DOMPurify hooks (image proxy enforcement) on the instance it imports, and scripts/lint/check_mermaid.mjs patches that same instance, so a second copy would bypass both (the docs Mermaid lint failed on every diagram with DOMPurify.addHook is not a function before deduplication). dayjs, dompurify, es-toolkit and katex, the four duplicates introduced by the bump (none before), were deduplicated with yarn-deduplicate; a single DOMPurify 3.4.13 remains.
  • doc/user/markdown.md: "GitLab.com supports Mermaid version 10" was stale since the Mermaid 11 upgrade in 19.0; documented the treeView-beta diagram. The example is parsed by docs-lint mermaid, which exercises the new version in CI.
  • Mermaid 11.16 replaced lodash-es with es-toolkit/compat, which ships untranspiled ES2020 that webpack 4 cannot parse (compile-test-assets failed on node_modules/es-toolkit/dist/compat/**). es-toolkit is added to the existing babel-loader rule that transpiles Mermaid and its transitive dependencies (second commit). Rspack is not affected.
  • Verified locally: scripts/lint/check_mermaid.mjs on all docs (0 errors), spec/frontend/lib/mermaid_integration_spec.js + spec/frontend/behaviors/markdown/render_sandboxed_mermaid_spec.js, and a full production yarn webpack build (0 errors, sandboxed_mermaid_v11 chunk emitted).

How to set up and validate locally

  1. yarn install
  2. scripts/lint/check_mermaid.mjs doc/user/markdown.md (parses the new treeView-beta example)
  3. Render a Markdown block starting with treeView-beta in an issue description.

MR acceptance checklist

  • Changelog trailer (Changelog: changed)
  • Documentation updated
Edited by Jordan Labrosse

Merge request reports

Loading
Loading