Add guide for web workers.#3562
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/sentry/sentry-docs/BKSytNwnRkFvLuiEA5dRg17PfBxN |
|
Minor smoothing - looks good. Thanks, @onurtemizkan |
Co-authored-by: Fiona <61481573+PeloWriter@users.noreply.github.com>
|
@PeloWriter do you think this fits in as a guide in the structure? The way I understand it this is just a particular environment where one may use the regular JavaScript browser SDK, we use guides for frameworks and custom SDKs. |
|
Ah, I had understood it was a guide - a framework or custom SDK, as you note. Since it's an environment that's available for all the JS SDK family, I'd suggest we maintain it configuration content. @onurtemizkan - if you and @rhcarvalho agree, let's make this part of javascript/common/configuration |
|
Thanks, @PeloWriter, @rhcarvalho. I moved it to javascript/common/configuration. Is there a specific format to follow in that part, or could we keep this in guide format? |
|
The format looks fine to me. For configuration, we generally introduce what can be configured, then provide code samples. |
|
I'd start putting this content out for the browser SDK only, not any variants, thus not common content. Not until we validate it works and makes sense for all places the common content goes into. |
|
In that case, we can keep this where it is, just adjust the yaml frontmatter to list the SDKs/guides for which Web Workers isn't supported. That way, as support expands, there's no need to move the content - we'll just remove the SDK/guide from the list of notSupported. @onurtemizkan - here's an example of how that looks in the yaml frontmatter: |
|
@PeloWriter, @rhcarvalho I'm currently investigating possible workarounds for currently unsupported functionality. When I get confirmation/validation for a feasible approach, I'll update the PR to cover it. |
|
Thanks for the update, @onurtemizkan. Do you want to turn this to a draft until then? |
|
Yes, @PeloWriter. Thanks. |
|
Added examples of per-worker initialization. It's ready for review. |
Co-authored-by: Fiona <61481573+PeloWriter@users.noreply.github.com>
Co-authored-by: Fiona <61481573+PeloWriter@users.noreply.github.com>
rhcarvalho
left a comment
There was a problem hiding this comment.
Almost ready, I'd suggest using an explicit list of supported platforms instead of using notSupported
| description: "Learn how to use Sentry's Browser SDK in Web Workers API." | ||
| keywords: ["webworkers"] | ||
| sidebar_order: 9000 | ||
| notSupported: |
There was a problem hiding this comment.
This should be a positive filter with supported: ... so it is only shown for the browser SDK (did we want it anywhere else?)
Because we'll not remember to change this list when adding new JS-based SDKs where this content would not fit.
There was a problem hiding this comment.
@rhcarvalho, I added the supported tag with javascript (for browser, I could not find a specific selector for browser), I'm not sure if that's necessary as this file is under javascript's common content.
Still had to keep notSupported unfortunately to prevent this doc from showing up in SDKs, as they all are falling back to javascript.
There was a problem hiding this comment.
Hmm yeah the supported filter implies all guides too 😢 .
@PeloWriter do you know of an existing solution for this particular case?
Can we show some content only for JavaScript Browser (and not Angular, Cordova, Ember, React, Vue, etc) without having to list all guides in the notSupported filter? My point was that the not supported list here should be "everything except browser" and it is hard to keep that up-to-date.
There was a problem hiding this comment.
Sadly, no workaround yet exists. If the content displays for the primary platform, the only way to turn it off for the associated frameworks is to individually list them as notSupported.
This would be another valuable use of the release registry as a source of truth - it would prevent manual management that is hard to keep up to date.
There was a problem hiding this comment.
What if we don't put this under common/?
There must be a way, in the worst case we can add a new flag includeInGuides: false or similar.
Since this is not intended to be shared, putting it outside of common content would be an easier start.
There was a problem hiding this comment.
I'll consider it's better to ship as is today than to block on this discussion.
Co-authored-by: Rodolfo Carvalho <rhcarvalho@gmail.com>
| description: "Learn how to use Sentry's Browser SDK in Web Workers API." | ||
| keywords: ["webworkers"] | ||
| sidebar_order: 9000 | ||
| notSupported: |
There was a problem hiding this comment.
I'll consider it's better to ship as is today than to block on this discussion.
Adds simple documentation on Web Workers support.