Skip to content

Feature Request | Allow Multiple Raven Instances #1269

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
wants to merge 2 commits into from
Closed

Feature Request | Allow Multiple Raven Instances #1269

wants to merge 2 commits into from

Conversation

mariawix
Copy link

This PR creates a new bundle exposing both Raven constructor and singleton.

This functionality has been mentioned before.

Our web application is constructed as a composite of multiple sub-applications, which run in the same tab or worker. Each sub-application is developed and managed independently by a separate group. Each one of these groups wants to have its own DSN so that it can monitor its sub-application independently. Besides that the main application has its own Raven singleton.
Thus we need both Raven constructor and Raven singleton and we’d like to avoid fetching / bundling Raven twice. Unfortunately, the current API doesn’t allow this.

@mariawix mariawix requested a review from kamilogorek as a code owner March 21, 2018 11:45
@zivl
Copy link
Contributor

zivl commented Mar 22, 2018

why not creating a new index.js file as follows:

var singleton = require('./singleton');
var RavenConstructor = require('./raven');

module.exports = singleton;
module.exports.RavenConstructor = RavenConstructor;

and then point main in package.json file to index.js
I don't see a reason to touch the way Raven is packed (i.e. no need for grunt file changes)

@kamilogorek
Copy link
Contributor

kamilogorek commented Mar 22, 2018

@zivl it can be resolved simply by adding this line to the singleton.js file:

module.exports.Client = RavenConstructor;

We already do this in Node, so we may also do it here as well.

@zivl
Copy link
Contributor

zivl commented Mar 22, 2018

@kamilogorek sure!
My thought was to keep the singleton.js cleaner but if you can go with that so its cool.
(even smaller change :) )

@kamilogorek
Copy link
Contributor

@mariawix @zivl #1272
Let me close this one :)

@mariawix
Copy link
Author

@zivl @kamilogorek I didn't want to change API of Raven, for me both changes are good.

Thanks!

@kamilogorek
Copy link
Contributor

Published as 3.24.0 :)

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

Successfully merging this pull request may close these issues.

3 participants