Repository navigation
Fail the compile when an app without state imports the backend transport - #8034
benedikt-bartscher wants to merge 31 commits into
Conversation
…ps without state on a local event loop
…e backend transport
[Medium impact] The changes since the previous review appear safe to merge. SummaryStateless compilation now also rejects backend helpers imported through the re-exports in
Reviews (10) · Last reviewed commit: "fix(compiler): catch transport names an ..." · Reviewed by Greptile |
Merging this PR will improve performance by 6.63%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 35 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
… compare whole errors
# Conflicts: # packages/reflex-frontend/src/utils/state.js
…mport of its own module
|
@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 38 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
…connection banner's
…ough utils/state.js
Type of change
Description
Depends on #8033: its commits are part of this diff until it merges.
Problem. Code that needs the backend (
rx.get_upload_url, the connection banner'sWebsocketTargetURL, dynamic components) compiles fine in an app withenable_state=Falseand only fails in the browser, where nothing connects.Change. After #8033 every such name lives in
utils/transport.js.compile_appnow checks the import data of every page, memo and the app root, and fails when an app without state imports from$/utils/transport. The error names each module and what it imports:It reads the parsed imports, not the emitted code, as #7965 and #7630 do for the
rx.Statereads of #7579. Memos register for the whole process, so it follows only the memos the pages and the app root import, directly or through another memo: an unused library@rx.memo, or one an app compiled earlier in the same process registered, doesn't fail the compile. The connection banner and overlay stay out of apps without state, as before.Tests
test_compiler.py: a page and a memo usingrx.get_upload_urlfail to compile without state, compared against the whole error; a registered memo no page renders doesn't fail it; a page with client state, events and links compiles without state;rx.get_upload_urlcompiles with state. The full unit suite passes apart from failures it has on main here too (granian reload, bench collectors, site headings).