sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

makeBrowserOfflineTransport() in CDN Bundle

Open RobinJesba opened this issue 1 year ago • 5 comments

Problem Statement

We are using the Loader Script - bundle.tracing.min.js CDN bundle to initialize Sentry. However, we noticed that makeBrowserOfflineTransport is not supported.

https://docs.sentry.io/platforms/javascript/configuration/transports/

As we are not using any module bundler for our application, we cannot use the NPM package for Sentry.

Solution Brainstorm

Create a CDN bundle for Error Monitoring, Performance Monitoring, and Offline Caching.

RobinJesba avatar Apr 12 '24 06:04 RobinJesba

Hello,

we are unlikely to add another bundle variant, as that will end up with an endless list of combinations that we cannot properly support/maintain. Instead, we could possibly publish the offline transport as a separate pluggable CDN bundle. We'll put this on the backlog, as we are currently pretty swamped with other tasks. For the time being, it's probably best if you copy the offline transport code into your app and use it from there!

mydea avatar Apr 12 '24 07:04 mydea

Hi @mydea , could you please assist by sharing the steps for achieving this? It would be greatly appreciated if you could provide the code required to enable offline transport in our app.

RobinJesba avatar Apr 12 '24 12:04 RobinJesba

You can take the code from here: https://github.com/getsentry/sentry-javascript/blob/develop/packages/browser/src/transports/offline.ts, and use that. But that requires you to build this out with npm, realistically, as you need to depend on @sentry/core & @sentry/utils.

You can also build this once with a bundler (e.g. webpack or rollup) and put the file on a CDN yourself, and reference this!

mydea avatar Apr 15 '24 09:04 mydea

You can take the code from here: https://github.com/getsentry/sentry-javascript/blob/develop/packages/browser/src/transports/offline.ts, and use that. But that requires you to build this out with npm, realistically, as you need to depend on @sentry/core & @sentry/utils.

You can also build this once with a bundler (e.g. webpack or rollup) and put the file on a CDN yourself, and reference this!

Awesome, Thanks for your help @mydea !

RobinJesba avatar Apr 15 '24 15:04 RobinJesba

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar May 16 '24 07:05 getsantry[bot]