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

[v8] Remove @sentry/hub package #5665

Closed
Tracked by #9508
AbhiPrasad opened this issue Aug 31, 2022 · 8 comments · Fixed by #5823 or #10530
Closed
Tracked by #9508

[v8] Remove @sentry/hub package #5665

AbhiPrasad opened this issue Aug 31, 2022 · 8 comments · Fixed by #5823 or #10530
Assignees
Milestone

Comments

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Aug 31, 2022

Problem Statement

We have both https://github.com/getsentry/sentry-javascript/tree/master/packages/hub and https://github.com/getsentry/sentry-javascript/tree/master/packages/core, and there should never be a situation where you import @sentry/hub and you aren't using @sentry/core. As such, we should just consolidate this into 1 package (move everything in @sentry/hub into @sentry/core.)

  • Less stuff to download from npm
  • Less chance of versions getting out of sync
  • Easy to understand core -> browser -> react -> nextjs (linear deps)
  • Possible bundle size reduction from removing module boundaries
@shezhangzhang
Copy link

Why didn't do it in the first place?

@AbhiPrasad
Copy link
Member Author

Maybe @kamilogorek can offer us some history listens on why hub was made a seperate package.

@kamilogorek
Copy link
Contributor

Whole @sentry/minimal was build around @sentry/hub. If you are writing 3rd party integrations, or plug-in widgets, you are not going to depend on @sentry/core, and can use @sentry/hub directly.

@timfish
Copy link
Collaborator

timfish commented Sep 26, 2022

Would it be possible to move the hub code without breaking the public API?

We could move the code to core and then have hub only depend on core and re-export the types?

The only reason I suggest this is because it becomes easier to make the changes and iterate on the codebase without creating a load of merge conflicts as v8 approaches. When we get to v8 we'd simply remove the @sentry/hub package?

The only downside I can see is that we'd be exporting the types from two different packages at the same time.

@AbhiPrasad
Copy link
Member Author

We could move the code to core and then have hub only depend on core and re-export the types?

I'm going to go ahead and make the call for us to do this, esp if it makes the work in #5611 easier.

The only downside I can see is that we'd be exporting the types from two different packages at the same time.

Internally, we can shift to only depending on core, so the chances of this causing issues will decrease.

@lobsterkatie
Copy link
Member

The only downside I can see is that we'd be exporting the types from two different packages at the same time.

We already do this all over the place, because most wrapper SDKs re-export stuff from the SDKs they wrap. I don't think it's an issue.

@timfish
Copy link
Collaborator

timfish commented Oct 7, 2022

I've reopened this and it can be closed when @sentry/hub is finally deleted and the tests are migrated to core.

@yordis
Copy link
Contributor

yordis commented Oct 10, 2022

Happy about this change! 🚀

@mydea mydea mentioned this issue Nov 9, 2023
@mydea mydea changed the title Remove @sentry/hub [v8] Remove @sentry/hub package Dec 14, 2023
@AbhiPrasad AbhiPrasad self-assigned this Feb 6, 2024
AbhiPrasad added a commit that referenced this issue Feb 8, 2024
closes #5665

Goodbye hub package, I've known you my whole (sentry) life.

Moved tests into core where applicable, otherwise deleted tests that
were redundant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment