Repository navigation
Keep implicit libraries off window.__reflex in apps without dynamic components #8036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||||
| Apps that render no dynamic component no longer import whole libraries into the app root. A blank app ships about 70 KB less gzipped JavaScript, because `@radix-ui/themes` is tree-shaken to the components its pages use. Libraries the compiler registers on its own (a plugin's frontend dependencies, Radix Themes) are now exposed on `window.__reflex` only when a page evaluates a component held in state. A script that reads one of them from `window.__reflex` directly must register it with `bundle_library("<library>")`, which always exposes it. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Prompt for AI agents
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Document in `bundle_library` that libraries the compiler registers on its own are exposed on `window.__reflex` only when a page evaluates a dynamic component, while a library registered with `bundle_library` is always exposed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The note incorrectly says compiler-registered libraries are exposed only when a page evaluates a state-held component. With the default eager loading, the app root exposes them whenever the compiled app includes the dynamic-component evaluator, even if no dynamic component is ever rendered; distinguish eager and lazy behavior in this sentence.
Prompt for AI agents