nhn / tui.image-editor

🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
http://ui.toast.com/tui-image-editor
MIT License
7.05k stars 1.3k forks source link

Exclude polyfills from the bundle #450

Open kaproslaci opened 4 years ago

kaproslaci commented 4 years ago

Describe the bug Including the polyfill causes incompatibilities with other libraries. I'd suggest removing the polyfill from the bundle and include it besides. I reproduced it in a very specific environment but I suppose others may suffer from the issue too. Just by reading issues, similar situations can occur with other components, such as ag-grid, vue-filepond... Also, I think managing outdated browsers and polyfills is the responsibility of the library user, not the library owner (i.e: why the polyfills if someone dropped IE support?)

To Reproduce Steps to reproduce the behavior:

  1. Create an Angular 8+ application depending on ng-bootstrap.
  2. Insert an ngbDropdownToggle.
  3. Insert the tui-image-editor in a lazy-loaded module.
  4. After navigating to the lazy loaded module, every time you click on the dropdown toggle, the application is going to freeze. It is caused by the svgxuse polyfill that will create a MutationObserver which will trigger an infinite loop of dom change for example in the described situation above.

Expected behavior Include the polyfills separately or just write them into readme so the library users can decide if they wanna use them.

Desktop (please complete the following information): I reproduced this issue on Chrome and Firefox on Mac and Windows as well. I assume every kind of chrome and Firefox were affected.

jinwoo-kim-nhn commented 4 years ago

@kaproslaci Thanks for letting me know. I will refer to it for improvement.

viveks7 commented 1 year ago

@kaproslaci Thanks for letting me know. I will refer to it for improvement.

Any updates on this? We also ran into same issue using this library.