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

Add the latest mermaid.min.js file #90

Merged
merged 1 commit into from
May 29, 2023
Merged

Add the latest mermaid.min.js file #90

merged 1 commit into from
May 29, 2023

Conversation

jessebraham
Copy link
Member

At some point our graphs stopped rendering, and updating the JS library seems to fix this. At least locally, the graph was not rendering when running mdbook serve, and once updating this JS library it began rendering again.

@SergioGasquez could you please verify this resolves the issue for you, too?

Maybe we should pin the version of mdbook-mermaid in CI to avoid this? It doesn't seem to release often, but I reckon we'll need to do this update with each release. Outside the scope of this PR, but something to consider I guess.

@jessebraham jessebraham requested a review from SergioGasquez May 28, 2023 14:29
@SergioGasquez
Copy link
Member

SergioGasquez commented May 29, 2023

At some point our graphs stopped rendering, and updating the JS library seems to fix this. At least locally, the graph was not rendering when running mdbook serve, and once updating this JS library it began rendering again.

I assume you are using latest mdbook-mermaid? For me, the graphs are properly rendered locally both in esp-rs:main and in jessebraham:fixes/mermaid-js

Maybe we should pin the version of mdbook-mermaid in CI to avoid this? It doesn't seem to release often, but I reckon we'll need to do this update with each release. Outside the scope of this PR, but something to consider I guess.

Not sure if I understand why pinning the version would help, I guess it avoid inconsistencies between the generated JS library and the mdbook-mermaid version?

I still think we can merge this PR if it solves it for you, for me, it works the same way (I'm using mdbook 0.4.30 and mdbook-mermaid 0.12.6)

@jessebraham
Copy link
Member Author

jessebraham commented May 29, 2023

I assume you are using latest mdbook-mermaid? For me, the graphs are properly rendered locally both in esp-rs:main and in jessebraham:fixes/mermaid-js

Yes I am, but they're not rendering correctly in esp-rs:main; in the deployed book you can see the markup:
https://esp-rs.github.io/book/overview/using-the-standard-library.html

I've viewed this page on different computers using different browsers and the problem persists, so it's at least not a browser caching or compatibility issue on my end.

Not sure if I understand why pinning the version would help, I guess it avoid inconsistencies between the generated JS library and the mdbook-mermaid version?

I'm not entirely sure how the pre-processor works, but you need to run mdbook-mermaid install . to "generate" the JS files; I'm assuming that any changes in the JS will require changes in the pre-processor as well, which I'm guessing is the reason things don't seem to be working here. Since we always install the latest version of mdbook-mermaid in CI this would at least ensure that the JS and pre-processor are in sync.

As I said though, mdbook-mermaid doesn't publish a ton of releases so might not be much of an issue in reality.

I still think we can merge this PR if it solves it for you, for me, it works the same way (I'm using mdbook 0.4.30 and mdbook-mermaid 0.12.6)

I'm confused why it's apparently working on your end, but there's no harm in updating to the latest version of the JS lib at the very least.

@jessebraham
Copy link
Member Author

Okay I've now ran mdbook serve on this computer and the graph is rendering without this PR. No idea what's going on here, but it's annoying 😁

Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just did the test again and got the same results. Using mdbook-mermaid install generates the changes in the library that you pushed but works fine for me with the new and the old JS lib. But, as you mentioned, it's not working fine in the deployment, so let's push this and see if it solves it!

Regarding pining the mdbook version, it might be a good idea, just subscribed to mdbook releases in case they publish any new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants