Skip to content

migrate TreeView to CSS modules - #5267

Merged
jonrohan merged 19 commits into
mainfrom
ktravers/rm-sx-from-tree-view
Nov 14, 2024
Merged

migrate TreeView to CSS modules#5267
jonrohan merged 19 commits into
mainfrom
ktravers/rm-sx-from-tree-view

Conversation

@ktravers

@ktraversktravers commented Nov 12, 2024

Copy link
Copy Markdown
Contributor

closeshttps://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
BeforeAfter
light modes beforelight modes after
dark modes beforedark 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

@ktraversktravers self-assigned this Nov 12, 2024
@changeset-bot

changeset-botBot commented Nov 12, 2024

Copy link
Copy Markdown

🦋 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
NameType
@primer/reactMinor

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

@github-actions

Copy link
Copy Markdown
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-actionsgithub-actionsBot 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-actionsBottemporarily deployed to storybook-preview-5267 November 12, 2024 17:32 Inactive
@github-actions

github-actionsBot commented Nov 12, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js99.12 KB (+0.44% 🔺)
packages/react/dist/browser.umd.js99.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.

Copy link
Copy Markdown
ContributorAuthor

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

Comment threadpackages/react/src/TreeView/TreeView.module.css
@github-actionsgithub-actionsBot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 13, 2024

@langermanklangermank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a few little things

Comment threadpackages/react/src/TreeView/TreeView.module.css Outdated
Comment threadpackages/react/src/TreeView/TreeView.module.css Outdated
Comment thread.changeset/gentle-yaks-shake.md
Comment threadpackages/react/src/TreeView/TreeView.module.css Outdated
Comment threadpackages/react/src/TreeView/TreeView.module.css Outdated
Comment threadpackages/react/src/TreeView/TreeView.module.css Outdated
Comment threadpackages/react/src/TreeView/TreeView.module.css Outdated
ktraversand others added 2 commits November 13, 2024 22:30
Co-authored-by: Jon Rohan <yes@jonrohan.codes>
Co-authored-by: Katie Langerman <18661030+langermank@users.noreply.github.com>
@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 14, 2024
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actionsgithub-actionsBot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 14, 2024
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 14, 2024
Co-authored-by: Jon Rohan <yes@jonrohan.codes>
@github-actionsgithub-actionsBot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 14, 2024
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

Variable problem referenced in e97cf72
was resolved by #5277.
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@ktravers

Copy link
Copy Markdown
ContributorAuthor

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

@primer-integration

Copy link
Copy Markdown

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

@primer-integration

Copy link
Copy Markdown

🔴 golden-jobs completed with status failure.

@langermanklangermank left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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

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

Labels

component: TreeViewIssues related to the TreeView componentintegration-tests: failingChanges in this PR cause breaking changes in gh/ghstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ktravers@jonrohan@langermank