Repository navigation
Fail the compile when an app without state imports the backend transport #8034
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
Open
benedikt-bartscher
wants to merge
31
commits into
reflex-dev:main
Choose a base branch
from
benedikt-bartscher:stateless-transport-guard
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
71e7381
feat(frontend): move the backend transport out of state.js and run ap…
benedikt-bartscher 018f676
feat(compiler): fail the compile when an app without state imports th…
benedikt-bartscher 3d59e0d
Merge remote-tracking branch 'upstream/main' into stateless-runtime
benedikt-bartscher eb7b4a1
Merge branch 'stateless-runtime' into stateless-transport-guard
benedikt-bartscher cb8aaf6
fix(frontend): keep browser storage events and dispatch order in the …
benedikt-bartscher 294d8ce
fix(compiler): check only the memos an app without state renders, and…
benedikt-bartscher 9b3d806
Merge branch 'stateless-runtime-review' into stateless-runtime
benedikt-bartscher e438848
Merge branch 'stateless-transport-guard-review' into stateless-transp…
benedikt-bartscher c1ad09d
Merge branch 'stateless-runtime' into stateless-transport-guard
benedikt-bartscher c1fb4ce
fix(frontend): drop temporal events in apps without state, as with th…
benedikt-bartscher 3ea5b33
fix(compiler): check the document head of an app without state for ba…
benedikt-bartscher 045efc1
Merge branch 'stateless-transport-guard-review' into stateless-transp…
benedikt-bartscher 3715230
Merge branch 'stateless-runtime-review' into stateless-runtime
benedikt-bartscher 4f8d4f8
Merge branch 'stateless-runtime' into stateless-transport-guard
benedikt-bartscher bed35f2
test: read isTrue and evalReactComponent from the modules that now de…
benedikt-bartscher 8bde227
Merge branch 'stateless-runtime' into stateless-transport-guard
benedikt-bartscher 10f7d39
fix(compiler): check the hydrate fallback of an app without state for…
benedikt-bartscher 7a984f0
Merge branch 'stateless-transport-guard-review' into stateless-transp…
benedikt-bartscher a95baf1
test: compare every export statement of state.js
benedikt-bartscher 2c64f76
Merge branch 'stateless-runtime-review' into stateless-runtime
benedikt-bartscher ca00354
Merge branch 'stateless-runtime' into stateless-transport-guard
benedikt-bartscher e56e3dc
Merge remote-tracking branch 'upstream/main' into stateless-runtime
benedikt-bartscher de1775c
Merge branch 'stateless-runtime' into stateless-transport-guard
benedikt-bartscher fc7a6e1
fix(compiler): check the styled memo bodies of an app without state f…
benedikt-bartscher d32fb1c
Merge branch 'main' into stateless-transport-guard
benedikt-bartscher c373966
fix(compiler): reach a memo of an app without state only through an i…
benedikt-bartscher d0e0a40
docs(news): say that apps without state drop temporal events without …
benedikt-bartscher 3387771
docs(news): tell rx.get_upload_url's transport import apart from the …
benedikt-bartscher 2276047
test: fail the stateless app test on uncaught page errors too
benedikt-bartscher e5d8247
Merge branch 'stateless-runtime' into stateless-transport-guard
benedikt-bartscher 8d7b46b
fix(compiler): catch transport names an app without state imports thr…
benedikt-bartscher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Compiling an app with `enable_state=False` now fails when a page, a memo it renders, the app root, the document head or the hydrate fallback imports from `utils/transport.js`, directly or through the re-exports of `utils/state.js` (for example through `rx.get_upload_url`), and the error names each of them and what it imports. Such code needs the backend, which the app does not have, and used to fail only in the browser. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Apps with `enable_state=False` run a local event loop that applies frontend events (`rx.redirect`, `rx.call_script`, `rx.call_function`, client state, focus, value and browser storage events) in the browser, in the order they were dispatched, and never connects. Temporal events are dropped, as while the backend is down; any other event that needs the backend logs an error in the browser console instead of being dropped. `utils/state.js` now re-exports two modules: `utils/runtime.js`, with the helpers and events every app needs, and `utils/transport.js`, with the backend connection, which only apps with state use: the context module of an app without state never imports it. Imports from `utils/state.js` keep working. In an app without state, `rx.call_script` code and callbacks see the exports of `utils/runtime.js`, `addEvents`, `navigate` and `params`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/reflex-components-core/news/+stateless-runtime.misc.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| `rx.get_upload_url` imports `getBackendURL`, and the connection banner `getBackendURL` and `isBackendDisabled`, from `$/utils/transport`, the backend connection that only apps with state load; `$/utils/state` still re-exports both. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.