Pre loader

Crypto package increases bundle size

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
1
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

I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)

However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

  • 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
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies