You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently Mermaid JS made a major change to their build setup in which they only build for ES modules (see this issue). I have been trying to change my Mermaid version to 10 by using the extra_javascripts section of the config, but to no avail.
When I add a version with a regular mermaid.min.js from unpkg, the version used internally (9.3.0) is swapped out for the version I specify. This is the intended behaviour described in #3171. However, if this is done with a mermaid.esm.min.mjs such as in the currently stable version (10.0.2), nothing gets pulled in.
The version 10.0.3-alpha.1 does provide a .min.js, but when imported, it only renders my Mermaid code as if it were plain text using Pygments.
Description
I have to admit that I'm not all that familiar with the internal of this projects so I'm not able to comment on the difficultly of implementing any of these ideas.
Idea 1:
Replacing the use of the standard JS imports with the newer ES module build
The main issue that comes with this is handling backwards compatibility between old versions of Mermaid that don't use ESM when working with internal usage.
Idea 2:
Modifying the replacement functionality of extra_javascripts
This would allow users to opt into using these more recent versions without breaking old configs.
Idea 3:
Providing Mermaid version control as a separate configuration option
Would require much internal effort for handling both types of module but would act a long-term solution for changing Mermaid's settings.
Example config:
I am a big fan of using diagrams with in my work for documenting systems and ideas. For me having this integrated into the method I use to write documentation for my projects is incredibly valuable. Though Material for MkDocs does not have direct endorsement for use of diagrams such as Gitgraph and mindmap, I feel that option to have these available in this tool would be beneficial to many including myself, and bumping the version up to 10 is a requirement to make that happen.
Thank you for considering this, it means a lot to me. :)
Thanks for suggesting. Please see #5193 (comment). It's currently not possible for us to migrate to Mermaid 10. We currently can't make the switch as we would lose support for older browsers. We might investigate a combined approach in the future (detecting browser support), but integration is fundamentally different and will likely be very challenging.
If somebody wants to investigate, happy to discuss a possible integration in a PR.
Context
Recently Mermaid JS made a major change to their build setup in which they only build for ES modules (see this issue). I have been trying to change my Mermaid version to 10 by using the
extra_javascripts
section of the config, but to no avail.When I add a version with a regular
mermaid.min.js
from unpkg, the version used internally (9.3.0) is swapped out for the version I specify. This is the intended behaviour described in #3171. However, if this is done with amermaid.esm.min.mjs
such as in the currently stable version (10.0.2), nothing gets pulled in.The version 10.0.3-alpha.1 does provide a
.min.js
, but when imported, it only renders my Mermaid code as if it were plain text using Pygments.Description
I have to admit that I'm not all that familiar with the internal of this projects so I'm not able to comment on the difficultly of implementing any of these ideas.
Idea 1:
Replacing the use of the standard JS imports with the newer ES module build
The main issue that comes with this is handling backwards compatibility between old versions of Mermaid that don't use ESM when working with internal usage.
Idea 2:
Modifying the replacement functionality of
extra_javascripts
This would allow users to opt into using these more recent versions without breaking old configs.
Idea 3:
Providing Mermaid version control as a separate configuration option
Would require much internal effort for handling both types of module but would act a long-term solution for changing Mermaid's settings.
Example config:
Related links
Use Cases
I am a big fan of using diagrams with in my work for documenting systems and ideas. For me having this integrated into the method I use to write documentation for my projects is incredibly valuable. Though Material for MkDocs does not have direct endorsement for use of diagrams such as Gitgraph and mindmap, I feel that option to have these available in this tool would be beneficial to many including myself, and bumping the version up to 10 is a requirement to make that happen.
Thank you for considering this, it means a lot to me. :)
Visuals
No response
Before submitting
The text was updated successfully, but these errors were encountered: