getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.68k stars 1.49k forks source link

fix(feedback): Clarify the difference between createWidget and create Form in the feedback public api #11838

Closed ryan953 closed 3 weeks ago

ryan953 commented 3 weeks ago

Prior to this PR it was only possible to get the floating feedback button if you configured autoInject: true.

In our uses on sentry.io we want to be able to show that button on some pages, but not others. This make it possible, the (react hooks) code to do that is:

useEffect(() => {
  const widget = feedback.createWidget(options);
  return async () => {
    widget.removeFromDom();
  };
}, []);
github-actions[bot] commented 3 weeks ago

size-limit report 📦

Path Size
@sentry/browser 21.64 KB (0%)
@sentry/browser (incl. Tracing) 32.68 KB (0%)
@sentry/browser (incl. Tracing, Replay) 68.03 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.43 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.07 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.21 KB (-0.08% 🔽)
@sentry/browser (incl. Feedback) 37.77 KB (-0.04% 🔽)
@sentry/browser (incl. sendFeedback) 26.43 KB (+0.01% 🔺)
@sentry/browser (incl. FeedbackAsync) 30.9 KB (-0.11% 🔽)
@sentry/react 24.33 KB (0%)
@sentry/react (incl. Tracing) 35.64 KB (0%)
@sentry/vue 25.47 KB (0%)
@sentry/vue (incl. Tracing) 34.47 KB (0%)
@sentry/svelte 21.77 KB (0%)
CDN Bundle 23.95 KB (0%)
CDN Bundle (incl. Tracing) 33.98 KB (0%)
CDN Bundle (incl. Tracing, Replay) 67.67 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 83.58 KB (+0.04% 🔺)
CDN Bundle - uncompressed 70.58 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 100.94 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 210.55 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 257.02 KB (+0.04% 🔺)
@sentry/nextjs (client) 34.86 KB (0%)
@sentry/sveltekit (client) 33.24 KB (0%)
@sentry/node 138.47 KB (0%)