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

migrate TreeView to CSS modules #5267

Merged
merged 19 commits into from
Nov 14, 2024
Merged

migrate TreeView to CSS modules #5267

merged 19 commits into from
Nov 14, 2024

Conversation

ktravers
Copy link
Contributor

@ktravers ktravers commented Nov 12, 2024

closes https://github.com/github/primer/issues/4407

This PR migrates the TreeView component from using styled system props to CSS modules. It follows the instructions listed in the Primer React Styled Components to CSS Modules Refactoring Guide:

  • Verify VRT (Visual Regression Testing) Coverage (see existing e2e/components/TreeView.test.ts)
  • Ensure All Visual Changes Are Completed (confirmed by checking open issues related to TreeView)
  • Ensure the component accepts a className on the top DOM level only for styling from outside of primer/react
  • Ensure the component accepts a style prop for more dynamic styling like positioning
  • Add a feature flag for controlled rollout (staff shipping)
  • Ensure Component still accepts sx styling
Before After
light modes before light modes after
dark modes before dark modes after

Changelog

New

  • Adds support for style prop to TreeView component

Changed

  • Updates TreeView component to support CSS Modules (behind feature flag)
  • Fixes minor test and documentation typos

Removed

N/A

Rollout strategy

Testing & Reviewing

These changes are easier to review with whitespace changes hidden.

Merge checklist

@ktravers ktravers self-assigned this Nov 12, 2024
Copy link

changeset-bot bot commented Nov 12, 2024

🦋 Changeset detected

Latest commit: 919f426

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@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 Nov 12, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-5267 November 12, 2024 17:32 Inactive
Copy link
Contributor

github-actions bot commented Nov 12, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 99.12 KB (+0.44% 🔺)
packages/react/dist/browser.umd.js 99.46 KB (+0.35% 🔺)

As of https://github.com/primer/react/blob/fca4ec98f2e3ef5e5c3298320e3ab2050593709c/contributor-docs/adrs/adr-016-css.md,
Primer has decided to move away from using styled system props and prefers CSS for
styling over styled system props due to performance concerns with `sx` props.

See linked ADR for full details.
@github-actions github-actions bot temporarily deployed to storybook-preview-5267 November 12, 2024 19:35 Inactive
@ktravers ktravers force-pushed the ktravers/rm-sx-from-tree-view branch from 90debbb to c5fb3a7 Compare November 12, 2024 19:39
@github-actions github-actions bot temporarily deployed to storybook-preview-5267 November 12, 2024 19:41 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5267 November 12, 2024 20:01 Inactive
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copied styles directly from TreeView component, then migrated to CSS variables following this guide: https://primer.style/foundations/primitives/migrating#migrating-from-sx-props-primer-react

@github-actions github-actions bot temporarily deployed to storybook-preview-5267 November 13, 2024 02:55 Inactive
@ktravers ktravers force-pushed the ktravers/rm-sx-from-tree-view branch from e72f964 to c28f0a4 Compare November 13, 2024 02:56
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Nov 14, 2024
@ktravers
Copy link
Contributor Author

Taking back to draft while I look into new VRT failures...

@ktravers ktravers marked this pull request as draft November 14, 2024 06:33
@primer primer bot temporarily deployed to github-pages November 14, 2024 15:07 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5267 November 14, 2024 15:08 Inactive
@ktravers ktravers marked this pull request as ready for review November 14, 2024 15:15
@ktravers ktravers requested a review from a team as a code owner November 14, 2024 15:15
@primer-integration
Copy link

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

@primer-integration
Copy link

🔴 golden-jobs completed with status failure.

Copy link
Contributor

@langermank langermank left a comment

Choose a reason for hiding this comment

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

Approving the VRT updates! Before merging, we should confirm that the dotcom integration test failure isn't related (@jonrohan can take a look)

@jonrohan
Copy link
Member

Yep these look like the same integration errors, not related to this pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: TreeView Issues related to the TreeView component integration-tests: failing Changes in this PR cause breaking changes in gh/gh staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants