Repository navigation
Telemetry: Track StyleX as a styling package - #36091
Merged
Merged
Conversation
Adds `@stylexjs/*` to `STYLING_PACKAGES`, so StyleX shows up in the `stylingPackages` telemetry group next to Tailwind, Emotion and styled-components. The same list feeds `categorize-render-errors`, so preview render errors originating from StyleX are now bucketed as styling-related.
valentinpalkovic
marked this pull request as ready for review
August 31, 2026 08:20
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughChangesStyleX package classification
Merge Risk: ⚪ Minimal · up to This localized change adds StyleX package detection to styling telemetry and error categorization, with unit-test coverage; no actionable merge-blocking risk remains beyond normal checks and review. ✨ Finishing Touches📝 Generate docstrings
Comment |
shilman
approved these changes
Aug 31, 2026
2 tasks done
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 #
What I did
We report Tailwind, Emotion and styled-components in the
stylingPackagestelemetry group today, but a project using StyleX reports nothing at all. StyleX is Meta's compiler-based CSS-in-JS library, and adoption has picked up noticeably lately (Linear and Cursor both migrated to it), so we are currently blind to it. This PR adds the detection, as the first step towards a StyleX recipe linked from@storybook/addon-themes.The whole production change is one entry:
// code/core/src/shared/utils/ecosystem-identifier.ts 'styled-components', + '@stylexjs/*', 'bootstrap',STYLING_PACKAGEShas two consumers, so both pick StyleX up from that single entry:The second consumer is worth calling out explicitly: a preview render error whose stack touches
@stylexjs/*is now categorized as styling-related. That is intentional, though. It is exactly the treatment every other entry in that list already gets.Before and after, for the four
@stylexjspackages a real StyleX project pulls in:And the resulting telemetry group, captured from
analyzeEcosystemPackagesagainst a StyleX-flavoredpackage.json:{ "stylingPackages": { "@stylexjs/stylex": "^0.15.4", "@stylexjs/postcss-plugin": "^0.15.4", "@stylexjs/babel-plugin": "^0.15.4", "postcss": "^8.5.6" } }Why the scope glob, and nothing else
@stylexjs/stylexis the runtime that every StyleX project imports from, hence the scope glob alone already gives us complete adoption detection, and it picks upbabel-plugin,postcss-plugin,nextjs-pluginandopen-propsfor free.I deliberately left out the third-party integrations (
@stylexswc/*,vite-plugin-stylex). Projects using those still depend on@stylexjs/stylex, so we lose no adoption signal, only a bundler-integration detail we have no use for today. Happy to add them if we decide we want that breakdown, though.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
code/core/src/telemetry/get-known-packages.test.tsnow asserts that both a runtime package and a plugin package land instylingPackages, so the glob is covered in both shapes:Manual testing
Caution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
yarn task sandbox --template react-vite/default-ts --start-from autocd ../storybook-sandboxes/react-vite-default-tsand add the StyleX runtime:yarn add @stylexjs/stylexSTORYBOOK_TELEMETRY_DEBUG=1 yarn storybook[telemetry]line and the JSON payload printed right after itmetadata.knownPackages.stylingPackagescontains"@stylexjs/stylex". Onnextthat entry is absent for the same project.Documentation
MIGRATION.MD
No docs change here. This is internal instrumentation with no user-facing surface. The user-facing part is the StyleX recipe and the
@storybook/addon-themeslink, which will follow in a separate PR.Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>