Skip to content

fix: restore bundled libraries for backend workers - #7126

Merged
FarhanAliRaza merged 7 commits into
reflex-dev:mainfrom
harsh21234i:fix/7096-noncompiling-bundled-library
Sep 14, 2026
Merged

FarhanAliRaza merged 7 commits into
reflex-dev:mainfrom
harsh21234i:fix/7096-noncompiling-bundled-library

Conversation

@harsh21234i

@harsh21234i harsh21234i commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix backend-only workers losing bundled-library metadata after the
frontend has already been compiled.

When a backend worker skips frontend compilation, its bundled-library
registry was incomplete. Serializers for values referencing libraries such
as @radix-ui/themes could then raise during state hydration, causing the
entire hydrate delta to be dropped.

Changes

  • Persist the final bundled-library registry as .web/ bundled_libraries.json.
  • Restore the registry before backend-only initial-state serialization.
  • Add a regression test covering registry persistence and restoration.
  • Add a bugfix release note.

Testing

  • git diff --check passed.
  • Isolated Ruff checks passed.
  • Focused pytest execution was attempted

Closes #7096

@harsh21234i
harsh21234i requested a review from a team as a code owner September 12, 2026 13:18
@greptile-apps

greptile-apps Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge because the registry lifecycle is wired through the compiler and malformed or absent artifacts fail safely without corrupting current registrations.

Summary

  • Adds a validated, failure-tolerant registry restoration path.
  • Wires registry emission into normal frontend output assembly.
  • Restores metadata before both backend-only initial-state serialization paths.
  • Adds orchestration, round-trip, preservation, missing-file, invalid-encoding, and malformed-JSON regression tests.
  • Adds release notes for the affected packages.

Reviews (6) · Last reviewed commit: "test: cover invalid bundle registry arti..."

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread reflex/compiler/compiler.py Resolved
Comment thread reflex/compiler/utils.py Resolved
@codspeed

codspeed Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 40 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing harsh21234i:fix/7096-noncompiling-bundled-library (ad0f7fc) with main (72156c2)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@masenf masenf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is for the backend use only, then it should be in .web/backend/

FarhanAliRaza
FarhanAliRaza previously approved these changes Sep 14, 2026
@FarhanAliRaza
FarhanAliRaza merged commit 4297b96 into reflex-dev:main Sep 14, 2026
114 checks passed
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.

Non-compiling backend workers lose bundled-library metadata and can drop the entire hydrate delta

3 participants