Fix bundled library subpath serialization

Closed
HA
2mo ago
+246-19

Summary

Fixes issue #6975.

compile_app() was clearing explicit bundle_library() registrations during frontend compilation. Dynamic components
also failed to rewrite bundled library subpath imports, such as Lucide deep imports.

Changes

  • Preserve user-registered bundled libraries during compilation.
  • Rewrite bundled default, named, and namespace subpath imports through window.__reflex.
  • Add unit tests for bundled-library preservation and subpath serialization.
  • Add browser integration coverage using a dynamically rendered Lucide icon.
  • Add required bugfix news fragments.

Tests

  • uv run pytest tests/units/compiler/test_dynamic_components_codegen.py tests/units/compiler/test_compiler.py -q
  • uv run pytest tests/integration/test_dynamic_components.py -q
  • Ruff checks and formatting pass.
  • Pyright passes for the changed source modules.