Repository navigation
fix: expose deep Lucide imports through import_var - #7604
Conversation
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryThe PR exposes Lucide’s deep imports through
No actionable new issues or repository-rule violations were found. No previous review threads were supplied. Tests were not run during this review. Reviews (2) · Last reviewed commit: "fix: preserve named dynamic Lucide impor..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
Merging this PR will not alter performance1 warning
Comparing |
All Submissions:
Type of change
Changes To Core Features:
Changes
Declare static and dynamic Lucide module imports through
import_var, so the public metadata describes the same deep module that the component imports. Let the base implementation collect and cache these imports together with imports required by props.Preserve static default bindings, aliases and filename overrides, the named dynamic binding even when callers set
is_default=True, and explicit package-root bundling. Add metadata and same-library prop-import regressions, and extend the existing dynamic-components app's browser coverage for initial and event-activated icons.Closes #7111.
Validation
Tested on Windows with Python 3.12.10. Checks cover the patch committed as
0215ea166dce197170b5f7db23be0a0a0f7244cf.Before the fix, six metadata/import-preservation cases failed.
uv run --python 3.12 --locked pytest tests/units/components/lucide/test_icon.py tests/units/compiler/test_dynamic_components_codegen.py -q --tb=short: 3,592 passed. Existing compiler tests cover explicit root bundling and specific deep-module registration.All applicable pre-commit hooks passed, including Ruff, codespell, stub generation, Pyright, ty, and Biome. The first stub-generation run updated the required Lucide entry in
pyi_hashes.json; the subsequent run passed.With
APP_HARNESS_HEADLESS=1andPYTHONIOENCODING=utf-8,uv run --python 3.12 --locked pytest tests/integration/test_dynamic_components.py::test_dynamic_components -q -s -o faulthandler_timeout=120: 1 passed in 242.65 seconds. This extends the existing Selenium test, including its initial/reactive icons, repeated activation and counter events, with module-registry assertions and an explicitis_default=Truecaller. Its existing timeouts are unchanged; the 120-second diagnostic stack dump occurred during navigation, and pytest completed normally.Rechecking the final six unit regressions against the original affected module produced 6 failures; restoring the fixed module produced 6 passes.
Cubic's caller-flag regression produced 2 failures and 2 passing controls before forcing the dynamic import to remain named. All four cases pass in the final unit run.
The browser follow-up initially failed during fixture setup. A diagnostic captured
StaleElementReferenceExceptionon the original token input while the current input was populated. The fixture now re-locates the input on each poll, retaining its existing 15-second timeout. The final passing run used no diagnostic plugin.The initial uncaptured browser invocation failed while printing the server's Unicode arrow under Windows cp1252 output. Setting UTF-8 process output resolved that setup error. The full repository unit and integration matrices were not run locally; remote CI remains unverified until the workflows run.
An independent source review found no actionable correctness or security finding in this scoped patch. This is not a full repository security audit.
Implemented with assistance from OpenAI Codex. No human review or manual testing is claimed.