SpreadJS bundle optimizations

Posted by: lpagliaro on 23 February 2021, 12:29 am EST

  • Posted 23 February 2021, 12:29 am EST

    Hello! We are using the Spread Sheets Designer for React. We wanted to know if there is a way to reduce the bundle size since it is too large and making the build process extremely slow.

    As you can see in the attachment, the Spread Sheets packages in our bundle is taking 83.4% of the whole node modules bundle, having a size of 11.85 MB (without compression). When we start the build process, the node modules gets gzipped and ends up taking 3.25 MB, which is still large, and takes approximately 7 minutes to finish.

    Is there a way this can be optimized? Maybe by importing only needed features.

    Thanks. Regards.



  • Replied 23 February 2021, 10:35 pm EST

    Hi Luis,

    This feature is already in our enhancement backlog. Further, We have asked regarding the updates on this case. We will update once we have any information regarding this issue. The internal ID for this issue will SJS-3005.

    Regards
    Avinash
  • Replied 24 February 2021, 1:39 am EST

    Thanks for your reply, looking forward to hear from the enhancements. In the meantime, is it possible to access the minified scripts needed for the designer to work via CDN? This way we can try to keep the libraries outside our application bundle and try to load them using script tags.

    Regards.
  • Replied 24 February 2021, 8:23 pm EST

    Hi Luis,

    Please refer to the following download link and some steps to use the designer with CDN links and let us know if you face any issues.

    The recommended way to use designer with CDN links


    • make sure all the spread package is added before the Designer link

    • Add the Designer component using the Designer constructor



    Further, you may also refer to the attached sample that demonstrates the same.

    SpreadJS v14.0.7: [url]http://cdn.grapecity.com/spreadjs/14.0.7/Files/SpreadJS.Release.14.0.7.zip[/url]

    Regards
    Avinash

    reactSample.zip
  • Marked as Answer

    Replied 25 February 2021, 2:15 am EST

    Thank you very much. I was able to use that and have the app working. Do you have an example on how to do the same but for the gc.spread.sheets.react library? I tried this:

    https://www.grapecity.com/spreadjs/docs/v14/online/UsingSpread.SheetswithReact.html#b

    but doesn't seem to work on my end.

    Regards.
  • Replied 25 February 2021, 11:54 pm EST

    Hi Luis,

    This issue needs further investigation hence we have escalated his issue to the concerned team for further investigation we will update you once we have any information. The internal tracking ID for this issue will be SJS-7780.

    Regards
    Avinash
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels