Replies: 11 comments 8 replies
-
I am the maintainer of sphinxcontrib-mermaid which is used in the documentation of more than a hundred libraries in the Python ecosystem. For quite some time the default has been to use the "latest" version from a CDN and few people change it because it simply worked. Now that URL generates a 404 because of this change the "mermaid.min.js" doesn't exist. Thus it has broken the documentation of a lot of projects, even though they didn't change anything nor deployed a new version of the docs. I can either fix my code to avoid using version 10.0 for now or implement the new "ESM" initialization code (I'm a Python developer and have no idea what that means, my apologize). But the truth is that any changes I make to fix the documentations of the users of my software will require them to forcibly update the package version. I agree that this was a somewhat foolish decision. |
Beta Was this translation helpful? Give feedback.
-
Also the release notes state that "Mermaid is ESM only!", but I don't see any rational for it. What was gained from switching to ESM only? We know what was lost - which is hundreds of hours of development for all projects that depend on the lib, but what was gained? I know it's an open source project, and you don't owe anything to anybody but when introducing a change that makes your project unusable in many contexts, it makes sense to take a second and discuss with the community why it was done. |
Beta Was this translation helpful? Give feedback.
-
CJS has been broken for a while due to D3. We had opened #3590 4 months back. There are methods to support ESM in electron. Adding the following line into any html page will render all elements with class |
Beta Was this translation helpful? Give feedback.
-
fyi anybody tried https://tauri.app/? I made simple app but didn't use the mermaidjs. worth trying |
Beta Was this translation helpful? Give feedback.
-
I am also facing issue with ESM compatibility with Remix app. |
Beta Was this translation helpful? Give feedback.
-
There was a few sensible questions in the original issue - #3590
There was one answer only to that question, and nothing else. Then the same person asked again:
No answer to that question.
Nobody checked Something that can break many other projects should be given a bit more consideration - in this particular case the discussion lasted barely a day! Is there really no hope to go back to a CJS version until the drawbacks are better understood? |
Beta Was this translation helpful? Give feedback.
-
@sidharthv96 can you consider at least releasing one giant non ESM bundle for those of us who cannot use ESM at the moment? Here is another example: In the new Manifest v3 for Browser Extensions in order to circumvent CSP issues (Content Security Policy) on pages with strict CSP rules, you have to use Content Scripts. However, those are not regular
|
Beta Was this translation helpful? Give feedback.
-
Can you test if mermaid@10.0.3-alpha.1 solves your problems? Another option is to split the package into two. But that's more maintenance burden on us during releases. |
Beta Was this translation helpful? Give feedback.
-
@sidharthv96 I can confirm that the |
Beta Was this translation helpful? Give feedback.
-
I can confirm that the dist/marmaid.min.js file found in v10.0.3-alpha.1 works in the exact same way as it did with v9.4.x, many thanks Usage: Rust crate "aquamarine" https://github.com/mersinvald/aquamarine is embedding the mermaid.min.js into the rustdoc bundle, this way no external dependencies exist when browsing this API doc |
Beta Was this translation helpful? Give feedback.
-
We are planning to switch the bundler to esbuild, which doesn't support UMD. There would be an IIFE file, which will ensure Please comment on this thread in case that would break your projects. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I am wondering who came up with the "ESM only" idea and more importantly - why?
Electron doesn't support ESM, which means you just killed Mermaid on every Electron app. I am more than aware that new technology can have a positive effect, but "forcing" it onto people with the awareness that it will break many projects is somehow a weird move.
By "forcing" I mean just making it ESM only without a deprecation phase, nor having a backwards compatible version on the same level in parallel.
As an example, we are using Mermaid in Joplin and the move to ESM only means that we have to stick with Mermaid 9.x until 1) Electron supports it and 2) our code base is also able to support ESM properly.
Beta Was this translation helpful? Give feedback.
All reactions