-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added CommonJS support #259
Conversation
So this does change behavior though. window.Raven no longer exists in the AMD loader path. This went back and forth a couple times and settled on it needing to be that way. I'll dig up the related tickets. |
I assumed that was a mistake. Why leak the global when you're using a module system? |
Just check out the commit history for this file and you'll see the back and forth: https://github.com/getsentry/raven-js/commits/master/template/_footer.js You can remove the global yourself easily with |
Specifcally 190d9e6 is the commit that brought it back to being a global, to support plugins easier. |
@christophercliff Did you close this on purpose? |
Yeah, I suspect this isn't the best way forward. |
How so? I'll take the |
Could you consider adopting the change in https://github.com/getsentry/raven-js/pull/206/files#diff-a4cb6d8063a6aea4bba2d6f10472b5f4L7 as well, otherwise it won't work with browserify. |
If the global must stay, I'd be happy if you left it as-is and published every release to npm. Maybe a crazy idea: rewrite as CommonJS and use a build tool like webpack to generate the UMD-compatible files for distribution. You could avoid some of these manual compatibility woes. |
Like I've said, I'm open to somebody proposing a better solution. I don't use any of these tools personally so it's a bit foreign to me. -- On Fri, Sep 12, 2014 at 2:28 PM, Christopher Cliff
|
Verified in the node repl (e.g.
var Raven = require('./dist/raven')
).Not covered by automated testing--I couldn't figure out a testing approach given the current design.
Fixes #197.