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(v8/gatsby): Update SDK initialization for gatsby #11292

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

AbhiPrasad
Copy link
Member

This is quite the refactor, I recommend reading through the migration docs to understand what the user facing API should be.

  1. Remove deprecated SDK init via options

We used to initialize the SDK via Gatsby plugin options in the Gatsby SDK. This is very restrictive though, and due to how Gatsby serializes it's options can lead to bugs. Later on in v7 of the SDK we introduced a sentry.config.js approach (docs). This PR removes support for the plugin option deprecation.

  • Remove automatic adding of browserTracingIntegration

Because of the plugin option initialization, we used to add browserTracingIntegration integration automatically via SDK init. v8 removes this because of bundle size + we don't have good routing instrumentation for gatsby.

  • Upgrade gatsby webpack plugin to 2.0, and add option to configure it's usage

resolves #9837 - I called the option to control this enableClientWebpackPlugin.

- Remove deprecated SDK init via options
- Remove automatic adding of browserTracingIntegration
- Upgrade gatsby webpack plugin to 2.0, and add option to configure it's
  usage
@AbhiPrasad AbhiPrasad requested review from mydea, lforst and a team March 26, 2024 18:58
@AbhiPrasad AbhiPrasad self-assigned this Mar 26, 2024
@@ -5731,18 +5731,6 @@
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.30.2.tgz#1e84df37e9f0e5743b42435f92982cf7dae5e6d8"
integrity sha512-gF9wSZxzXFgakkC+uKVLAAYlbYj13e1gTsNm3gm+ODfpV+rbHwvbKoLfNsbVCFVCEZxIV2rXEP5WmTr0kiMvWQ==

"@sentry/cli@^1.74.4":
version "1.77.1"
Copy link
Member Author

Choose a reason for hiding this comment

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

bye bye sentry-cli v1 👋

This comment was marked as off-topic.

Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) 80.55 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing, Replay) 71.89 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 75.7 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 65.44 KB (0%)
@sentry/browser (incl. Tracing) 36.71 KB (0%)
@sentry/browser (incl. browserTracingIntegration) 36.71 KB (0%)
@sentry/browser (incl. feedbackIntegration) 31.35 KB (-0.05% 🔽)
@sentry/browser (incl. feedbackModalIntegration) 31.46 KB (-0.05% 🔽)
@sentry/browser (incl. feedbackScreenshotIntegration) 31.47 KB (-0.05% 🔽)
@sentry/browser (incl. sendFeedback) 27.42 KB (-0.07% 🔽)
@sentry/browser 22.58 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 74.9 KB (0%)
CDN Bundle (incl. Tracing, Replay) 69.73 KB (0%)
CDN Bundle (incl. Tracing) 36.3 KB (0%)
CDN Bundle 23.94 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 219.01 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 109.57 KB (0%)
CDN Bundle - uncompressed 70.92 KB (0%)
@sentry/react (incl. Tracing, Replay) 71.87 KB (0%)
@sentry/react 22.61 KB (0%)

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

nice one!

@AbhiPrasad AbhiPrasad merged commit ee1b96b into develop Mar 27, 2024
93 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-v8-gatsby branch March 27, 2024 13:12
cadesalaberry pushed a commit to cadesalaberry/sentry-javascript that referenced this pull request Apr 19, 2024
This is quite the refactor, I recommend reading through the migration
docs to understand what the user facing API should be.

1. Remove deprecated SDK init via options

We used to initialize the SDK via Gatsby plugin options in the Gatsby
SDK. This is very restrictive though, and due to how Gatsby serializes
it's options can lead to bugs. Later on in v7 of the SDK we introduced a
`sentry.config.js` approach
([docs](https://docs.sentry.io/platforms/javascript/guides/gatsby/)).
This PR removes support for the plugin option deprecation.

- Remove automatic adding of `browserTracingIntegration`

Because of the plugin option initialization, we used to add
`browserTracingIntegration` integration automatically via SDK init. v8
removes this because of bundle size + we don't have good routing
instrumentation for gatsby.

- Upgrade gatsby webpack plugin to 2.0, and add option to configure it's
usage

resolves getsentry#9837 - I
called the option to control this `enableClientWebpackPlugin`.
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.

[v8] Bump @sentry/webpack-plugin in @sentry/gatsby & stop exposing options directly
2 participants