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 filesToDeleteAfterUpload #13610

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

julianCast
Copy link

@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
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
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!

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