Skip to content

Route utility exports through non-component modules#7941

Open
joshblack wants to merge 2 commits into
joshblack/eslint-react-refresh/fix-utilitiesfrom
joshblack/eslint-react-refresh/fix-hooks-and-barrels
Open

Route utility exports through non-component modules#7941
joshblack wants to merge 2 commits into
joshblack/eslint-react-refresh/fix-utilitiesfrom
joshblack/eslint-react-refresh/fix-hooks-and-barrels

Conversation

@joshblack

@joshblack joshblack commented Jun 8, 2026

Copy link
Copy Markdown
Member

Closes #

No linked issue.

Routes utility exports through non-component modules and replaces wildcard/component-file re-exports that block React Refresh enforcement.

Changelog

New

  • Added a KeybindingHint utility module for accessible keybinding string helpers.

Changed

  • Updated Overlay, Token, Timeline, UnderlineNav, KeybindingHint, and SelectPanel2 imports/exports to use non-component modules for utilities.
  • Renamed Storybook story helpers from .tsx to .ts because they do not export components.
  • Replaced the SelectPanel2 wildcard export with explicit exports.

Removed

  • Removed utility re-exports from component implementation files.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; import/export cleanup with existing public APIs preserved.

Testing & Reviewing

Focus review on ensuring utility imports now point at constants.ts, utils.ts, or package barrels instead of component files.

Merge checklist

@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 231b877

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

@github-actions github-actions Bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 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. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@joshblack joshblack changed the title joshblack/eslint react refresh/fix hooks and barrels Route utility exports through non-component modules Jun 8, 2026
@joshblack joshblack added skip changeset This change does not need a changelog integration-tests: skipped manually Changes in this PR do not require an integration test labels Jun 8, 2026
@joshblack joshblack marked this pull request as ready for review June 8, 2026 17:37
@joshblack joshblack requested a review from a team as a code owner June 8, 2026 17:37
@joshblack joshblack requested review from TylerJDev and Copilot June 8, 2026 17:37

Copilot AI 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.

Pull request overview

This pull request refactors utility exports/imports to route them through non-component modules (for example constants.ts/utils.ts) and replaces wildcard/component-file re-exports that interfere with React Refresh enforcement.

Changes:

  • Added a KeybindingHint utility module for generating accessible keybinding strings and adjusted exports to avoid utility re-exports from component files.
  • Updated several components (Overlay, Token, Timeline, UnderlineNav, SelectPanel2, AnchoredOverlay) and tests/stories to import utilities from constants.ts/utils.ts instead of component implementation modules.
  • Introduced a shared Storybook utility module (utils/story-helpers.ts) and updated some stories to use explicit exports/imports.
Show a summary per file
File Description
packages/react/src/utils/story-helpers.ts New Storybook helper utilities (argTypes builders, form control args, Octicon mapping).
packages/react/src/UnderlineNav/UnderlineNav.tsx Removed utility re-export from component implementation file.
packages/react/src/Token/TokenBase.tsx Stopped re-exporting Token utilities/constants from the component module; imports now come from constants.ts/utils.ts.
packages/react/src/Token/Token.tsx Updated imports to use constants.ts/utils.ts instead of TokenBase re-exports.
packages/react/src/Token/IssueLabelToken.tsx Updated imports to use constants.ts/utils.ts instead of TokenBase re-exports.
packages/react/src/Token/_RemoveTokenButton.tsx Updated defaultTokenSize import to come from constants.ts.
packages/react/src/Token/tests/Token.test.tsx Updated tokenSizes import to come from constants.ts.
packages/react/src/Timeline/Timeline.tsx Removed utility re-export from component implementation file and adjusted how constants are referenced.
packages/react/src/Timeline/Timeline.stories.tsx Updated story imports to pull badge variants from constants.ts.
packages/react/src/TextInputWithTokens/TextInputWithTokens.test.tsx Updated tokenSizes import to come from Token constants.ts.
packages/react/src/Overlay/Overlay.tsx Removed constants re-export from component implementation file and adjusted import style.
packages/react/src/KeybindingHint/utils.ts New utility module for accessible keybinding hint strings.
packages/react/src/KeybindingHint/KeybindingHint.tsx Moved plain-string utility out of the component module.
packages/react/src/KeybindingHint/index.ts Switched from wildcard export to explicit exports, routing the utility through utils.ts.
packages/react/src/KeybindingHint/components/Sequence.tsx Removed re-export of internal accessibility utility.
packages/react/src/KeybindingHint/components/Chord.tsx Removed re-export of internal accessibility utility.
packages/react/src/experimental/SelectPanel2/SelectPanel.tsx Updated heightMap import to come from Overlay/constants.ts.
packages/react/src/experimental/SelectPanel2/index.tsx Replaced wildcard export with explicit value/type exports.
packages/react/src/AnchoredOverlay/AnchoredOverlay.tsx Updated widthMap import to come from Overlay/constants.ts.

Copilot's findings

Comments suppressed due to low confidence (1)

packages/react/src/Overlay/Overlay.tsx:17

  • heightMap/widthMap are imported using import type, but the prop types reference them via keyof typeof …. typeof in a type query requires a value symbol, so this combination will fail type-checking.

Use the imported types directly (drop the typeof), or switch back to a value import.

import type {heightMap, widthMap} from './constants'

type StyledOverlayProps = {
  width?: keyof typeof widthMap
  height?: keyof typeof heightMap
  • Files reviewed: 18/19 changed files
  • Comments generated: 1


export {TimelineBadgeVariants}

export type TimelineBadgeVariant = (typeof TimelineBadgeVariants)[number]
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 integration-tests: skipped manually Changes in this PR do not require an integration test skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants