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

Issues with migrating to Mermaid version 10 #5217

Closed
4 tasks done
ScratchCat458 opened this issue Mar 19, 2023 · 1 comment
Closed
4 tasks done

Issues with migrating to Mermaid version 10 #5217

ScratchCat458 opened this issue Mar 19, 2023 · 1 comment
Labels
change request Issue requests a new feature or improvement

Comments

@ScratchCat458
Copy link

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 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:

plugins:
  - mermaid:
    - version: 10.0.2

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

@squidfunk
Copy link
Owner

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.

@squidfunk squidfunk closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2023
@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants