-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Better plugin support #282
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
Comments
Let us brainstorm a bit about this... 💭 So Raven-js needs a registry of all installed plugins. And a plugin needs a common interface. It could be something like this:
Then in a Browserify scenario, it could look something like this: var raven = require('raven-js/raven.js');
var plugin1 = require('raven-js/plugins/1');
var plugin2 = require('raven-js/plugins/1');
var options = {
ignoreErrors: [],
plugins: [plugin1, plugin2]
}
Raven.config('https://[email protected]/1', options).install() @mattrobenolt something like this? |
How does this work in non-browserify scenarios? Say, including as a |
The question is if we will continue with custom build where plugins are 'baked in'. If we do then the plugins list would already be prepopulated. |
Looks like your comment got removed by some XSS detector... :) |
Currently when including one of the custom builds with raven and some plugins, the plugins are automatically loaded, right? In the new solution we only want them to be loaded when raven is being installed. |
They are automatically loaded, but noop'd until Raven is configured/installed. |
Ok. So what is your take on the plugins in a non-browserify world? I guess the custom builds where everything is included is pretty nice. |
The problem is we need to covery many use cases:
I understand personally 2 of these cases. |
Take a look at: https://github.com/getsentry/raven-js/blob/master/template/_footer.js for what raven core needs to support. I'd imagine this all needs to carry over into plugins and needing to support somehow all of these cases as well. |
I think a good first step is providing a plugin interface that Raven understands, with the suggested install/uninstall methods. We can convert the plugins over to that. Then worry about module loading and whatnot after. Another aspect I'm very cognizant of is file size. I try very very hard to keep raven as small as possible, and keep in mind how things will get minified, and compare gzipped sizes. So I like to keep the public APIs small, since public APIs cannot get minified and contribute to overall size. :) |
@BYK Any opinions? Disqus has switched over to using raven.js through bower now, and through doing that has lost the plugins. I think it's bower + require.js? So curious if there has been any thought or plans on how to make this work. |
Makes sense. : ) One challenge with package managers might be to get a reference to for example But I agree @mattrobenolt , we would start with a first plugin version where we support that plugins can be uninstalled together with Raven-js. But let's get some input on the package manager use cases. |
In the case of browserify, I found out, there literally is no |
@mattrobenolt this is not true at all. |
@terinjokes Then I was misinformed. We had lots of issues checking for See: #261 I've literally never used browserify, fwiw. I can't keep track of these things, so there is some amount of trust that people who use this are fixing bugs that affect them. :) |
We've since changed the plugins dramatically – they no-longer self-execute, can be tested, etc. Closing this ticket. |
Need to come up with/think of a better plugin system. The current one was done as simple as possible to get things moving, but there are lots of downsides to it currently.
Probably other stuff too.
The text was updated successfully, but these errors were encountered: