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

feat(node): Migrate to domains used through AsyncContextStrategy #7779

Merged
merged 18 commits into from
Apr 11, 2023

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Apr 6, 2023

This PR:

  • Removes all the domain specific code from core
  • Replaces all the usages of domain.create().bind/run with runWithAsyncContext
  • Removes the domain.active hack from the Next.js init since domains are now not created by runWithAsyncContext until after initNode
  • Re-exports runWithAsyncContext from @sentry/node

@timfish timfish marked this pull request as ready for review April 6, 2023 19:12
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

node sdk index is now side effect free :)

@timfish
Copy link
Collaborator Author

timfish commented Apr 7, 2023

Ah, just noticed I still have some domain usages to remove from serverless!

@lforst
Copy link
Member

lforst commented Apr 7, 2023

node sdk index is now side effect free :)

This makes me so happy :)

Speaking of, @timfish would you mind adding a "sideEffects": false to the node SDK's package.json? That will make it tree shakable by webpack. (Not that important but some serverless folks care about bundle size)

@AbhiPrasad
Copy link
Member

Ah, just noticed I still have some domain usages to remove from serverless!

We also need to adjust the test in packages/node/test/manual/webpack-domain/index.js

@timfish
Copy link
Collaborator Author

timfish commented Apr 7, 2023

We also need to adjust the test in packages/node/test/manual/webpack-domain/index.js

Should we be re-exporting runWithAsyncContext from @sentry/node to make this possible?

@lforst
Copy link
Member

lforst commented Apr 7, 2023

We also need to adjust the test in packages/node/test/manual/webpack-domain/index.js

Should we be re-exporting runWithAsyncContext from @sentry/node to make this possible?

Shouldn't we be exporting this API everywhere? Doesn't have to be right now but at some point I think we should, right?

@AbhiPrasad
Copy link
Member

We also need to adjust the test in packages/node/test/manual/webpack-domain/index.js

Should we be re-exporting runWithAsyncContext from @sentry/node to make this possible?

Yup we'll need to re-export this API, since this is how we are going to tell people to do isolation when they manually instrument.

@timfish
Copy link
Collaborator Author

timfish commented Apr 7, 2023

Yup we'll need to re-export this API

I might change the name of the args option before we export and document this!

@timfish timfish self-assigned this Apr 9, 2023
@AbhiPrasad AbhiPrasad merged commit 5062ce1 into getsentry:develop Apr 11, 2023
@AbhiPrasad
Copy link
Member

AbhiPrasad commented Apr 11, 2023

Oh realized we didn't do the package.json change here, will open up a PR for that!

And this is why you don't do early morning code review 😭 - it is there, just skipped the file completely!

@timfish timfish deleted the feat/migrate-async-strategy branch April 11, 2023 08:42
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.

3 participants