GeezerVison is showing github.com — feat(gatsby): Add optional `deleteSourcemapsAfterUpload` by julianCast · Pull Request #13610 · getsentry/sentry-javascript
Conversation
julianCast
commented
Sep 6, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@getsentry/team-web-sdk-frontend what does everything think about exposing the API like this?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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'],
},
},
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I've modified this work by using a boolean deleteSourcemapsAfterUpload option to avoid API exposing.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
lforst
changed the title
feat(gatsby): Add optional filesToDeleteAfterUpload
feat(gatsby): Add optional deleteSourcemapsAfterUpload
Sep 19, 2024
julianCast reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1 more reviewer
lforst
lforst approved these changes
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|