-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Switch to ESM only for v10? #3590
Comments
Another benefit of moving to ESM only, it will make Ideally we should only have:
|
I find this very tempting but also find it is a hard to understand the consequences for downstream projects. |
Gitlab already uses our ESM build. https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/lib/mermaid.js Are there any important projects that we could check with? |
Essentially, if a downstream project is using:
Potential issue: If websites have used Edit: Because of that, I think we should keep the |
We should fix those docs asap. I'll change it now. |
In principle we are not running in node but in the browser which is a point for esm. What I find hard about this is to figure out how this will affect the downstreams projects |
As discussed above, I can confirm this has broken packages that include Mermaid via unpkg: i.e. https://unpkg.com/mermaid/dist/mermaid.min.js JS deliver is indeed serving a cached version instead of the 404. Swapping to https://unpkg.com/mermaid@10/dist/mermaid.esm.min.mjs resolves the issue Edited by @aloisklink to add |
V10 removed this file, shipping instead only the esm version. See: mermaid-js/mermaid#3590
The current build setup is complicated (and slow).
Pros:
Cons:
require
has already been broken due to D3 dependency as @aloisklink mentioned hereRelated:
The text was updated successfully, but these errors were encountered: