Skip to content

feat: add telemetry support for Storybook configuration#893

Merged
dannyhw merged 5 commits into
nextfrom
add-telemetry
Jun 2, 2026
Merged

feat: add telemetry support for Storybook configuration#893
dannyhw merged 5 commits into
nextfrom
add-telemetry

Conversation

@ndelangen
Copy link
Copy Markdown
Member

  • Introduced telemetry functionality in withStorybook for React Native.
  • Added environment variable to disable telemetry.
  • Unified telemetry event handling across different Storybook configurations.

Issue:

What I did

How to test

Please explain how to test your changes and consider the following questions

  • Does this need a new example in examples/expo-example?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

- Introduced telemetry functionality in withStorybook for React Native.
- Added environment variable to disable telemetry.
- Unified telemetry event handling across different Storybook configurations.
Copilot AI review requested due to automatic review settings May 29, 2026 12:36
@ndelangen ndelangen requested a review from dannyhw as a code owner May 29, 2026 12:36
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

🦋 Changeset detected

Latest commit: a1bcf1b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@storybook/react-native Patch
@storybook/react-native-ui Patch
@storybook/react-native-ui-lite Patch
@storybook/react-native-ui-common Patch
@storybook/react-native-theming Patch
@storybook/addon-ondevice-actions Patch
@storybook/addon-ondevice-backgrounds Patch
@storybook/addon-ondevice-controls Patch
@storybook/addon-ondevice-notes Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds telemetry calls to React Native Storybook configuration entry points and standardizes the emitted telemetry event.

Changes:

  • Adds telemetry emission to the unified withStorybook wrapper.
  • Adds telemetry emission to the Repack/Rspack StorybookPlugin.
  • Changes Metro telemetry to always emit the unified 'dev' event.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/react-native/src/withStorybook.ts Adds telemetry gating via STORYBOOK_DISABLE_TELEMETRY in the unified wrapper.
packages/react-native/src/repack/withStorybook.ts Adds telemetry support to the Repack/Rspack plugin path.
packages/react-native/src/metro/withStorybook.ts Updates Metro telemetry to always send the unified 'dev' event.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/react-native/src/withStorybook.ts
Comment thread packages/react-native/src/repack/withStorybook.ts
Comment thread packages/react-native/src/metro/withStorybook.ts
ndelangen added 3 commits May 29, 2026 14:40
- Introduced telemetry functionality when on-device Storybook is enabled.
- Added an option to opt-out via the `STORYBOOK_DISABLE_TELEMETRY` environment variable.
- Telemetry is managed through the unified `withStorybook` wrapper and the Re.Pack plugin.
- Introduced a mock for the telemetry module in the withStorybook test file to ensure proper testing of telemetry functionality.
@ndelangen ndelangen requested a review from shilman May 29, 2026 12:45
@ndelangen ndelangen self-assigned this May 29, 2026
@dannyhw dannyhw merged commit cd00a0c into next Jun 2, 2026
1 check passed
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