Latest Results
fix: emit deep per-icon imports for static lucide icons (#6628)
* fix: emit deep per-icon imports for static lucide icons
Static-string `rx.icon` tags compiled to a barrel import
`import { WifiOff } from "lucide-react"`. Once the module graph also
contains `lucide-react/dynamic.mjs` (used by DynamicIcon for Var tags),
esbuild's dep-optimizer emits a per-icon chunk for the dynamic-import map
and rewrites the barrel to statically import every one of them. Since
DefaultOverlayComponents (mounted on every page) barrel-imports WifiOff,
loading any page in dev fired ~1700 requests — the whole icon library.
Emit deep default imports instead, lucide's recommended form:
`import LucideWifiOff from "lucide-react/dist/esm/icons/wifi-off.mjs"`.
lucide-react has no exports map, so the path targets the kebab-case file
directly; the .mjs extension is required for Node/Bun ESM resolution.
The dynamic Var -> DynamicIcon path is left unchanged.
A 6-entry file-name override covers the icons whose kebab name doesn't
match lucide's file (fingerprint, grid_2x_2*, grid_3x_3), verified
against the full icon list.
Fixes #6627
ENG-9721
* chore: add changelog fragment for #6627
* fix: regenerate banner stub and relocate changelog fragment
WifiOffPulse extends Icon, so it inherits the new _import_path field —
regenerate its .pyi hash, which I missed.
Move the news fragment from news/6627 (issue number, root) to
packages/reflex-components-lucide/news/6628 (PR number, affected
package) so the per-package towncrier check finds it.
* fix: regenerate AccordionIcon stub for inherited _import_path field
AccordionIcon(Icon) inherits the new _import_path field, so its
generated .pyi hash changed too. This was the remaining drift causing
pre-commit's update-pyi-files hook to fail. AccordionIcon and
WifiOffPulse are the only two Icon subclasses; both stubs are now
regenerated.
* test: spot-check literal icon import paths; fix comment grammar
Address Greptile review on #6628:
- test_static_icon_import_path was circular for override entries (built
the expected path from the same LUCIDE_ICON_FILENAME_OVERRIDE the code
reads). Add test_static_icon_import_path_literal with hardcoded paths,
independent of the override dict, so a typo in an override value fails.
- Complete the dangling 'doesn't' clause in the override-map comment.
* pyi_generator: exclude props with underscore prefix
These are "private" and should not form part of the IDE/type hinting
documentation. They are still accepted and won't raise any typing errors due to
all components _also_ taking `**props`
* add news for pyi_generator change
---------
Co-authored-by: Masen Furer <m_github@0x26.net> Latest Branches
0%
claude/confident-curie-xx68kt 0%
khaleel/eng-9724-add-hydrate_fallback-api-for-the-page-hydration-window 0%
khaleel/eng-9640-add-cli-command-for-security-scan © 2026 CodSpeed Technology