SemanticMediaWiki / Mermaid

Provides a parser function to generate diagrams and flowcharts with the help of the mermaid script language
https://www.mediawiki.org/wiki/Extension:Mermaid
Other
36 stars 24 forks source link

Update Mermaid to 10.2.1 and fix mermaid.init() call #96

Closed martinschilliger closed 4 months ago

martinschilliger commented 1 year ago

This PR addresses or contains:

This PR includes:

Overtakes https://github.com/SemanticMediaWiki/Mermaid/pull/94

gesinn-it-gea commented 1 year ago

for reference: mermaid-js RELEASE NOTES for 9.0.0 https://github.com/mermaid-js/mermaid/releases/tag/9.0.0

antibarbie commented 1 year ago

Hello, I tested your branch against mediawiki 1.35 ; and ... with 10.2.1 (also with others 10.x) firefox chokes on "SyntaxError: function statement requires a name" ; couldn't spot the exact problem on minified javascript, but the 10.x.x versions all seems to have the same symptoms. (and btw Chrome also shows the same error).

When editing your package.json to go back to mermaid 9.4.3 it runs fine.

Is there a requirement somewhere on yarn version (1.22.5) or other system tool maybe ?

sneakers-the-rat commented 10 months ago

@antibarbie the problem you're getting is probably from how the mediawiki resourceloader minifies everything, including already-minified vendored packages like this one. There is an install script that adds a /*@nomin*/ tag to the top of the file when you install it via composer, but that wouldn't get triggered if you just cloned it from git. added it manually in https://github.com/SemanticMediaWiki/Mermaid/pull/102 , which works from a clone.

martinschilliger commented 4 months ago

TBH right now I don't understand, if I could or should do anything else. Is there something needed from my side?

martinschilliger commented 4 months ago

Ah, already surpassed: https://github.com/SemanticMediaWiki/Mermaid/pull/102 Closing this one.