Skip to content

Conversation

@tconkling
Copy link
Contributor

@tconkling tconkling commented Mar 20, 2023

sendMessageToHost delivers "guest to host" messages to the Streamlit app's parent iframe (if one exists). It's currently implemented as a global function. This PR removes the global function; callers must now take the function as a property.

(withHostCommunicationHOC already passes the function to its wrapped component, so this isn't a huge change.)

@tconkling tconkling changed the title sendMessageToHost: interface-ize sendMessageToHost: no longer a global function Mar 20, 2023
@tconkling tconkling added the security-assessment-completed Security assessment has been completed for PR label Mar 20, 2023
* develop:
  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)
beforeEach(() => (originalLocation = window.location))
afterEach(() => (window.location = originalLocation))

it("sends UPDATE_HASH message to host", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was missing before

expect(getFaviconHref()).toBe(PIZZA_TWEMOJI_URL)
})

it("sends SET_PAGE_FAVICON message to host", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test was also missing before

@tconkling tconkling marked this pull request as ready for review March 20, 2023 23:34
@tconkling tconkling requested a review from willhuang1997 March 20, 2023 23:34
Copy link
Contributor

@willhuang1997 willhuang1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. thanks for adding the missing test :)

@tconkling tconkling merged commit 288deed into streamlit:develop Mar 21, 2023
@tconkling tconkling deleted the tim/SendMessageToHostInterface branch March 21, 2023 17:42
tconkling added a commit to tconkling/streamlit that referenced this pull request Mar 27, 2023
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants