mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-10 23:48:01 -05:00
Compare commits
2 Commits
set_app_st
...
config-cle
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
281dffde10 | ||
|
|
0f714cff34 |
@@ -79,7 +79,8 @@ async function build(
|
||||
return esbuildBuild({
|
||||
incremental: incremental,
|
||||
watch: watch,
|
||||
target: "es5",
|
||||
target: "es2020",
|
||||
format: "iife",
|
||||
preserveSymlinks: true,
|
||||
...opts,
|
||||
}).then((x) => {
|
||||
|
||||
@@ -43,6 +43,8 @@ type OnSuccessRequest = (value: ResponseValue) => void;
|
||||
type OnErrorRequest = (err: string) => void;
|
||||
type InputValues = { [key: string]: unknown };
|
||||
|
||||
type MessageValue = Parameters<WebSocket["send"]>[0];
|
||||
|
||||
//// 2021/03 - TypeScript conversion note:
|
||||
// These four variables were moved from being internally defined to being defined globally within the file.
|
||||
// Before the TypeScript conversion, the values where attached to `window.Shiny.addCustomMessageHandler()`.
|
||||
@@ -127,7 +129,7 @@ class ShinyApp {
|
||||
// Conditional bindings (show/hide element based on expression)
|
||||
$conditionals = {};
|
||||
|
||||
$pendingMessages: string[] = [];
|
||||
$pendingMessages: MessageValue[] = [];
|
||||
$activeRequests: {
|
||||
[key: number]: { onSuccess: OnSuccessRequest; onError: OnErrorRequest };
|
||||
} = {};
|
||||
@@ -381,7 +383,7 @@ class ShinyApp {
|
||||
onError: onError,
|
||||
};
|
||||
|
||||
let msg = JSON.stringify({
|
||||
let msg: Blob | string = JSON.stringify({
|
||||
method: method,
|
||||
args: args,
|
||||
tag: requestId,
|
||||
@@ -423,13 +425,13 @@ class ShinyApp {
|
||||
|
||||
const blob: Blob = new Blob(payload);
|
||||
|
||||
msg = blob as unknown as string;
|
||||
msg = blob;
|
||||
}
|
||||
|
||||
this.$sendMsg(msg);
|
||||
}
|
||||
|
||||
$sendMsg(msg: string): void {
|
||||
$sendMsg(msg: MessageValue): void {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
if (!this.$socket!.readyState) {
|
||||
this.$pendingMessages.push(msg);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"declaration": true,
|
||||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"target": "ES2020",
|
||||
"moduleResolution": "node",
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"declaration": true,
|
||||
|
||||
Reference in New Issue
Block a user