Skip to content

Bower for individual plugins #415

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

Closed
atticoos opened this issue Nov 9, 2015 · 11 comments
Closed

Bower for individual plugins #415

atticoos opened this issue Nov 9, 2015 · 11 comments
Assignees

Comments

@atticoos
Copy link

atticoos commented Nov 9, 2015

I'd like to propose the possibility of introducing bower packages, on separate release cycles, for the raven plugins -- such as angular.

For our product it's important that we can lock the version of external libraries we depends on. Technically, raven-js and the angular module are separate things, but part of the same codebase. Unless I'm mistaken and the versioning for the core of raven-js and the angular integration go hand in hand.

I'd like to point to how other projects similarly address this scenario. For instance,angular/angular.js itself is comprised of many components that are exposed as additional modules that are not part of the core installation. They're broken into different bower packages in different repositories for separate versioning.

@dcramer
Copy link
Member

dcramer commented Nov 9, 2015

I'm generally +1 on this idea, both for Bower and NPM.

@mattrobenolt
Copy link
Contributor

This has been discussed internally briefly fwiw, and I'm a bit torn.

We have 3 primary use cases:

  • Installing from CDN where everything just works in a <script> tag. This can be seen littered throughout our documentation and what we recommend.
  • Installing from bower (I've personally never done this before, only accepted pull requests to provide support). I also have no idea how many people do this since we don't have stats for installs.
  • Installing from npm (We do this internally for Sentry for webpack)

So with that said, here are some complications with our CDN stuff (which is our #1 consumer):

We provide versioned urls based on the raven-js version, something like: https://cdn.ravenjs.com/1.3.0/jquery,native/raven.min.js which is saying "give me raven.js version 1.3.0, with the bundled plugins jquery, and native." These plugins can be mixed and matched into any permutation. So right now, they are tied to the main raven-js version, and individual plugins get versioned along with that.

If we switch everything to supporting commonjs, which @benvinegar is working on, this solves at least the npm case, since a module could be required like, require('raven/plugins/foo') without needing to install a separate package.

Bower, I have no idea if this would be solved with the commonjs path. My guess is it would, but I'm not familiar with that use case personally.

So, to summarize:

I'm +1 to doing this where it makes sense. I don't think we can blanket apply this to all plugins, but it probably makes sense for things like angular and possible ember, or the other large frameworks we support. And for the record, at the moment, I version raven-js according to breaking changes in plugins too, just to be safe, but this means things are a bit intertwined which isn't the best, I admit. I'd personally like to see them split out, but I think there's some work that needs to be done first on our side + figure out which ones it makes sense to do this with.

@mattrobenolt
Copy link
Contributor

Also, I forgot to ask, for the bower specific repositories, how does that then work with npm? Would we maintain both a repository for bower and one for npm? That seems a bit excessive imo. Could we just do the same as we're doing in here? Include both a {bower,package}.json? Or am I missing some nuance in the ecosystem that makes this less than ideal?

@mattrobenolt
Copy link
Contributor

And going to assume this is dependent on #323

@kukac7
Copy link

kukac7 commented Jan 16, 2016

bower + raven.js 2.x + angular

Only the dist/raven.js files in the package, I think the plugins/angular.js file should be added because of the ngRaven will not be loaded.
So I add it to the file bower.json:

"overrides": {
    "raven-js": {
      "main": [
        "dist/raven.js",
        "plugins/angular.js"
      ]
    }
  }

I get this error: Uncaught ReferenceError: module is not defined module.exports = angularPlugin;
It compresses the files by gulp.

What is the problem?
Thanks!

@kukac7
Copy link

kukac7 commented Jan 21, 2016

@benvinegar
Raven.config(config).addPlugin(Raven.Plugins.Angular).install();
or
Raven.config(config).addPlugin(Raven.Angular).install();
which one is good?
and the above problem you could have something to say?

thank you!

@benvinegar
Copy link
Contributor

@kukac7 – I'm putting up some examples today. Sorry, bear with me.

@benvinegar
Copy link
Contributor

and the above problem you could have something to say?

The 2.1.0 release from earlier this week builds proper distributable version of angular.js (/dist/plugins/angular.js).

which one is good?

It should be Raven.config(config).addPlugin(Raven.Plugins.Angular).install();

@kamilogorek kamilogorek removed the DDN label Sep 11, 2017
@kamilogorek
Copy link
Contributor

We already discussed this, and we'll go with a separate releases for every plugin.

@mjrdnk
Copy link

mjrdnk commented Oct 31, 2017

@kukac7 try this:

"overrides": {
    "raven-js": {
      "main": [
        "dist/raven.js",
        "dist/plugins/angular.js"
      ]
    }
}

This works for me.

@kukac7
Copy link

kukac7 commented Oct 31, 2017

@mjrdnk thanks, it's been solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants