Skip to content
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

feat(gatsby): Add optional deleteSourcemapsAfterUpload #13610

Merged
merged 9 commits into from
Sep 19, 2024

Conversation

julianCast
Copy link
Contributor

@julianCast julianCast commented Sep 6, 2024

Related #13582
This work adds the deleteSourcemapsAfterUpload option to the Gatsby plugin, allowing it to be passed to the Webpack plugin to set the sourceMapFilesToDeleteAfterUpload without exposing the API.

This simplifies our workflow by eliminating the need to apply a Yarn patch to modify the package whenever we want to use filesToDeleteAfterUpload.

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

@AbhiPrasad
Copy link
Member

@getsentry/team-web-sdk-frontend what does everything think about exposing the API like this?

@s1gr1d
Copy link
Member

s1gr1d commented Sep 9, 2024

I would align the API with the other SDKs. The other SDKs have it mostly like this:

      sourceMapsUploadOptions: {
        sourcemaps: {
          assets: ['foo/*.js'],
          ignore: ['bar/*.js'],
          filesToDeleteAfterUpload: ['baz/*.js'],
        },
      },

@lforst
Copy link
Member

lforst commented Sep 9, 2024

I would align the API with the other SDKs. The other SDKs have it mostly like this:

      sourceMapsUploadOptions: {
        sourcemaps: {
          assets: ['foo/*.js'],
          ignore: ['bar/*.js'],
          filesToDeleteAfterUpload: ['baz/*.js'],
        },
      },

I actually think the way we have structured this is suboptimal. Gave the same feedback here: #13493

sourcemaps as a key inside sourceMapsUploadOptions makes little sense. I would generally try to avoid exposing the API at all when the framework gives a default (like in the case of Gatsby) and then have a simple boolean deleteSourcemapsAfterUpload: true as a top-level option instead.

All other options should be accessible over an experimental_webpackPluginOptions option or something like that.

@julianCast
Copy link
Contributor Author

I would generally try to avoid exposing the API at all when the framework gives a default (like in the case of Gatsby) and then have a simple boolean deleteSourcemapsAfterUpload: true as a top-level option instead.

I could pass deleteSourcemapsAfterUpload as boolean option, that would be consistent with the existent option enableClientWebpackPlugin

@julianCast
Copy link
Contributor Author

I've modified this work by using a boolean deleteSourcemapsAfterUpload option to avoid API exposing.

Copy link
Member

@lforst lforst left a comment

Choose a reason for hiding this comment

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

Thanks!

@lforst lforst changed the title feat(gatsby): Add optional filesToDeleteAfterUpload feat(gatsby): Add optional deleteSourcemapsAfterUpload Sep 19, 2024
@lforst lforst merged commit fc7634e into getsentry:develop Sep 19, 2024
124 checks passed
@julianCast julianCast deleted the filesToDeleteAfterUpload-opt branch September 19, 2024 11:28
AbhiPrasad added a commit that referenced this pull request Sep 19, 2024
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #13610

---------

Co-authored-by: lforst <8118419+lforst@users.noreply.github.com>
Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
@AbhiPrasad
Copy link
Member

This was released with https://github.com/getsentry/sentry-javascript/releases/tag/8.31.0 - thanks for the PR @julianCast!

alexandresoro pushed a commit to alexandresoro/ouca that referenced this pull request Sep 23, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@sentry/node](https://github.com/getsentry/sentry-javascript/tree/master/packages/node) ([source](https://github.com/getsentry/sentry-javascript)) | dependencies | minor | [`8.30.0` -> `8.31.0`](https://renovatebot.com/diffs/npm/@sentry%2fnode/8.30.0/8.31.0) |
| [@sentry/react](https://github.com/getsentry/sentry-javascript/tree/master/packages/react) ([source](https://github.com/getsentry/sentry-javascript)) | dependencies | minor | [`8.30.0` -> `8.31.0`](https://renovatebot.com/diffs/npm/@sentry%2freact/8.30.0/8.31.0) |

---

### Release Notes

<details>
<summary>getsentry/sentry-javascript (@&#8203;sentry/node)</summary>

### [`v8.31.0`](https://github.com/getsentry/sentry-javascript/blob/HEAD/CHANGELOG.md#8310)

[Compare Source](getsentry/sentry-javascript@8.30.0...8.31.0)

##### Important Changes

-   **feat(node): Add `dataloader` integration ([#&#8203;13664](getsentry/sentry-javascript#13664

This release adds a new integration for the [`dataloader` package](https://www.npmjs.com/package/dataloader). The Node
SDK (and all SDKs that depend on it) will now automatically instrument `dataloader` instances. You can also add it
manually:

```js
Sentry.init({
  integrations: [Sentry.dataloaderIntegration()],
});
```

##### Other Changes

-   feat(browser): Add navigation `activationStart` timestamp to pageload span ([#&#8203;13658](getsentry/sentry-javascript#13658))
-   feat(gatsby): Add optional `deleteSourcemapsAfterUpload` ([#&#8203;13610](getsentry/sentry-javascript#13610))
-   feat(nextjs): Give app router prefetch requests a `http.server.prefetch` op ([#&#8203;13600](getsentry/sentry-javascript#13600))
-   feat(nextjs): Improve Next.js serverside span data quality ([#&#8203;13652](getsentry/sentry-javascript#13652))
-   feat(node): Add `disableInstrumentationWarnings` option ([#&#8203;13693](getsentry/sentry-javascript#13693))
-   feat(nuxt): Adding `experimental_basicServerTracing` option to Nuxt module ([#&#8203;13643](getsentry/sentry-javascript#13643))
-   feat(nuxt): Improve logs about adding Node option 'import' ([#&#8203;13726](getsentry/sentry-javascript#13726))
-   feat(replay): Add `onError` callback + other small improvements to debugging ([#&#8203;13721](getsentry/sentry-javascript#13721))
-   feat(replay): Add experimental option to allow for a checkout every 6 minutes ([#&#8203;13069](getsentry/sentry-javascript#13069))
-   feat(wasm): Unconditionally parse instruction addresses ([#&#8203;13655](getsentry/sentry-javascript#13655))
-   fix: Ensure all logs are wrapped with `consoleSandbox` ([#&#8203;13690](getsentry/sentry-javascript#13690))
-   fix(browser): Try multiple options for `lazyLoadIntegration` script parent element lookup ([#&#8203;13717](getsentry/sentry-javascript#13717))
-   fix(feedback): Actor color applies to feedback icon ([#&#8203;13702](getsentry/sentry-javascript#13702))
-   fix(feedback): Fix form width on mobile devices ([#&#8203;13068](getsentry/sentry-javascript#13068))
-   fix(nestjs): Preserve original function name on `SentryTraced` functions ([#&#8203;13684](getsentry/sentry-javascript#13684))
-   fix(node): Don't overwrite local variables for re-thrown errors ([#&#8203;13644](getsentry/sentry-javascript#13644))
-   fix(normalize): Treat Infinity as NaN both are non-serializable numbers ([#&#8203;13406](getsentry/sentry-javascript#13406))
-   fix(nuxt): Use correct server output file path ([#&#8203;13725](getsentry/sentry-javascript#13725))
-   fix(opentelemetry): Always use active span in `Propagator.inject` ([#&#8203;13381](getsentry/sentry-javascript#13381))
-   fix(replay): Fixes potential out-of-order segments ([#&#8203;13609](getsentry/sentry-javascript#13609))

Work in this release was contributed by [@&#8203;KyGuy2002](https://github.com/KyGuy2002), [@&#8203;artzhookov](https://github.com/artzhookov), and [@&#8203;julianCast](https://github.com/julianCast). Thank you for your contributions!

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45My41IiwidXBkYXRlZEluVmVyIjoiMzguOTMuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Reviewed-on: https://git.tristess.app/alexandresoro/ouca/pulls/149
Reviewed-by: Alexandre Soro <code@soro.dev>
Co-authored-by: renovate <renovate@git.tristess.app>
Co-committed-by: renovate <renovate@git.tristess.app>
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.

4 participants