Loading
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.lockresolve two DOMPurify versions (3.4.12 at the root, 3.4.13 nested undermermaid-v11).app/assets/javascripts/lib/mermaid_sandbox.jsregisters its DOMPurify hooks (image proxy enforcement) on the instance it imports, andscripts/lint/check_mermaid.mjspatches that same instance, so a second copy would bypass both (the docs Mermaid lint failed on every diagram withDOMPurify.addHook is not a functionbefore deduplication).dayjs,dompurify,es-toolkitandkatex, the four duplicates introduced by the bump (none before), were deduplicated withyarn-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 thetreeView-betadiagram. The example is parsed bydocs-lint mermaid, which exercises the new version in CI.- Mermaid 11.16 replaced
lodash-eswithes-toolkit/compat, which ships untranspiled ES2020 that webpack 4 cannot parse (compile-test-assetsfailed onnode_modules/es-toolkit/dist/compat/**).es-toolkitis 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.mjson all docs (0 errors),spec/frontend/lib/mermaid_integration_spec.js+spec/frontend/behaviors/markdown/render_sandboxed_mermaid_spec.js, and a full productionyarn webpackbuild (0 errors,sandboxed_mermaid_v11chunk emitted).
How to set up and validate locally
yarn installscripts/lint/check_mermaid.mjs doc/user/markdown.md(parses the newtreeView-betaexample)- Render a Markdown block starting with
treeView-betain an issue description.
MR acceptance checklist
- Changelog trailer (
Changelog: changed) - Documentation updated
Edited by Jordan Labrosse