@gradio/client 1.15.4 → 1.15.6
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.
- package/CHANGELOG.md +13 -0
- package/dist/__vite-browser-external-DYxpcVy9.js +4 -0
- package/dist/browser.es.js +2069 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/helpers/api_info.d.ts +1 -1
- package/dist/helpers/api_info.d.ts.map +1 -1
- package/dist/helpers/init_helpers.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -27
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/stream.d.ts.map +1 -1
- package/dist/utils/submit.d.ts.map +1 -1
- package/package.json +9 -4
- package/src/client.ts +29 -4
- package/src/constants.ts +1 -0
- package/src/helpers/api_info.ts +12 -0
- package/src/helpers/init_helpers.ts +30 -18
- package/src/index.ts +2 -0
- package/src/types.ts +2 -0
- package/src/utils/stream.ts +3 -2
- package/src/utils/submit.ts +9 -2
- package/src/vite-env.d.ts +2 -0
- package/vite.config.js +10 -2
package/src/utils/submit.ts
CHANGED
@@ -159,7 +159,7 @@ export function submit(
|
|
159
159
|
}
|
160
160
|
|
161
161
|
const resolve_heartbeat = async (config: Config): Promise<void> => {
|
162
|
-
await this.
|
162
|
+
await this._resolve_heartbeat(config);
|
163
163
|
};
|
164
164
|
|
165
165
|
async function handle_render_config(render_config: any): Promise<void> {
|
@@ -597,6 +597,7 @@ export function submit(
|
|
597
597
|
fire_event({
|
598
598
|
type: "status",
|
599
599
|
stage: "error",
|
600
|
+
broken: true,
|
600
601
|
message: BROKEN_CONNECTION_MSG,
|
601
602
|
queue: true,
|
602
603
|
endpoint: _endpoint,
|
@@ -629,8 +630,12 @@ export function submit(
|
|
629
630
|
});
|
630
631
|
} else if (type === "complete") {
|
631
632
|
complete = status;
|
632
|
-
} else if (
|
633
|
+
} else if (
|
634
|
+
type == "unexpected_error" ||
|
635
|
+
type == "broken_connection"
|
636
|
+
) {
|
633
637
|
console.error("Unexpected error", status?.message);
|
638
|
+
const broken = type === "broken_connection";
|
634
639
|
fire_event({
|
635
640
|
type: "status",
|
636
641
|
stage: "error",
|
@@ -638,6 +643,8 @@ export function submit(
|
|
638
643
|
status?.message || "An Unexpected Error Occurred!",
|
639
644
|
queue: true,
|
640
645
|
endpoint: _endpoint,
|
646
|
+
broken,
|
647
|
+
session_not_found: status?.session_not_found,
|
641
648
|
fn_index,
|
642
649
|
time: new Date()
|
643
650
|
});
|
package/src/vite-env.d.ts
CHANGED
package/vite.config.js
CHANGED
@@ -4,17 +4,23 @@ import { svelte } from "@sveltejs/vite-plugin-svelte";
|
|
4
4
|
const TEST_MODE = process.env.TEST_MODE || "happy-dom";
|
5
5
|
|
6
6
|
export default defineConfig(({ mode }) => {
|
7
|
+
const production = mode === "production";
|
8
|
+
const isBrowserBuild = process.env.BROWSER_BUILD === "true";
|
9
|
+
|
7
10
|
if (mode === "preview") {
|
8
11
|
return {
|
9
12
|
entry: "index.html"
|
10
13
|
};
|
11
14
|
}
|
15
|
+
|
12
16
|
return {
|
13
17
|
build: {
|
18
|
+
emptyOutDir: false,
|
14
19
|
lib: {
|
15
20
|
entry: "src/index.ts",
|
16
21
|
formats: ["es"],
|
17
|
-
fileName: (format) =>
|
22
|
+
fileName: (format) =>
|
23
|
+
isBrowserBuild ? `browser.${format}.js` : `index.${format}.js`
|
18
24
|
},
|
19
25
|
rollupOptions: {
|
20
26
|
input: "src/index.ts",
|
@@ -24,7 +30,9 @@ export default defineConfig(({ mode }) => {
|
|
24
30
|
}
|
25
31
|
},
|
26
32
|
plugins: [svelte()],
|
27
|
-
|
33
|
+
define: {
|
34
|
+
BROWSER_BUILD: JSON.stringify(isBrowserBuild)
|
35
|
+
},
|
28
36
|
mode: process.env.MODE || "development",
|
29
37
|
test: {
|
30
38
|
include: ["./src/test/*.test.*"],
|