plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
449 stars 610 forks source link

Lazy Load Sentry dependency or make it optional in config.js #2857

Open tisto opened 2 years ago

tisto commented 2 years ago

Is your feature request related to a problem? Please describe.

Volto currently loads the sentry js library with 70kb no matter if it is used or not.

Lighthouse-Treemap (2)

Describe the solution you'd like

I guess it is not possible to lazy load the library since it needs to be around in case of an error. Though, maybe we could make sentry optional in the config.js ("sentry=false" by default) to reduce the bundle size for sites that do not use Sentry.

tiberiuichim commented 2 years ago

I mean, if we think about it, if the default webpack mechanisms for loading modules fail and that code runs in production, you have bigger issues than sentry not being loaded by default.

I'm +1 on making sentry lazyload by default.