Skip to content

Conversation

@joyenjoyer
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Jan 16, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-01-21 09:22 UTC

@joyenjoyer joyenjoyer force-pushed the icon_package_merge branch 3 times, most recently from 59ef44b to 117ace8 Compare January 16, 2026 14:30
Copy link
Contributor Author

@joyenjoyer joyenjoyer Jan 16, 2026

Choose a reason for hiding this comment

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

I moved this utility function into ui-icons because it has specific, icon-related use cases. If someone imports ui-icons, these utilities will already be available, and there’s no use case where someone would need these utility functions without importing ui-icons.

"build": "ui-scripts build __build__ --copy-files --modules es,cjs",
"build": "pnpm run build:main && pnpm run build:lucide",
"build:main": "ui-scripts build __build__ --copy-files --modules es,cjs",
"build:lucide": "pnpm exec babel lucide --out-dir lib/lucide --extensions .ts,.tsx,.js,.jsx && ES_MODULES=true pnpm exec babel lucide --out-dir es/lucide --extensions .ts,.tsx,.js,.jsx",
Copy link
Contributor Author

@joyenjoyer joyenjoyer Jan 16, 2026

Choose a reason for hiding this comment

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

These special commands will be removed when old icons will be deleted.

@joyenjoyer joyenjoyer self-assigned this Jan 16, 2026
Comment on lines 9 to 23
"exports": {
".": {
"import": "./es/index.js",
"require": "./lib/index.js",
"types": "./types/index.d.ts"
},
"./lucide": {
"import": "./es/lucide/index.js",
"require": "./lib/lucide/index.js",
"types": "./types/lucide/index.d.ts"
},
"./lib/*": "./lib/*",
"./es/*": "./es/*",
"./types/*": "./types/*"
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should not be needed if you export everything to the root of the package (its handed by the "module", "main" part above). While this is the "right" way to do it, we do it differently by convention in our other packages. When we change it we should change it everywhere

Comment on lines 10 to 18
".": {
"import": "./es/index.js",
"require": "./lib/index.js",
"types": "./types/index.d.ts"
},
"./lucide": {
"import": "./es/lucide/index.js",
"require": "./lib/lucide/index.js",
"types": "./types/lucide/index.d.ts"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The new icons should be exported from the root too for multiple reasons:

  • We are always exporting everything from the root, we even have an ESLint rule against importing from anywhere else (but its not working 100% :( ).
  • This would require a ton of renames from users (e.g. import {IconXLine} from "@instructure/ui-icons" -> import {IconXLine} from "@instructure/ui-icons/lucide" )
  • There should be no name clashes with the old icons (and in the future they will point to a Lucide icon anyway)

Comment on lines 79 to 83
const { renderIconWithProps, ...lucideIconComponents } = LucideIcons

const globals = {
...Components,
...lucideIconComponents,
Copy link
Collaborator

Choose a reason for hiding this comment

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

AFAIK this is not needed if you export the new icons to the root, resolve.mjs should take care of this

@joyenjoyer joyenjoyer requested a review from matyasf January 20, 2026 07:54
@joyenjoyer joyenjoyer force-pushed the icon_package_merge branch 2 times, most recently from c45a2b6 to b2190b7 Compare January 20, 2026 13:15
Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

almost good, just a small change

Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

nice work!

@joyenjoyer joyenjoyer merged commit 7e92aef into v12 Jan 21, 2026
8 of 9 checks passed
@joyenjoyer joyenjoyer deleted the icon_package_merge branch January 21, 2026 09:22
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.

4 participants