Skip to content

Conversation

@mattcosta7
Copy link
Contributor

@mattcosta7 mattcosta7 commented Dec 16, 2025

Closes https://github.com/github/primer/issues/6267

Adds a neat performance panel for catching metrics in storybook while developing

Screen.Recording.2025-12-15.at.7.46.56.PM.mov

Changelog

storybook only

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Storybook only

Testing & Reviewing

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Dec 16, 2025

⚠️ No Changeset found

Latest commit: dfd17a3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@mattcosta7 mattcosta7 changed the title publish storybook perf panel Adds performance panel to storybook Dec 16, 2025
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Dec 16, 2025
@mattcosta7 mattcosta7 self-assigned this Dec 16, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7345 December 16, 2025 00:53 Inactive
@mattcosta7 mattcosta7 marked this pull request as ready for review December 16, 2025 00:58
@mattcosta7 mattcosta7 requested a review from a team as a code owner December 16, 2025 00:58
Copy link
Contributor

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 a performance monitoring panel to Storybook for tracking component metrics during development. The change is development-only and doesn't affect the production build of the component library.

Key Changes:

  • Adds @github-ui/storybook-addon-performance-panel package (v0.1.1) as a dev dependency
  • Integrates the addon into the Storybook configuration

Reviewed changes

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

File Description
packages/react/.storybook/main.ts Adds the performance panel addon to the Storybook addons array
package.json Adds the addon package as a dev dependency in alphabetically sorted order
package-lock.json Updates lock file with the new dependency and its peer dependencies; includes version bumps to @primer/react from 38.5.0 to 38.6.1 in example applications

getAbsolutePath('@storybook/addon-a11y'),
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-docs'),
'@github-ui/storybook-addon-performance-panel',
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The addon is not using the getAbsolutePath() helper function like the other Storybook addons on lines 20-22. This is inconsistent with the established pattern in this configuration file. Consider wrapping it with getAbsolutePath() for consistency.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

getAbolute seems to fail fo rhtis - not sure why - are they needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the reason is that storybook looks for manager.js or preview.js or preset.js at the package root (https://github.com/storybookjs/storybook/blob/main/code/core/src/common/presets.ts#L81)

If the storybook-addon-performance-panel re-exports one of them at the package root, getAbsolutePath() would work. But I think using just '@github-ui/storybook-addon-performance-panel' should be fine.

package.json Outdated
"@github/markdownlint-github": "^0.8.0",
"@github/mini-throttle": "2.1.1",
"@github/prettier-config": "0.0.6",
"@github-ui/storybook-addon-performance-panel": "0.1.1",
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

There is a peer dependency version mismatch. The addon requires @storybook/icons version exactly 1.4.0 (as seen in package-lock.json line 4712), but the project currently has version 2.0.1 installed (package-lock.json line 8213-8214). This version mismatch may cause runtime errors or compatibility issues. You should either:

  1. Update the addon to a version that supports @storybook/icons 2.x, or
  2. Downgrade @storybook/icons to 1.4.0 (though this may affect other dependencies)

Please verify that the addon works correctly with the installed version of @storybook/icons.

Suggested change
"@github-ui/storybook-addon-performance-panel": "0.1.1",
"@github-ui/storybook-addon-performance-panel": "^0.2.0",

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

@mattcosta7 would it be possible to make the @storybook/icons version flexible in the addon?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, yep shouldn't be a problem, i'll try to push a new version

@francinelucca francinelucca added the skip changeset This change does not need a changelog label Dec 16, 2025
Copy link
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

🚀

@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/9382

@primer-integration
Copy link

🔬 github-ui Integration Test Results

Check Status Details
CI ⏳ Pending Waiting for workflow to complete
Projects (Memex) ✅ Passed View run
VRT ✅ Passed View run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants