Open Yash-Singh1 opened 3 months ago
Name | Link |
---|---|
Latest commit | 9fd6a1396b0b3cd666cf053a4dd3ecf6a679779e |
Latest deploy log | https://app.netlify.com/sites/mermaid-js/deploys/65ff34f98009b80008c5b593 |
Deploy Preview | https://deploy-preview-5408--mermaid-js.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 5.72%. Comparing base (
c00bf26
) to head (9fd6a13
).
I got this working with the example repro provided by @simov on Firefox 124.
@simov Could you confirm that this works on your end too?
@Yash-Singh1 sure, can you point me to the mermaid.min.js
produced by this PR?
@Yash-Singh1 sure, can you point me to the
mermaid.min.js
produced by this PR?
Sure, here is a link to the mermaid.min.js
build: https://mermaid-upload-5408-build.pages.dev/9fd6a13/mermaid.min.js
LMK if you need anything else to get it working.
It works in Firefox.
Is this PR on top of v10.9.0? Because it works in Chrome too, meaning the other issue reported here https://github.com/mermaid-js/mermaid/issues/5383 about the character encoding seems to be resolved too.
Is this PR on top of v10.9.0?
Yes, this PR is on top of v10.9.0.
Because it works in Chrome too, meaning the other issue reported here #5383 about the character encoding seems to be resolved too.
Interesting, there must have been a commit between now and the 10.9.0 release that removed the latin characters issue then.
Nice work @Yash-Singh1! What do you think the long term fix for this would be? Should we raise the issue in lodash repo to see if they would add the polyfill directly?
Nice work @Yash-Singh1! What do you think the long term fix for this would be? Should we raise the issue in lodash repo to see if they would add the polyfill directly?
Yeah, I think that would make sense.
:bookmark_tabs: Summary
Patch
lodash-es
andcytoscape
(has lodash bundled in it) to avoid usingFunction
calls.Resolves #5378
:straight_ruler: Design Decisions
I patched
lodash-es
to use a globalThis polyfill and forcytoscape
I just usedwindow
becausecytoscape
only runs in browser afaik.This won't fix CSP violations when running Mermaid.js without the bundles (directly importing the ESM
mermaid.core.mjs
), but it would patch theFunction
calls in the bundles.:clipboard: Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.develop
branch