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

32MB in [email protected]/dist/ with duplicate files? #4203

Closed
frehberg opened this issue Mar 9, 2023 · 5 comments · Fixed by #4733
Closed

32MB in [email protected]/dist/ with duplicate files? #4203

frehberg opened this issue Mar 9, 2023 · 5 comments · Fixed by #4733
Labels
Close after 30 days Close issue if no response after 30 days Contributor needed P1 Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect

Comments

@frehberg
Copy link

frehberg commented Mar 9, 2023

Description

When I port Rust-aquamarine from mermaid 9.2 to to mermaid 10.0.2 (mersinvald/aquamarine#35), it seems the JS footprint has grown from 900KB to 32MB. I hope this can be reduced to smaller bytesize, picking the essential files from folder https://unpkg.com/browse/[email protected]/dist/

As stated by release notes, the mermaid package mermaid.min.js has been split into multiple packages, just I hope not all 262 files in folder https://unpkg.com/browse/[email protected]/dist/ are required.

All in all this folder contains 32MB, in contrast to ca 900KB of former mermaid.min.js

As the JS files shall be shipped with the Rust-Library "aquamarine" the size of 32MB is a bit too large.

Please tell me, If the following import statement would be used, which further files does it depend on? What is the JS file-set to be shipped as bundle? Is there a npm-run command to filter out these files as a bundle using an automated process?

      import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';

Steps to reproduce

Check the content of ttps://unpkg.com/browse/[email protected]/dist/
For me it not clear which files are required if importing https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs

Screenshots

No response

Code Sample

No response

Setup

Additional Context

No response

@frehberg frehberg added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Mar 9, 2023
@jgreywolf jgreywolf added Contributor needed Status: Approved Is ready to be worked on P1 and removed Status: Triage Needs to be verified, categorized, etc labels Mar 16, 2023
@ochowei
Copy link

ochowei commented Mar 21, 2023

Hi,

according to the snippet

await build(getBuildConfig({ minify: false, entryName }));

I noticed that in the build process, mermaid build 3 different configs. so the folder size growth to 32MB. This could cause some issues with storage and deployment.

Maybe we can put the result in different subfolder or different prefix in the dist folder?

@sidharthv96
Copy link
Member

The majority of the size is .map files.

@aloisklink aloisklink mentioned this issue Apr 6, 2023
4 tasks
@sidharthv96 sidharthv96 linked a pull request Aug 14, 2023 that will close this issue
@sidharthv96
Copy link
Member

@ochowei it's done with https://cdn.jsdelivr.net/npm/[email protected]/dist/

@frehberg you'll be able to ship mermaid.tiny.min.js which is only 1.07MB, compared to 3.3MB of mermaid.min.js

And all the required chunks of mermaid.esm.min.mjs is now safely inside chunks/mermaid.esm.min/

@jgreywolf
Copy link
Contributor

Is this still an open issue?

@jgreywolf jgreywolf added the Close after 30 days Close issue if no response after 30 days label Nov 16, 2023
@jgreywolf
Copy link
Contributor

Closing due to no response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close after 30 days Close issue if no response after 30 days Contributor needed P1 Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants