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

fix(webpack): Ensure process exits when done #653

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jan 13, 2025

This PR is heavily inspired by unjs/unplugin#323 (comment) where the suggestion is made to exit the process in the done hook of the webpack compiler. We have multiple reports of our webpack plugin stalling angular builds. This came up again recently so I thought we could give this fix a try.

Full disclosure: I cannot reproduce the stall posted in #345, but from my limited local testing, this at least doesn't seem to break anything. However, exiting the process is still scary, so not sure if we should really do it. I guess with TanStack, there's at least precedence for this.

Reviewers - WDYT?

@Lms24
Copy link
Member Author

Lms24 commented Jan 13, 2025

Probably related: https://stackoverflow.com/a/74368627

@smeubank
Copy link
Member

if this gets merged let's update the related customer case

Copy link
Member

@andreiborza andreiborza left a comment

Choose a reason for hiding this comment

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

I'd say let's try, just concerned if user have plugins running after ours but since we specifically instruct users to add the bundler plugin as last plugin it should be fine.

@Lms24
Copy link
Member Author

Lms24 commented Jan 14, 2025

okay sgtm. We can always revert!

@Lms24 Lms24 merged commit e729f02 into main Jan 14, 2025
18 checks passed
@Lms24 Lms24 deleted the lms/fix-webpack-exit-process branch January 14, 2025 17:43
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jan 15, 2025
| datasource | package             | from   | to    |
| ---------- | ------------------- | ------ | ----- |
| npm        | @sentry/vite-plugin | 2.23.0 | 3.0.0 |


## [v3.0.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#300)

##### Breaking Changes

-   Injected code will now use `let`, which was added in ES6 (ES2015).
    This means that ES6 is the minimum JavaScript version that the Sentry bundler plugins support.

-   Deprecated options have been removed:
    -   `deleteFilesAfterUpload` - Use `filesToDeleteAfterUpload` instead
    -   `bundleSizeOptimizations.excludePerformanceMonitoring` - Use `bundleSizeOptimizations.excludeTracing` instead
    -   `_experiments.moduleMetadata` - Use `moduleMetadata` instead
    -   `cleanArtifacts` - Did not do anything

##### List of Changes

-   fix!: Wrap injected code in block-statement to contain scope ([#646](getsentry/sentry-javascript-bundler-plugins#646))
-   chore!: Remove deprecated options ([#654](getsentry/sentry-javascript-bundler-plugins#654))
-   feat(logger): Use console methods respective to log level ([#652](getsentry/sentry-javascript-bundler-plugins#652))
-   fix(webpack): Ensure process exits when done ([#653](getsentry/sentry-javascript-bundler-plugins#653))
-   fix: Use correct replacement matcher for `bundleSizeOptimizations.excludeTracing` ([#644](getsentry/sentry-javascript-bundler-plugins#644))

Work in this release contributed by [@jdelStrother](https://github.com/jdelStrother). Thank you for your contribution!
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jan 15, 2025
| datasource | package             | from   | to    |
| ---------- | ------------------- | ------ | ----- |
| npm        | @sentry/vite-plugin | 2.23.0 | 3.0.0 |


## [v3.0.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#300)

##### Breaking Changes

-   Injected code will now use `let`, which was added in ES6 (ES2015).
    This means that ES6 is the minimum JavaScript version that the Sentry bundler plugins support.

-   Deprecated options have been removed:
    -   `deleteFilesAfterUpload` - Use `filesToDeleteAfterUpload` instead
    -   `bundleSizeOptimizations.excludePerformanceMonitoring` - Use `bundleSizeOptimizations.excludeTracing` instead
    -   `_experiments.moduleMetadata` - Use `moduleMetadata` instead
    -   `cleanArtifacts` - Did not do anything

##### List of Changes

-   fix!: Wrap injected code in block-statement to contain scope ([#646](getsentry/sentry-javascript-bundler-plugins#646))
-   chore!: Remove deprecated options ([#654](getsentry/sentry-javascript-bundler-plugins#654))
-   feat(logger): Use console methods respective to log level ([#652](getsentry/sentry-javascript-bundler-plugins#652))
-   fix(webpack): Ensure process exits when done ([#653](getsentry/sentry-javascript-bundler-plugins#653))
-   fix: Use correct replacement matcher for `bundleSizeOptimizations.excludeTracing` ([#644](getsentry/sentry-javascript-bundler-plugins#644))

Work in this release contributed by [@jdelStrother](https://github.com/jdelStrother). Thank you for your contribution!
alexandresoro pushed a commit to alexandresoro/ouca-web that referenced this pull request Jan 16, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@sentry/vite-plugin](https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/vite-plugin) ([source](https://github.com/getsentry/sentry-javascript-bundler-plugins)) | devDependencies | major | [`2.23.0` -> `3.0.0`](https://renovatebot.com/diffs/npm/@sentry%2fvite-plugin/2.23.0/3.0.0) |

---

### Release Notes

<details>
<summary>getsentry/sentry-javascript-bundler-plugins (@&#8203;sentry/vite-plugin)</summary>

### [`v3.0.0`](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#300)

[Compare Source](getsentry/sentry-javascript-bundler-plugins@2.23.0...3.0.0)

##### Breaking Changes

-   Injected code will now use `let`, which was added in ES6 (ES2015).
    This means that ES6 is the minimum JavaScript version that the Sentry bundler plugins support.

-   Deprecated options have been removed:
    -   `deleteFilesAfterUpload` - Use `filesToDeleteAfterUpload` instead
    -   `bundleSizeOptimizations.excludePerformanceMonitoring` - Use `bundleSizeOptimizations.excludeTracing` instead
    -   `_experiments.moduleMetadata` - Use `moduleMetadata` instead
    -   `cleanArtifacts` - Did not do anything

##### List of Changes

-   fix!: Wrap injected code in block-statement to contain scope ([#&#8203;646](getsentry/sentry-javascript-bundler-plugins#646))
-   chore!: Remove deprecated options ([#&#8203;654](getsentry/sentry-javascript-bundler-plugins#654))
-   feat(logger): Use console methods respective to log level ([#&#8203;652](getsentry/sentry-javascript-bundler-plugins#652))
-   fix(webpack): Ensure process exits when done ([#&#8203;653](getsentry/sentry-javascript-bundler-plugins#653))
-   fix: Use correct replacement matcher for `bundleSizeOptimizations.excludeTracing` ([#&#8203;644](getsentry/sentry-javascript-bundler-plugins#644))

Work in this release contributed by [@&#8203;jdelStrother](https://github.com/jdelStrother). Thank you for your contribution!

</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 this update 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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: https://git.tristess.app/alexandresoro/ouca-web/pulls/21
Reviewed-by: Alexandre Soro <[email protected]>
Co-authored-by: renovate <[email protected]>
Co-committed-by: renovate <[email protected]>
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jan 17, 2025
| datasource | package             | from   | to    |
| ---------- | ------------------- | ------ | ----- |
| npm        | @sentry/vite-plugin | 2.23.0 | 3.0.0 |


## [v3.0.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#300)

##### Breaking Changes

-   Injected code will now use `let`, which was added in ES6 (ES2015).
    This means that ES6 is the minimum JavaScript version that the Sentry bundler plugins support.

-   Deprecated options have been removed:
    -   `deleteFilesAfterUpload` - Use `filesToDeleteAfterUpload` instead
    -   `bundleSizeOptimizations.excludePerformanceMonitoring` - Use `bundleSizeOptimizations.excludeTracing` instead
    -   `_experiments.moduleMetadata` - Use `moduleMetadata` instead
    -   `cleanArtifacts` - Did not do anything

##### List of Changes

-   fix!: Wrap injected code in block-statement to contain scope ([#646](getsentry/sentry-javascript-bundler-plugins#646))
-   chore!: Remove deprecated options ([#654](getsentry/sentry-javascript-bundler-plugins#654))
-   feat(logger): Use console methods respective to log level ([#652](getsentry/sentry-javascript-bundler-plugins#652))
-   fix(webpack): Ensure process exits when done ([#653](getsentry/sentry-javascript-bundler-plugins#653))
-   fix: Use correct replacement matcher for `bundleSizeOptimizations.excludeTracing` ([#644](getsentry/sentry-javascript-bundler-plugins#644))

Work in this release contributed by [@jdelStrother](https://github.com/jdelStrother). Thank you for your contribution!
@lesderid
Copy link

This is breaking my build on Next.js 15.

@lforst
Copy link
Member

lforst commented Jan 20, 2025

@lesderid please open an issue with reproduction steps. Thanks!

@getsentry getsentry locked and limited conversation to collaborators Jan 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants