-
Notifications
You must be signed in to change notification settings - Fork 256
Remove @bugsnag/core/lib/es-utils/includes #2465
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
base: integration/typescript
Are you sure you want to change the base?
Conversation
import { add, clear, merge } from './lib/feature-flag-delegate' | ||
import { BreadcrumbType, Config, Delivery, FeatureFlag, LoggerConfig, NotifiableError, Notifier, OnBreadcrumbCallback, OnErrorCallback, OnSessionCallback, Plugin, SessionDelegate, User } from './common' | ||
import { BreadcrumbType, BREADCRUMB_TYPES, Config, Delivery, FeatureFlag, LoggerConfig, NotifiableError, Notifier, OnBreadcrumbCallback, OnErrorCallback, OnSessionCallback, Plugin, SessionDelegate, User } from './common' |
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.
Not sure why it was doubled. But I replace BREADCRUMB_TYPES
from lib/breadcrumb-types
with ones from common
. They are identical.
const types = this._config.enabledBreadcrumbTypes | ||
|
||
return types === null || includes(types, type) | ||
return types === null || types.includes(type) |
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.
Here is a little complication. As we were having type
as string
TS complaining that in line 327: TS2345: Argument of type string is not assignable to parameter of type BreadcrumbType
. Because const types: BreadcrumbType[]
.
And if I will change it to BreadcrumbType, I'm having an issue in plugin-browser-session/src/session
.
_isBreadcrumbTypeEnabled: (type: ConsoleMethod) => boolean
So currently I set (type: any)
.
08f2229
to
e13793d
Compare
Goal
Remove @bugsnag/core/lib/es-utils/includes and replace it with Array.prototype.includes().
Design
Publish core as ES module with TypeScript
Changeset
Delete @bugsnag/core/lib/es-utils/includes
Delete
breadcrumb-types.ts
as we already have that types incommon.ts
Testing
Covered by existing end to end and unit tests