Fix bundled library subpath serialization - #7016
Conversation
Greptile SummaryThe PR preserves explicit bundled-library registrations across compilation and routes dynamic subpath imports through their corresponding
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/reflex-base/src/reflex_base/components/dynamic.py | Tracks explicit registrations separately and reconstructs bundled subpath imports from exact window namespace entries. |
| packages/reflex-base/src/reflex_base/registry.py | Adds registration-context storage and copying for explicitly bundled libraries. |
| reflex/compiler/compiler.py | Preserves explicit registrations during compile resets and generates collision-free window-library aliases. |
| packages/reflex-components-radix/src/reflex_components_radix/plugin.py | Registers Radix Themes as a compile-derived dependency while retaining compatibility with older reflex-base versions. |
| tests/units/compiler/test_dynamic_components_codegen.py | Covers exact-subpath default and named import reconstruction plus app-root bundling. |
| tests/units/compiler/test_compiler.py | Covers explicit-registration preservation, stale derived-registration removal, and normalized alias collisions. |
| tests/integration/test_dynamic_components.py | Exercises a dynamically rendered Lucide icon through the browser integration path. |
Reviews (4): Last reviewed commit: "Document bundled library helper return v..." | Re-trigger Greptile
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Summary
Fixes issue #6975.
compile_app()was clearing explicitbundle_library()registrations during frontend compilation. Dynamic componentsalso failed to rewrite bundled library subpath imports, such as Lucide deep imports.
Changes
window.__reflex.Tests
uv run pytest tests/units/compiler/test_dynamic_components_codegen.py tests/units/compiler/test_compiler.py -quv run pytest tests/integration/test_dynamic_components.py -q