Skip to content

fix(icons): update internal import specifier#12265

Merged
dlabaj merged 2 commits intopatternfly:mainfrom
kmcfaul:icons-type-fix
Mar 13, 2026
Merged

fix(icons): update internal import specifier#12265
dlabaj merged 2 commits intopatternfly:mainfrom
kmcfaul:icons-type-fix

Conversation

@kmcfaul
Copy link
Contributor

@kmcfaul kmcfaul commented Mar 12, 2026

What: Closes #

Changes in our react/icons now fully specifies our dist/esm output as an ESM module, which requires all imports to be specified. So import { createIcon } from '../createIcon is not valid (and likely hasn't been, but this specifier rule either wasn't enforced by older versions of Node/webpack/etc, or the package wasn't fully being treated as ESM since we hadn't previously specified type: module).

Summary by CodeRabbit

  • Bug Fixes
    • Fixed module export paths to properly reference JavaScript files, improving ESM module resolution compatibility.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4f5200f3-0e2c-4ed4-b2bd-291703a6ff0c

📥 Commits

Reviewing files that changed from the base of the PR and between 4328eae and c2661d7.

📒 Files selected for processing (2)
  • packages/react-icons/scripts/writeIcons.mjs
  • packages/react-icons/src/index.ts

Walkthrough

Changed import/export strings to include explicit .js extensions: updates in the icon build script outputs and the package public barrel now reference .js paths instead of extensionless module paths.

Changes

Cohort / File(s) Summary
Build script ESM/DTS output
packages/react-icons/scripts/writeIcons.mjs
Updated generated import paths to use ../createIcon.js in both ESM and DTS export writers; updated generated esm icons index entries to export ./<name>.js.
Public barrel export
packages/react-icons/src/index.ts
Changed re-export target from ./icons/index to ./icons/index.js to match generated ESM output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • nicolethoen
  • thatblindgeye
  • wise-king-sullyman
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating import specifiers to add .js file extensions for ESM compliance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@patternfly-build
Copy link
Collaborator

patternfly-build commented Mar 12, 2026

Copy link
Member

@logonoff logonoff left a comment

Choose a reason for hiding this comment

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

Works!!

Copy link
Member

@evwilkin evwilkin left a comment

Choose a reason for hiding this comment

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

LGTM 👏

@dlabaj dlabaj merged commit e23728b into patternfly:main Mar 13, 2026
14 checks passed
@patternfly-build
Copy link
Collaborator

Your changes have been released in:

  • @patternfly/react-code-editor@6.5.0-prerelease.41
  • @patternfly/react-core@6.5.0-prerelease.38
  • @patternfly/react-docs@7.5.0-prerelease.45
  • @patternfly/react-drag-drop@6.5.0-prerelease.39
  • @patternfly/react-icons@6.5.0-prerelease.16
  • demo-app-ts@6.5.0-prerelease.67
  • @patternfly/react-table@6.5.0-prerelease.39
  • @patternfly/react-templates@6.5.0-prerelease.38

Thanks for your contribution! 🎉

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants