johanneswuerbach / backstage-plugin-techdocs-addon-mermaid

Backstage TechDocs Mermaid Addon
MIT License
43 stars 18 forks source link

mermaid does not render on navigation, only with the page reload #5

Closed PavelPolyakov closed 2 years ago

PavelPolyakov commented 2 years ago

hi @johanneswuerbach ,

First of all thanks for the plugin it's great to have Mermaid in the docs.

I've spot an issue, that diagrams are only rendered with the complete page reload. In case you have "complex" or nested documentation, then there is no render, unless you refresh the page.

here is the demo: https://user-images.githubusercontent.com/839290/171832064-7598a602-d4b6-4d74-b5fc-62f754a43400.mp4

I wonder if something might be done with it? Or it's a limitation of the tech docs.

Regards,

PavelPolyakov commented 2 years ago

hi @johanneswuerbach, sorry for a ping, just want to ask for the assessment. Do you consider this as a bug? Do you have thoughts if this might be fixed or backstage addons integration is missing functionality to handle such behaviour currently.

Regards,

johanneswuerbach commented 2 years ago

Hey, sorry I totally forgot about this. Yes, this looks definitely like a bug, I'll take a look later today.

johanneswuerbach commented 2 years ago

I tested using the following configuration https://github.com/backstage/backstage/compare/master...johanneswuerbach:techdocs-mermaid and can't reproduce the issue.

Navigating to http://localhost:3000/docs/default/component/documented-component/#mermaid and clicking on page-2 works 🤔 . Which Browser are you using?

PavelPolyakov commented 2 years ago

@johanneswuerbach hm, thanks, it must be my side then. I will double check and report. I use Chrome.

PavelPolyakov commented 2 years ago

Hi @johanneswuerbach,

I've tested it locally and it has worked indeed. I started to compare what I have different online and trailed it to the techdocs.generator.runIn setting. When I set it to local (as I have it online), then it works as on the video.

Here is a reproduction repository: https://github.com/PP-etc/backstage-vs-mermaid

Created a backstage bug: https://github.com/backstage/backstage/issues/11949

PavelPolyakov commented 2 years ago

ok, that was fixed with pip install mkdocs-techdocs-core==1.0.2.

Thank you for your work!

johanneswuerbach commented 2 years ago

Glad that you found a solution :-)