Skip to content

Update hugeicon import in reflex-ui#6333

Open
carlosabadia wants to merge 1 commit intomainfrom
carlos/fix-tree-shakeable-hugeicons
Open

Update hugeicon import in reflex-ui#6333
carlosabadia wants to merge 1 commit intomainfrom
carlos/fix-tree-shakeable-hugeicons

Conversation

@carlosabadia
Copy link
Copy Markdown
Contributor

Avoids the production build from embedding all hugeicons in the bundle

@carlosabadia carlosabadia changed the title Update hugeicon import Update hugeicon import in reflex-ui Apr 15, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 15, 2026

Greptile Summary

This PR optimises the HugeIcons integration by switching from a barrel import of the entire @hugeicons/core-free-icons package to per-icon subpath imports (e.g. import ArrowRight01Icon from '@hugeicons/core-free-icons/ArrowRight01Icon'), leveraging the individual-icon export introduced in v4.1.1. The companion change in hero.py renames the icon tag to match the updated naming convention in the new library version.

Confidence Score: 5/5

Safe to merge β€” the change is a focused bundle-size optimisation with no logic regressions.

Both changed files have only P2-or-lower concerns. The ImportVar pattern used (is_default=True, package_path) is already established in the codebase (Plotly, Lucide), the version bump is minor (4.0.0 β†’ 4.1.1), and the icon rename in hero.py is straightforwardly correct.

No files require special attention.

Important Files Changed

Filename Overview
packages/reflex-ui/src/reflex_ui/components/icons/hugeicon.py Bumps @hugeicons/core-free-icons to 4.1.1 and switches to per-icon subpath imports to prevent the entire icon library from being bundled.
docs/app/reflex_docs/pages/docs_landing/views/hero.py Renames icon reference from ArrowRightIcon to ArrowRight01Icon to match the updated naming convention in @hugeicons/core-free-icons@4.1.1.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["HugeIcon.create(icon_name)"] --> B{is string prop?}
    B -- No --> C["Pass through as-is"]
    B -- Yes --> D["Build ImportVar\n(tag=icon_name,\nis_default=True,\npackage_path='/icon_name')"]
    D --> E["Generated JS import\nimport IconName from\n'@hugeicons/core-free-icons/IconName'"]
    E --> F["~0.75KB per icon bundled\n(vs. ~5MB for full barrel import)"]
Loading

Reviews (1): Last reviewed commit: "Update hugeicon import" | Re-trigger Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 15, 2026

Merging this PR will not alter performance

βœ… 9 untouched benchmarks


Comparing carlos/fix-tree-shakeable-hugeicons (b07e481) with main (c3f684c)

Open in CodSpeed

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.

1 participant