Skip to content

feat(browser): Make fetch the default transport for offline#11209

Merged
AbhiPrasad merged 2 commits intodevelopfrom
timfish/offline-defaults
Mar 21, 2024
Merged

feat(browser): Make fetch the default transport for offline#11209
AbhiPrasad merged 2 commits intodevelopfrom
timfish/offline-defaults

Conversation

@timfish
Copy link
Copy Markdown
Collaborator

@timfish timfish commented Mar 20, 2024

Now we only have one included transport, this simplifies the vast majority of use cases:

Before:

import { init, makeBrowserOfflineTransport, makeFetchTransport } from "@sentry/browser";

init({
  dsn: "__DSN__",
  transport: makeBrowserOfflineTransport(makeFetchTransport)
})

After:

import { init, makeBrowserOfflineTransport } from "@sentry/browser";

init({
  dsn: "__DSN__",
  transport: makeBrowserOfflineTransport()
})

@github-actions

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Can you write an entry in MIGRATION.md?

@timfish
Copy link
Copy Markdown
Collaborator Author

timfish commented Mar 21, 2024

I don't think this needs to be in MIGRATION.md because the parameter is still there, it just has a default now. The previous code will continue to work.

@AbhiPrasad AbhiPrasad merged commit 523b006 into develop Mar 21, 2024
@AbhiPrasad AbhiPrasad deleted the timfish/offline-defaults branch March 21, 2024 15:42
cadesalaberry pushed a commit to cadesalaberry/sentry-javascript that referenced this pull request Apr 19, 2024
…y#11209)

Now we only have one included transport, this simplifies the vast
majority of use cases:

Before:
```ts
import { init, makeBrowserOfflineTransport, makeFetchTransport } from "@sentry/browser";

init({
  dsn: "__DSN__",
  transport: makeBrowserOfflineTransport(makeFetchTransport)
})
```

After:
```ts
import { init, makeBrowserOfflineTransport } from "@sentry/browser";

init({
  dsn: "__DSN__",
  transport: makeBrowserOfflineTransport()
})
```
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.

2 participants