Skip to content

Conversation

@wch
Copy link
Collaborator

@wch wch commented Mar 8, 2025

This PR updates the TypeScript types to Shiny 1.10.0, to be in sync the version of shiny.js that we use.

I also changed the references from Shiny to window.Shiny, in keeping with the practice inside the Shiny Typescript source code. See: rstudio/shiny#4197 (comment)

This also removes unneeded use of $(function() { .... }), where just running the .... would suffice. For example, this code:

$(function () {
  window.Shiny.addCustomMessageHandler("shinyDataFrameMessage", ...);
});

becomes just

window.Shiny.addCustomMessageHandler("shinyDataFrameMessage", ...);

This is OK because by the time any of this code runs, the Shiny object is already available. If there is code that needed to wait for the session to be initialized, then it originally would have had $(document).on('shiny:sessioninitialized', ...), or Shiny.initializedPromise.then(...) (which was available as of shiny.js 1.9.0) -- but there were no such instances in the code.

@wch wch requested a review from schloerke March 8, 2025 16:00
@wch wch force-pushed the update-shinyjs-types branch from aa24e14 to db4ad56 Compare March 8, 2025 16:05
@wch wch mentioned this pull request Mar 8, 2025
@schloerke schloerke merged commit 4245ebe into main Mar 11, 2025
41 checks passed
@schloerke schloerke deleted the update-shinyjs-types branch March 11, 2025 16:49
schloerke added a commit that referenced this pull request Mar 11, 2025
* main:
  chore: Use details for extra info from error message (#1903)
  ci: adds action to lint conventional commits (#1902)
  build: JS build script updates (#1894)
  chore: Rename temp environ names (for launching browser) to avoid conflict with local environ names (#1899)
  build: Update shiny TS types to Shiny 1.10.0 (#1893)
  chore: Use `shiny.module` to import re-exported values from `shiny._namespaces` (#1898)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants