streamlit-nightly 1.38.1.dev20240912__py2.py3-none-any.whl → 1.38.1.dev20240913__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/runtime/app_session.py +5 -7
- streamlit/runtime/forward_msg_queue.py +28 -1
- streamlit/runtime/scriptrunner/script_runner.py +2 -12
- streamlit/static/asset-manifest.json +2 -2
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{main.536604a4.js → main.8721af5a.js} +3 -3
- streamlit/web/server/app_static_file_handler.py +1 -1
- {streamlit_nightly-1.38.1.dev20240912.dist-info → streamlit_nightly-1.38.1.dev20240913.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.38.1.dev20240912.dist-info → streamlit_nightly-1.38.1.dev20240913.dist-info}/RECORD +14 -14
- /streamlit/static/static/js/{main.536604a4.js.LICENSE.txt → main.8721af5a.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.38.1.dev20240912.data → streamlit_nightly-1.38.1.dev20240913.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.38.1.dev20240912.dist-info → streamlit_nightly-1.38.1.dev20240913.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.38.1.dev20240912.dist-info → streamlit_nightly-1.38.1.dev20240913.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.38.1.dev20240912.dist-info → streamlit_nightly-1.38.1.dev20240913.dist-info}/top_level.txt +0 -0
streamlit/runtime/app_session.py
CHANGED
@@ -468,8 +468,10 @@ class AppSession:
|
|
468
468
|
if self._local_sources_watcher is not None:
|
469
469
|
self._local_sources_watcher.update_watched_pages()
|
470
470
|
|
471
|
-
def _clear_queue(self) -> None:
|
472
|
-
self._browser_queue.clear(
|
471
|
+
def _clear_queue(self, fragment_ids_this_run: list[str] | None = None) -> None:
|
472
|
+
self._browser_queue.clear(
|
473
|
+
retain_lifecycle_msgs=True, fragment_ids_this_run=fragment_ids_this_run
|
474
|
+
)
|
473
475
|
|
474
476
|
def _on_scriptrunner_event(
|
475
477
|
self,
|
@@ -481,7 +483,6 @@ class AppSession:
|
|
481
483
|
page_script_hash: str | None = None,
|
482
484
|
fragment_ids_this_run: list[str] | None = None,
|
483
485
|
pages: dict[PageHash, PageInfo] | None = None,
|
484
|
-
clear_forward_msg_queue: bool = True,
|
485
486
|
) -> None:
|
486
487
|
"""Called when our ScriptRunner emits an event.
|
487
488
|
|
@@ -499,7 +500,6 @@ class AppSession:
|
|
499
500
|
page_script_hash,
|
500
501
|
fragment_ids_this_run,
|
501
502
|
pages,
|
502
|
-
clear_forward_msg_queue,
|
503
503
|
)
|
504
504
|
)
|
505
505
|
|
@@ -513,7 +513,6 @@ class AppSession:
|
|
513
513
|
page_script_hash: str | None = None,
|
514
514
|
fragment_ids_this_run: list[str] | None = None,
|
515
515
|
pages: dict[PageHash, PageInfo] | None = None,
|
516
|
-
clear_forward_msg_queue: bool = True,
|
517
516
|
) -> None:
|
518
517
|
"""Handle a ScriptRunner event.
|
519
518
|
|
@@ -585,8 +584,7 @@ class AppSession:
|
|
585
584
|
if page_script_hash != self._client_state.page_script_hash:
|
586
585
|
self._client_state.page_script_hash = page_script_hash
|
587
586
|
|
588
|
-
|
589
|
-
self._clear_queue()
|
587
|
+
self._clear_queue(fragment_ids_this_run)
|
590
588
|
|
591
589
|
self._enqueue_forward_msg(
|
592
590
|
self._create_new_session_message(
|
@@ -81,7 +81,11 @@ class ForwardMsgQueue:
|
|
81
81
|
self._delta_index_map[delta_key] = len(self._queue)
|
82
82
|
self._queue.append(msg)
|
83
83
|
|
84
|
-
def clear(
|
84
|
+
def clear(
|
85
|
+
self,
|
86
|
+
retain_lifecycle_msgs: bool = False,
|
87
|
+
fragment_ids_this_run: list[str] | None = None,
|
88
|
+
) -> None:
|
85
89
|
"""Clear the queue, potentially retaining lifecycle messages.
|
86
90
|
|
87
91
|
The retain_lifecycle_msgs argument exists because in some cases (in particular
|
@@ -89,7 +93,12 @@ class ForwardMsgQueue:
|
|
89
93
|
to remove certain messages from the queue as doing so may cause the client to
|
90
94
|
not hear about important script lifecycle events (such as the script being
|
91
95
|
stopped early in order to be rerun).
|
96
|
+
|
97
|
+
If fragment_ids_this_run is provided, delta messages not belonging to any
|
98
|
+
fragment or belonging to a fragment not in fragment_ids_this_run will be
|
99
|
+
preserved to prevent clearing messages unrelated to the running fragments.
|
92
100
|
"""
|
101
|
+
|
93
102
|
if not retain_lifecycle_msgs:
|
94
103
|
self._queue = []
|
95
104
|
else:
|
@@ -103,6 +112,24 @@ class ForwardMsgQueue:
|
|
103
112
|
"session_status_changed",
|
104
113
|
"parent_message",
|
105
114
|
}
|
115
|
+
or (
|
116
|
+
# preserve all messages if this is a fragment rerun and...
|
117
|
+
fragment_ids_this_run is not None
|
118
|
+
and (
|
119
|
+
# the message is not a delta message
|
120
|
+
# (not associated with a fragment) or...
|
121
|
+
msg.delta is None
|
122
|
+
or (
|
123
|
+
# it is a delta but not associated with any of the passed
|
124
|
+
# fragments
|
125
|
+
msg.delta is not None
|
126
|
+
and (
|
127
|
+
msg.delta.fragment_id is None
|
128
|
+
or msg.delta.fragment_id not in fragment_ids_this_run
|
129
|
+
)
|
130
|
+
)
|
131
|
+
)
|
132
|
+
)
|
106
133
|
]
|
107
134
|
|
108
135
|
self._delta_index_map = {}
|
@@ -439,8 +439,6 @@ class ScriptRunner:
|
|
439
439
|
else main_page_info["page_script_hash"]
|
440
440
|
)
|
441
441
|
|
442
|
-
fragment_ids_this_run = list(rerun_data.fragment_id_queue)
|
443
|
-
|
444
442
|
ctx = self._get_script_run_ctx()
|
445
443
|
# Clear widget state on page change. This normally happens implicitly
|
446
444
|
# in the script run cleanup steps, but doing it explicitly ensures
|
@@ -462,6 +460,8 @@ class ScriptRunner:
|
|
462
460
|
widget_ids = {w.id for w in rerun_data.widget_states.widgets}
|
463
461
|
self._session_state.on_script_finished(widget_ids)
|
464
462
|
|
463
|
+
fragment_ids_this_run = list(rerun_data.fragment_id_queue)
|
464
|
+
|
465
465
|
ctx.reset(
|
466
466
|
query_string=rerun_data.query_string,
|
467
467
|
page_script_hash=page_script_hash,
|
@@ -469,22 +469,12 @@ class ScriptRunner:
|
|
469
469
|
)
|
470
470
|
self._pages_manager.reset_active_script_hash()
|
471
471
|
|
472
|
-
# We want to clear the forward_msg_queue during full script runs and
|
473
|
-
# fragment-scoped fragment reruns. For normal fragment runs, clearing the
|
474
|
-
# forward_msg_queue may cause us to drop messages either corresponding to
|
475
|
-
# other, unrelated fragments or that this fragment run depends on.
|
476
|
-
fragment_ids_this_run = rerun_data.fragment_id_queue
|
477
|
-
clear_forward_msg_queue = (
|
478
|
-
not fragment_ids_this_run or rerun_data.is_fragment_scoped_rerun
|
479
|
-
)
|
480
|
-
|
481
472
|
self.on_event.send(
|
482
473
|
self,
|
483
474
|
event=ScriptRunnerEvent.SCRIPT_STARTED,
|
484
475
|
page_script_hash=page_script_hash,
|
485
476
|
fragment_ids_this_run=fragment_ids_this_run,
|
486
477
|
pages=self._pages_manager.get_pages(),
|
487
|
-
clear_forward_msg_queue=clear_forward_msg_queue,
|
488
478
|
)
|
489
479
|
|
490
480
|
# Compile the script. Any errors thrown here will be surfaced
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"files": {
|
3
3
|
"main.css": "./static/css/main.5513bd04.css",
|
4
|
-
"main.js": "./static/js/main.
|
4
|
+
"main.js": "./static/js/main.8721af5a.js",
|
5
5
|
"static/js/6679.265ca09c.chunk.js": "./static/js/6679.265ca09c.chunk.js",
|
6
6
|
"static/js/9464.7e9a3c0a.chunk.js": "./static/js/9464.7e9a3c0a.chunk.js",
|
7
7
|
"static/js/9077.e0a8db2a.chunk.js": "./static/js/9077.e0a8db2a.chunk.js",
|
@@ -153,6 +153,6 @@
|
|
153
153
|
},
|
154
154
|
"entrypoints": [
|
155
155
|
"static/css/main.5513bd04.css",
|
156
|
-
"static/js/main.
|
156
|
+
"static/js/main.8721af5a.js"
|
157
157
|
]
|
158
158
|
}
|
streamlit/static/index.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.8721af5a.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|