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

ref: Remove circular dependency in @sentry/node #3335

Merged
merged 1 commit into from Mar 29, 2021
Merged

ref: Remove circular dependency in @sentry/node #3335

merged 1 commit into from Mar 29, 2021

Conversation

tkalliom
Copy link
Contributor

When rolluping code that uses sentry, I got a warning for circular references in @sentry/node. Here’s a summary of what references what:

File                                       Member                                       Exported from package as
------------------------------------------+--------------------------------------------+--------------------------------
src/sdk.ts                                 export const defaultIntegrations             defaultIntegrations
`src/integrations/index.ts                 export OnUncaughtException                   Integrations.OnUncaughtException
 `src/integrations/onuncaughtexception.ts  export class OnUncaughtException             Integrations.OnUncaughtException
  `src/handlers.ts                         export function logAndExitProcess (@hidden)  (Handlers.logAndExitProcess)
   
   src/handlers.ts                         export function requestHandler               Handlers.requestHandler
   `src/sdk.ts                             export async function flush                  flush

This could be resolved by extracting either flush or logAndExitProcess to a lower-level module. I opted to move logAndExitProcess because it is not public and because it seems neat that a function that is only called from integrations is placed inside that directory, not above it.

@kamilogorek kamilogorek merged commit 5339751 into getsentry:master Mar 29, 2021
@kamilogorek
Copy link
Contributor

Thanks!

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.

None yet

2 participants