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.
- Henrique Rodrigues asked 4 years ago
- last edited 3 years ago
-
Slight mistake on that screenshot – I included React production minified section unintentionally, sorry!
-
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
-
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!
-
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 login to post comments
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?
- Michael Klishevich answered 4 years ago
-
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!
-
Gladly Joe, and thanks for reporting it!
- You must login to post comments
Please login first to submit.