-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Electron plugin #637
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
Electron plugin #637
Conversation
|
Hey @arusakov – looks pretty good, but I would like to explore making this its own repository before merging. I'll probably do that sometime this week. |
|
If this only requires mangling filenames I'd like to figure out how we move this to server (ala getsentry/sentry#4090). I'm wondering if we could just maintain the |
|
@getsentry/javascript |
|
@dcramer |
|
@dcramer @benvinegar But you can bundle app to asar archive: Origin http://electron.atom.io/docs/tutorial/application-distribution/ |
|
@arusakov implemented the other path names in getsentry/sentry#4090 |
|
@arusakov – I appreciate the contribution, but our plan is to develop a plugin that leverages both raven-node and raven-js (so it can be used on both server and client). We'll refer back to this for posterity. |
|
Can you suggest any temporary decision for electron? |
|
@VladimirPal |
|
@arusakov Thank you, already did it. // raven-electron-plugin.js
const PATH_MATCH_RE = /[^/]+$/;
function normalizeUrl(url) {
const match = url.match(PATH_MATCH_RE);
return match ? `~/${match[0]}` : url;
}
function electronPlugin(Raven) {
Raven.setDataCallback((data) => {
electronPlugin._normalizeData(data);
});
}
electronPlugin._normalizeData = function normalizeData(data) {
if (data.culprit) {
data.culprit = normalizeUrl(data.culprit);
const stacktrace = data.stacktrace || data.exception && data.exception.values[0].stacktrace; // eslint-disable-line
if (stacktrace) {
stacktrace.frames.forEach((frame) => {
frame.filename = normalizeUrl(frame.filename);
});
}
}
};
module.exports = electronPlugin;// index.js - endpoint on my app
import Raven from 'raven-js';
Raven.addPlugin(require('./raven-electron-plugin')); |
|
Note also that some users have reported (in #812) simply using raven-node in their electron apps. I haven't investigated what the difference in functionality might be, just pointing out the option/alternative. |
Bumps the vendored-in web vitals library to include the changes between `5.0.2` <-> `5.1.0` from upstream #### Changes from upstream - Remove `visibilitychange` event listeners when no longer required [#627](GoogleChrome/web-vitals#627) - Register visibility-change early [#637](GoogleChrome/web-vitals#637) - Only finalize LCP on user events (isTrusted=true) [#635](GoogleChrome/web-vitals#635) - Fallback to default getSelector if custom function is null or undefined [#634](GoogleChrome/web-vitals#634) #### Our own Changes - Added `addPageListener` and `removePageListener` utilities because the upstream package changed the listeners to be added on `window` instead of `document`, so I added those utilities to avoid having to check for window every time we try to add a listener.
Plugin with simple dataCallback() and some tests
This change is