Repository navigation
Skip the window.__reflex libraries in apps without state - #8035
benedikt-bartscher wants to merge 23 commits into
Conversation
…ps without state on a local event loop
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryApps compiled with
Reviews (8) · Last reviewed commit: "Merge branch 'stateless-runtime' into st..." · Reviewed by Greptile |
Merging this PR will improve performance by 6.88%2 warnings
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed across 36 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
…for apps without state
# Conflicts: # packages/reflex-frontend/src/utils/state.js
|
@cubic-dev-ai review |
@benedikt-bartscher I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 39 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
…connection banner's
# Conflicts: # tests/integration/tests_playwright/test_stateless_app.py
Type of change
Description
Depends on #8033: its commits are part of this diff until it merges.
Problem. The app root imports the namespaces of the bundled libraries (
$/utils/state,$/utils/context, ...) and puts them onwindow.__reflex, where dynamic components look them up. A namespace import keeps every export, so an app withenable_state=Falseships the backend transport and socket.io, although dynamic components only ever come from the backend.Change.
compile_app_roottakesstateful. Without state, the root imports no library namespaces and sets neitherwindow.__reflexnorwindow.__reflex_load.Measured with #8033, on a two-page stateless app with client state (
reflex export, JS loaded by the first view):/raw/gzip/braw/bgzipThe shared chunk with
state.jsand socket.io (93.4 KB, 30.9 KB gzip) is gone.Tests
test_dynamic_components_codegen.py: an app root without state has nowindow.__reflexand no namespace import, with and withoutfrontend_lazy_bundled_libraries; with state both stay.test_compiler.py:compile_appwriteswindow.__reflexonly for an app with state.test_stateless_app.py, prod: no script a stateless page loads contains the transport or engine.io-client. It fails without this change.