-
Notifications
You must be signed in to change notification settings - Fork 253
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
Refactor @bugsnag/browser #2252
base: integration/typescript
Are you sure you want to change the base?
Conversation
a04fe2c
to
1b9a68e
Compare
a881ec2
to
5519d06
Compare
9a4591e
to
7bbbff9
Compare
5519d06
to
08a3dc9
Compare
08a3dc9
to
8c78faf
Compare
@@ -49,7 +49,9 @@ module.exports = { | |||
'plugin-simple-throttle', | |||
'plugin-console-breadcrumbs', | |||
'plugin-browser-session' | |||
]), | |||
], { | |||
setupFiles: ['<rootDir>/jest/setup/mockEventTarget.js'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See jsdom/jsdom#2156
This is needed to fix the TypeError: 'addEventListener' called on an object that is not a valid instance of EventTarget.
seen in the integration tests following the rollup changes
packages/browser/package.json
Outdated
"build:dist": "cross-env NODE_ENV=production bash -c '../../bin/bundle src/notifier.js --standalone=Bugsnag | ../../bin/extract-source-map dist/bugsnag.js'", | ||
"build:dist:min": "cross-env NODE_ENV=production bash -c '../../bin/bundle src/notifier.js --standalone=Bugsnag | ../../bin/minify dist/bugsnag.min.js'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can these be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep - and possibly the minification scripts, too?
@@ -52,7 +52,7 @@ describe('browser notifier', () => { | |||
load: client => 10 | |||
}] | |||
}) | |||
expect(Bugsnag.getPlugin('foobar')).toBe(10) | |||
expect(Bugsnag.getPlugin?.('foobar')).toBe(10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Fix
Goal
This PR converts the last of the internal browser plugins and the browser client to TypeScript, using Rollup to bundle both common js and es modules
Following this work, we can then validate a flattened module (fesm) with a modern angular app
Design
Changeset
Testing
Existing test suite