-
Notifications
You must be signed in to change notification settings - Fork 4k
StreamlitEndpoints.buildMediaURL #6366
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
StreamlitEndpoints.buildMediaURL #6366
Conversation
| host: "streamlit.mock", | ||
| port: 80, | ||
| basePath: "", | ||
| basePath: "mock/base/path", |
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.
I updated this entire test suite to use a non-empty basePath to ensure we're actually testing against it
| const MEDIA_ENDPOINT = "/media" | ||
| const UPLOAD_FILE_ENDPOINT = "/_stcore/upload_file" | ||
| const COMPONENT_ENDPOINT_BASE = "/component" | ||
| const FORWARD_MSG_CACHE_ENDPOINT = "/_stcore/message" |
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.
I pulled all these to the top level of the file for readability
willhuang1997
left a comment
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.
LGTM.
* develop: StreamlitEndpoints.buildMediaURL (streamlit#6366) Set a default for RuntimeConfig.cache_storage_manager (streamlit#6361) FullScreenWrapper: add a type declaration for react context usage (streamlit#6364) Improve st.help (and st.write's usage of st.help!) (streamlit#5857) Fix regression with query_params (streamlit#6348) Have util.calc_md5 also take bytes (streamlit#6358) Improve deploy button (streamlit#6223) Return whether a secrets.toml file is successfully parsed (streamlit#6333) Add `.webp` to list of safe static file extensions (streamlit#6331) AppContext docstrings (streamlit#6353) fix: upgrade command-line-args from 5.0.2 to 5.2.1 (streamlit#6258) fix: upgrade flatbuffers from 1.11.0 to 1.12.0 (streamlit#6259) sendMessageToHost: no longer a global function (streamlit#6345) Tweak no-else-return config options (streamlit#6343) Allow users to set a secrets.toml file in their home directory (streamlit#6230) Add support for number and boolean types in categorical columns (streamlit#6248) Add support for period type in st.table and st.dataframe (streamlit#5429) Add ability to turn off anchors (streamlit#6158) Add sqlalchemy mypy types to test-requirements.txt (streamlit#6329)
Adds
StreamlitEndpoints.buildMediaURLand updatesAudio.tsxto use it. (This is the first of several PRs that will update existing components to use this new API.)buildMediaUri, that takes aBaseUriPartsinstance and handles constructing Streamlit-relative URLs for media files. It has some assumptions about how Streamlit endpoints are named that we want to move away from for the StreamlitView project.StreamlitEndpoints.buildMediaURLto the StreamlitEndpoints interface, and replicates the current implementation inDefaultStreamlitEndpoints.Audio.tsxis updated to use the interface-ized version of the function.