sentry-capacitor icon indicating copy to clipboard operation
sentry-capacitor copied to clipboard

Remove CommonJS or AMD dependencies

Open squio opened this issue 4 years ago • 2 comments

Environment

How do you use Sentry?

  • Sentry SaaS

Which SDK and version?

  • @sentry/capacitor 0.4.0
  • @sentry/angular 6.11.0

Steps to Reproduce

  1. generate a new ionic angular project
  2. npm install @sentry/capacitor, @sentry/angular
  3. include Sentry as per documentation
  4. build capacitor project, e.g. with ionic cap sync ios

Expected Result

Project builds clean and without warnings

Actual Result

The warning CommonJS or AMD dependencies can cause optimization bailouts is raised:

Warning: ./Development/ionicapp/src/app/app.module.ts depends on '@sentry/capacitor'. 
CommonJS or AMD dependencies can cause optimization bailouts.

For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

squio avatar Sep 02 '21 13:09 squio

@squio is this something you could contribute with a PR? We're happy to review and merge this

bruno-garcia avatar Sep 10 '21 14:09 bruno-garcia

Hi,

@squio is this something you could contribute with a PR? We're happy to review and merge this

I had a quick look at the release built files (in my node_modules) and it looks like the CommonJS require and related statements are somehow generated by the build system. Regrettably that is something I'm not familiar with but changing some settings there might fix this maybe?

Also I compared the initial bundle size with and without @sentry/capacitor which didn't make a huge difference, just over 20 kB for ES 2015 and double that for ES 5.

So overall maybe not a high priority...

squio avatar Sep 14 '21 14:09 squio

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar May 31 '23 00:05 github-actions[bot]