SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

Answered
0
0

Working with SciChart/React/Webpack/Babel.

The Webpack Bundle Analyser shows that SciChart accounts for a massive chunk of the bundle’s size.

It is even more pronounced with the default settings, because SciChart uses the crypto package, which is widely known to introduce significant bloat and duplication, shown in the screenshot. Using Webpack to specify the following removes this bloat, and seems to still work, but it would be good to know the implications of including this config:

node: {
fs: "empty",
crypto: false,
}

Screenshots attached, showing the bundle analysis with and without this additional config.

Version
1.0.1334
Images
  • Henrique Rodrigues
    Slight mistake on that screenshot – I included React production minified section unintentionally, sorry!
  • Andrew Burnett-Thompson
    Hey Joe, thanks for reporting this. Quite a few of the team are off for Christmas / New Year vacations but I’ve logged this for investigation. I think the Crypto package is used for licensing code, it’s possible it can be removed or replaced with another algorithm. Let me get back to you. Also, for reducing application load time, enable GZip compression on the wasm and caching. We’ve done both in our examples app here https://github.com/ABTSoftware/SciChart.JS.Examples/search?q=compression
  • Andrew Burnett-Thompson
    Update: we’ve investigated can reproduce this. Removing crypto.js reduces the bundle size by about 600kb. We’ll see what we can do here. Thank you for reporting it!
  • Henrique Rodrigues
    Great, glad you could reproduce! I’ll keep the above config for now and will look forward to an update. GZipping and caching in place, it helps but it’s still quite large, especially the WASM, which I’ve now got pre-fetching when the user first lands on our site, meaning that it’s typically loaded into the cache by the time the user needs to see any charts. Thanks for looking into this :-)
  • You must to post comments
Best Answer
2
0

Hi Joe, we removed crypto from the bundle and you do not need crypto: false webpack setting any more.
Please check out version 1.1.1368 containing the fix and let us know 🙂

  • Henrique Rodrigues
    Hi Michael, thanks for looking into this. I’ve updated to this new version and it’s certainly a night-and-day difference from before, and removes an additional 40kB from my un-zipped bundle size compared to using crypto: false, thank you for the efforts put into this!
  • Andrew Burnett-Thompson
    Gladly Joe, and thanks for reporting it!
  • You must to post comments
0
0

Hey, I need your help. I would like to use the best PowerPoint templates for my presentation from here https://masterbundles.com/creative-powerpoint-ideas/ on my WordPress website. Maybe you know which one will be the best?

Thank you so much!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.