arusahni / ngtweet

Easily embed Twitter widgets into your Angular application! No more having to kludge together a Twitter script loader, or manage embed state on route/visibility change.
http://arusahni.github.io/ngtweet/
MIT License
34 stars 22 forks source link

Minified (production) version of this library modifies global app settings #9

Closed Yurko-Fedoriv closed 8 years ago

Yurko-Fedoriv commented 8 years ago

https://github.com/arusahni/ngtweet/blob/master/src/prod.config.js

This is somehow unexpected and I don't think should happen in public library. I've got an issue with https://github.com/angular-ui-tree/angular-ui-tree library which relies on angular.element(node).scope() for it's drag-n-drop functionality, which itself becomes unavailable if you do $compileProvider.debugInfoEnabled(false); Took me a bit of time to investigate. There are easy workarounds: use non-minified version (minify it by yourself), or reenable this feature in app config, but again, I would not expect such global influence on the app from one of many libs.

arusahni commented 8 years ago

Thanks for the report! I agree that a library shouldn't modify global state. Will address in a future bugfix release.

arusahni commented 8 years ago

@Yurko-Fedoriv Can you check out the production version that's currently on develop? I've got a hack in place that I want to verify addresses your issue.

Yurko-Fedoriv commented 8 years ago

@arusahni Yep, that's it. I would suggest you use this https://www.npmjs.com/package/gulp-strip-ng-log instead of commenting out all $log.* calls, should be a cleaner way.

arusahni commented 8 years ago

@Yurko-Fedoriv Thanks for the link! I was planning on creating a module-level wrapper for the log provider, but that looks a lot better. Is there anything Gulp can't do? :smile:

Yurko-Fedoriv commented 8 years ago

I this there is no such thing :-)

arusahni commented 8 years ago

@Yurko-Fedoriv I'll have a release out in the next day or so. Will ping you on this thread when it's out.

arusahni commented 8 years ago

Should be fixed in v0.3.1. Thanks for the report!

Yurko-Fedoriv commented 8 years ago

nice, thanks. I'll check it out