Telemetry: Improve dev cancellation handling#32218
Merged
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit 525e532
☁️ Nx Cloud last updated this comment at |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 198 | 198 | 0 |
| Self size | 80 KB | 80 KB | 0 B |
| Dependency size | 31.37 MB | 31.38 MB | 🚨 +14 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 51 | 51 | 0 |
| Self size | 41.74 MB | 41.75 MB | 🚨 +15 KB 🚨 |
| Dependency size | 18.13 MB | 18.13 MB | 0 B |
| Bundle Size Analyzer | Link | Link |
@storybook/angular
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 198 | 198 | 0 |
| Self size | 192 KB | 191 KB | 🎉 -445 B 🎉 |
| Dependency size | 29.57 MB | 29.59 MB | 🚨 +14 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/ember
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 203 | 203 | 0 |
| Self size | 28 KB | 28 KB | 0 B |
| Dependency size | 28.10 MB | 28.11 MB | 🚨 +14 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 538 | 538 | 0 |
| Self size | 903 KB | 903 KB | 0 B |
| Dependency size | 59.12 MB | 59.13 MB | 🚨 +14 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 130 | 130 | 0 |
| Self size | 3.08 MB | 3.08 MB | 0 B |
| Dependency size | 22.28 MB | 22.29 MB | 🚨 +14 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 163 | 163 | 0 |
| Self size | 32 KB | 32 KB | 0 B |
| Dependency size | 23.66 MB | 23.68 MB | 🚨 +14 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 120 | 120 | 0 |
| Self size | 32 KB | 32 KB | 0 B |
| Dependency size | 20.23 MB | 20.24 MB | 🚨 +14 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 286 | 286 | 0 |
| Self size | 25 KB | 25 KB | 0 B |
| Dependency size | 43.69 MB | 43.70 MB | 🚨 +14 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/server-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 210 | 210 | 0 |
| Self size | 17 KB | 17 KB | 0 B |
| Dependency size | 32.64 MB | 32.65 MB | 🚨 +14 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
sb
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 52 | 52 | 0 |
| Self size | 1 KB | 1 KB | 0 B |
| Dependency size | 59.87 MB | 59.89 MB | 🚨 +15 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 220 | 220 | 0 |
| Self size | 585 KB | 585 KB | 🎉 -18 B 🎉 |
| Dependency size | 104.36 MB | 104.39 MB | 🚨 +29 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 189 | 189 | 0 |
| Self size | 31 KB | 31 KB | 0 B |
| Dependency size | 88.44 MB | 88.47 MB | 🚨 +29 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/preset-react-webpack
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 177 | 177 | 0 |
| Self size | 24 KB | 24 KB | 0 B |
| Dependency size | 30.51 MB | 30.53 MB | 🚨 +14 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
yannbf
approved these changes
Aug 8, 2025
This was referenced Aug 8, 2025
Merged
yannbf
pushed a commit
that referenced
this pull request
Aug 11, 2025
Telemetry: Improve dev cancellation handling (cherry picked from commit a65cd6b)
This was referenced Aug 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes N/A
What I did
Fix for #32168. The previous PR works when you run the process directly in node and cancel out with the keyboard. However, when you run through an outer process like
nr storybookit does not get theSIGINTsignal. This attempts to fix that case.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
STORYBOOK_TELEMETRY_DEBUG=1 nr storybookcanceledevent is sent.🦋 Canary release
This pull request has been released as version
0.0.0-pr-32218-sha-525e5323. Try it out in a new sandbox by runningnpx storybook@0.0.0-pr-32218-sha-525e5323 sandboxor in an existing project withnpx storybook@0.0.0-pr-32218-sha-525e5323 upgrade.More information
0.0.0-pr-32218-sha-525e5323shilman/fix-cancel-telemetry525e53231754618845)To request a new release of this pull request, mention the
@storybookjs/coreteam.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=32218Greptile Summary
This PR adds SIGTERM signal handling to improve telemetry cancellation when Storybook is terminated through wrapper processes. The change is minimal but important - it adds a single line in
code/core/src/core-server/dev-server.tsthat registers the existingcancelTelemetryfunction to handle SIGTERM signals alongside the existing SIGINT handler.The core issue being addressed is that when Storybook runs through process managers or wrapper commands like
nr storybook, the SIGINT signal (typically sent by Ctrl-C) doesn't always propagate properly to the Node.js process. SIGTERM is the standard termination signal used by most process managers and container orchestrators for graceful shutdowns. By adding SIGTERM handling, the PR ensures telemetry data is properly sent even when Storybook is terminated through these wrapper processes.This change integrates seamlessly with the existing signal handling architecture in Storybook's development server. The implementation follows the same pattern as the SIGINT handler, maintaining consistency in the codebase and ensuring that the same telemetry cleanup process runs regardless of which termination signal is received.
Confidence score: 5/5