efurlanm / mermaid-tw5

TiddlyWiki 5 plugin to support the Mermaid library
https://efurlanm.github.io/mermaid-tw5
MIT License
19 stars 2 forks source link

Upgrade to V10 #4

Open SonephetR2 opened 1 year ago

SonephetR2 commented 1 year ago

Chanced upon this bit on Hacker News today : V10 was just released and is now "70% smaller (<100 kB gzipped), with lazy loaded diagrams, fully async rendering and parsing, cleaner internals" (quoting the maintainer here). I thought I'd drop you a line. Thanks for the very useful plugin :)

buschhardt commented 1 year ago

That would be very nice, because Mermaid added "Timeline". Thanks also from me

Drevarr commented 1 year ago

If upgrading to v10 gets "Timeline" added that would be wonderful.

efurlanm commented 1 year ago

Thanks for the comments. The new version 10 of Mermaid has a significant change (ESM), and the min.js file is no longer available. As a consequence the existing code no longer works with the new version, and needs to be re-written. Since I didn't make the plugin, I have no idea how to do this. It's a shame, but apparently it's the end of the line for Mermaid-TW5 in this repo. Maybe someone with more experience can change it in the future. For now we can consider this repo as dead.

Some references:

Drevarr commented 1 year ago

Will https://github.com/mermaid-js/mermaid/pull/4281 solve the issue?

efurlanm commented 1 year ago

Thanks for the comment. Yes, #4281 will likely resolve the issue. As a curiosity, version 10.0.3-alpha.1 (https://cdn.jsdelivr.net/npm/mermaid@10.0.3-alpha.1/dist/mermaid.min.js) was the last one containing min.js .

efurlanm commented 1 year ago

Good news. There is now the 10.2.0-rc.2 UMD package. I tested it on TW 5.2.7 and unfortunately it didn't work, nor did 10.0.3-alpha.1. The last one that works is 9.4.3.

Another point that was not mentioned before is that until 9.3.0 the size of mermaid.min.js is 0.9 MB, and from 9.4.0 to 10.2 the size jumped to 2.7 MB (3 times increase) . The size of empty vanilla TW 5.2.7 (empty.html) is 2.3 MB, ie mermaid.min.js is bigger than TW itself, making it a huge orverhead. For the newer versions of mermaid I have my doubts whether another workflow wouldn't be better, such as not using the plugin and keeping only the mermaid source code in TW, using https://mermaid.live to generate the figures and save them, for example in svg, and then use svg in TW.

Drevarr commented 1 year ago

That is a massive size increase, I think you are correct if the size stays it is time to look for an alternative.

Kochise commented 1 year ago

mermaid 10 is incompatible : https://github.com/fralau/mkdocs-mermaid2-plugin/issues/70?ts=4#issuecomment-1597130997 ("you can use the .min.js file from jsdelivr")

-> https://cdn.jsdelivr.net/npm/mermaid@10.4.0/dist/mermaid.min.js

C4 diagrams, mindmap, ...

Kochise commented 1 year ago

v11.0.0 Breaking changes | WIP : https://github.com/orgs/mermaid-js/discussions/4710

Kochise commented 1 year ago

https://github.com/orgs/mermaid-js/discussions/4314?ts=4#discussioncomment-6946102

Kochise commented 1 year ago

https://cdn.jsdelivr.net/npm/mermaid@10.6.0/dist/mermaid.min.js

Kochise commented 9 months ago

https://cdn.jsdelivr.net/npm/mermaid@10.7.0/dist/mermaid.min.js

Kochise commented 9 months ago

@efurlanm I'm using Bob for advanced Tiddly so the size is not a problem anymore. I provided you with the links to the latest Min.js, could you try to make them work ?

Kochise commented 9 months ago

https://cdn.jsdelivr.net/npm/mermaid@10.8.0/dist/mermaid.min.js

Kochise commented 8 months ago

https://cdn.jsdelivr.net/npm/mermaid@10.9.0/dist/mermaid.min.js

efurlanm commented 7 months ago

Unfortunately I haven't been able to get the new versions to work yet. It will probably be necessary to change the code and I don't have the necessary skills.

Kochise commented 7 months ago

Seems like there is a bug in the 10.9.0 :

https://github.com/mermaid-js/mermaid/issues/5383 https://github.com/mermaid-js/mermaid/issues/5362

Try with the 10.8.0 version.

I don't care about the "overhead", I'm using Bob anyway :

https://github.com/OokTech/TW5-BobEXE/releases/1.7.6

Regards.

Kochise commented 5 months ago

https://cdn.jsdelivr.net/npm/mermaid@10.9.1/dist/mermaid.min.js