Skip to content

docs(feedback): Add notes about async loading the Feedback integration #10108

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

Merged
merged 6 commits into from
May 29, 2024

Conversation

ryan953
Copy link
Member

@ryan953 ryan953 commented May 22, 2024

This adds documentation for a new feature/behavior within the User Feedback SDK -> different strategies for bundling the SDK code within your app.

I tried to be verbose about what's available, and what the defaults are. I hope it makes sense.

Relates to getsentry/sentry#70862

Copy link

vercel bot commented May 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2024 5:05pm

Copy link
Member

@billyvg billyvg left a comment

Choose a reason for hiding this comment

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

Content wise, this seems good. I think there's some wordsmithing needed, but will leave that up to the pros


2. `feedbackAsyncIntegration`

This integration includes the minimum amount of code needed to show the "Send Feedback" button on the screen when the page is loaded. When the user clicks on that button the integration will asyncronously load inrernal integrations that show the form, and let the user type out their feedback message. This has the benefit of being the lowest bundle size. The drawback is that asyncronous loading can fail when the user interacts with the button.
Copy link
Member

@billyvg billyvg May 22, 2024

Choose a reason for hiding this comment

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

Suggested change
This integration includes the minimum amount of code needed to show the "Send Feedback" button on the screen when the page is loaded. When the user clicks on that button the integration will asyncronously load inrernal integrations that show the form, and let the user type out their feedback message. This has the benefit of being the lowest bundle size. The drawback is that asyncronous loading can fail when the user interacts with the button.
This integration includes the minimum amount of code needed to show the "Send Feedback" button on the screen when the page is loaded. When the user clicks on that button, the integration will asynchronously load internal integrations that show the form and let the user type out their feedback message. This has the benefit of being the lowest bundle size. The drawback is that asynchronous loading can fail when the user interacts with the button.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe mention ad blocker as an example?
Should we describe how/where the async code is loaded from?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 I think it'd be helpful to explain a bit more

Copy link
Member Author

Choose a reason for hiding this comment

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

i put some notes in there about loading from our CDN and ad-blockers. take another look at the whole paragraph and lmk


This integration includes the minimum amount of code needed to show the "Send Feedback" button on the screen when the page is loaded. When the user clicks on that button the integration will asyncronously load inrernal integrations that show the form, and let the user type out their feedback message. This has the benefit of being the lowest bundle size. The drawback is that asyncronous loading can fail when the user interacts with the button.

All of the code examples on this page use `feedbackIntegration` as a default because it is available whether you have chosen the CDN or NPM installation method. However the implementation of `feedbackIntegration` is different depending on the installation method. For CDN users `feedbackIntegration` is an alias of `feedbackAsyncIntegration`, while for NPM users `feedbackIntegration` is an alias of `feedbackSyncIntegration`.
Copy link
Member

Choose a reason for hiding this comment

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

Do we usually use NPM as the terminology for a local bundle?

Copy link
Contributor

@vivianyentran vivianyentran left a comment

Choose a reason for hiding this comment

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

Added some suggestions


2. `feedbackAsyncIntegration`

This integration includes the minimum amount of code needed to show the "Send Feedback" button on the screen when the page is loaded. When the user clicks on that button the integration will asyncronously load inrernal integrations that show the form, and let the user type out their feedback message. This has the benefit of being the lowest bundle size. The drawback is that asyncronous loading can fail when the user interacts with the button.
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 I think it'd be helpful to explain a bit more

Comment on lines 310 to 314
The `feedbackIntegration` is special among our integrations because it is a user-facing integration. Therefore, we have two strategies available to help you control bundle size. What strategies are available depend on how you have installed the SDK into your application.

<Note>
In every case, we recommend using `feedbackIntegration` in your `Sentry.init` call.
</Note>
Copy link
Contributor

@vivianyentran vivianyentran May 22, 2024

Choose a reason for hiding this comment

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

Suggested change
The `feedbackIntegration` is special among our integrations because it is a user-facing integration. Therefore, we have two strategies available to help you control bundle size. What strategies are available depend on how you have installed the SDK into your application.
<Note>
In every case, we recommend using `feedbackIntegration` in your `Sentry.init` call.
</Note>
Because the `feedbackIntegration` is a user-facing integration, we offer two loading strategies that have implications on bundle size.
<Note>
In every case, we recommend using `feedbackIntegration` in your `Sentry.init` call.
</Note>
All of the code examples on this page use `feedbackIntegration` as a default because it is available whether you have chosen the CDN or NPM installation method. However, the implementation of `feedbackIntegration` is different depending on the installation method. For NPM users `feedbackIntegration` is an alias of `feedbackSyncIntegration`. For CDN users, `feedbackIntegration` is an alias of `feedbackAsyncIntegration`.

Comment on lines 316 to 320
1. `feedbackSyncIntegration`

This integration includes all the code needed to render the "Send Feedback" button, as well as the form that is triggered when the button is clicked. Choosing this loading strategy means accepting the largest bundle size in your application. The benefit of this is that the feedback widget is guaranteed to work when the user interacts with it.

This loading strategy is not available if you have installed the SDK via the CDN.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. `feedbackSyncIntegration`
This integration includes all the code needed to render the "Send Feedback" button, as well as the form that is triggered when the button is clicked. Choosing this loading strategy means accepting the largest bundle size in your application. The benefit of this is that the feedback widget is guaranteed to work when the user interacts with it.
This loading strategy is not available if you have installed the SDK via the CDN.
#### `feedbackSyncIntegration`
If you have installed the SDK with NPM, this loading strategy is used by default. This strategy is not available if you have installed the SDK via the CDN.
This integration includes all the code needed to render the "Send Feedback" button, as well as the form that is triggered when the button is clicked. Choosing this loading strategy means accepting the largest bundle size in your application. The benefit of this is that the feedback widget is guaranteed to work when the user interacts with it.

I don't think numbering these makes sense since it's not ordered so let's just make it a smaller heading. I'd also put at the top who this strategy is for.

Comment on lines 322 to 324
2. `feedbackAsyncIntegration`

This integration includes the minimum amount of code needed to show the "Send Feedback" button on the screen when the page is loaded. When the user clicks on that button the integration will asyncronously load inrernal integrations that show the form, and let the user type out their feedback message. This has the benefit of being the lowest bundle size. The drawback is that asyncronous loading can fail when the user interacts with the button.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
2. `feedbackAsyncIntegration`
This integration includes the minimum amount of code needed to show the "Send Feedback" button on the screen when the page is loaded. When the user clicks on that button the integration will asyncronously load inrernal integrations that show the form, and let the user type out their feedback message. This has the benefit of being the lowest bundle size. The drawback is that asyncronous loading can fail when the user interacts with the button.
#### `feedbackAsyncIntegration`
If you installed the SDK with the CDN, this loading strategy is used by default. If you used NPM, you can still choose to use this loading strategy by adding this integration to your `Sentry.init` call.
This integration includes the minimum amount of code needed to show the "Send Feedback" button on the screen when the page is loaded. When the user clicks on that button, the integration will asynchronously load internal integrations that show the form and let the user type out their feedback message. This has the benefit of being the lowest bundle size. The drawback is that asynchronous loading can fail when the user interacts with the button.


This integration includes the minimum amount of code needed to show the "Send Feedback" button on the screen when the page is loaded. When the user clicks on that button the integration will asyncronously load inrernal integrations that show the form, and let the user type out their feedback message. This has the benefit of being the lowest bundle size. The drawback is that asyncronous loading can fail when the user interacts with the button.

All of the code examples on this page use `feedbackIntegration` as a default because it is available whether you have chosen the CDN or NPM installation method. However the implementation of `feedbackIntegration` is different depending on the installation method. For CDN users `feedbackIntegration` is an alias of `feedbackAsyncIntegration`, while for NPM users `feedbackIntegration` is an alias of `feedbackSyncIntegration`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
All of the code examples on this page use `feedbackIntegration` as a default because it is available whether you have chosen the CDN or NPM installation method. However the implementation of `feedbackIntegration` is different depending on the installation method. For CDN users `feedbackIntegration` is an alias of `feedbackAsyncIntegration`, while for NPM users `feedbackIntegration` is an alias of `feedbackSyncIntegration`.

Would move this info up to the top since it's useful to know what the default behavior is before learning more about the strategies.

@ryan953 ryan953 force-pushed the ryan953/70862-async-loading branch from dce95e9 to 3632fb0 Compare May 28, 2024 17:38
@ryan953 ryan953 requested review from billyvg and vivianyentran May 28, 2024 17:38
Copy link

codecov bot commented May 28, 2024

Bundle Report

Changes will decrease total bundle size by 6 bytes ⬇️

Bundle name Size Change
sentry-docs-server 7.42MB 3 bytes ⬇️
sentry-docs-edge-server 461.49kB 3 bytes ⬇️
sentry-docs-client 6.18MB 0 bytes


If you have installed the SDK with NPM, this loading strategy is used by default. This strategy is not available if you have installed the SDK via the CDN.

This integration includes all the code needed to render the "Send Feedback" button, as well as the form that is triggered when the button is clicked. Choosing this loading strategy means accepting the largest bundle size in your application. The benefit of this is that the feedback widget is guaranteed to work when the user interacts with it.
Copy link
Member

Choose a reason for hiding this comment

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

The benefit of this is that the feedback widget is guaranteed to work when the user interacts with it.

We might want to rephrase this, it won't "work" in terms of sending the feedback if the user has adblock.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to:

The benefit of this is that the feedback widget is guaranteed to open when the user interacts with it, but in either case network connectivity is required to send the feedback message.

Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
Copy link
Contributor

@lizokm lizokm left a comment

Choose a reason for hiding this comment

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

Left a few suggestions, otherwise this looks good to me, thanks for adding!

ryan953 and others added 2 commits May 29, 2024 09:47
…ndex.mdx

Co-authored-by: Liza Mock <liza.mock@sentry.io>
Co-authored-by: Liza Mock <liza.mock@sentry.io>
@ryan953 ryan953 merged commit 4e1061b into master May 29, 2024
@ryan953 ryan953 deleted the ryan953/70862-async-loading branch May 29, 2024 17:37
matejminar pushed a commit that referenced this pull request Jun 6, 2024
#10108)

* docs(feedback): Add notes about async loading

* review notes

* tweak copy

* Apply suggestions from code review

Co-authored-by: Francesco Novy <francesco.novy@sentry.io>

* Update docs/platforms/javascript/common/user-feedback/configuration/index.mdx

Co-authored-by: Liza Mock <liza.mock@sentry.io>

* Apply suggestions from code review

Co-authored-by: Liza Mock <liza.mock@sentry.io>

---------

Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
Co-authored-by: Liza Mock <liza.mock@sentry.io>
a-hariti pushed a commit that referenced this pull request Jun 8, 2024
#10108)

* docs(feedback): Add notes about async loading

* review notes

* tweak copy

* Apply suggestions from code review

Co-authored-by: Francesco Novy <francesco.novy@sentry.io>

* Update docs/platforms/javascript/common/user-feedback/configuration/index.mdx

Co-authored-by: Liza Mock <liza.mock@sentry.io>

* Apply suggestions from code review

Co-authored-by: Liza Mock <liza.mock@sentry.io>

---------

Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
Co-authored-by: Liza Mock <liza.mock@sentry.io>
@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants