Skip to content
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/plugin-client-ip #2260

Merged

Conversation

AnastasiiaSvietlova
Copy link
Contributor

Goal

Convert source code to TypeScript and export both es modules and common js modules

Testing

Covered by existing test suite

@AnastasiiaSvietlova AnastasiiaSvietlova changed the base branch from next to integration/typescript November 22, 2024 16:51
Copy link

github-actions bot commented Nov 22, 2024

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 46.13 kB 13.85 kB
After 46.14 kB 13.86 kB
± ⚠️ +13 bytes ⚠️ +9 bytes

code coverage diff

<temporarily disabled>

Generated by 🚫 dangerJS against 8d6f114

@AnastasiiaSvietlova AnastasiiaSvietlova marked this pull request as ready for review November 25, 2024 08:18
*/
const plugin: Plugin = {
load: client => {
// @ts-expect-error _config is private API
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we extend the Plugin interface here to get rid of these instances of ts-expect-error?

@gingerbenw gingerbenw force-pushed the PLAT-13090-plugin-client-ip branch from c391bf4 to 0059f4f Compare November 25, 2024 11:53
/*
* Prevent collection of user IPs
*/
const plugin: Plugin = {
Copy link
Member

@gingerbenw gingerbenw Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also change this to

interface ExtendedPlugin extends Plugin {
  configSchema: Record<string, ValidationOption>
}

interface ValidationOption {
  validate: (value: unknown) => boolean
  defaultValue: () => unknown
  message: string
}

to remove the need for the second @ts-expect-error

@AnastasiiaSvietlova AnastasiiaSvietlova merged commit af49fb0 into integration/typescript Nov 26, 2024
56 checks passed
@AnastasiiaSvietlova AnastasiiaSvietlova deleted the PLAT-13090-plugin-client-ip branch November 26, 2024 16:18
gingerbenw pushed a commit that referenced this pull request Dec 5, 2024
* refactor @bugsnag/plugin-client-ip

* fix rollup config

* update with internal client

* update extended plugin interface

* fix value type to unknown
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.

2 participants