@rstreamlabs/react 1.10.0 → 1.10.2

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useRstream
3
- } from "./chunk-I4FMNQJD.mjs";
3
+ } from "./chunk-YZQKMOHW.mjs";
4
4
 
5
5
  // src/providers/rstream.tsx
6
6
  import * as React from "react";
@@ -150,16 +150,21 @@ function useRstream(options) {
150
150
  clearTimeout(timeout);
151
151
  };
152
152
  } else if (state === "connected") {
153
- setError(null);
153
+ const timeout = setTimeout(() => setError(null), 0);
154
+ return () => clearTimeout(timeout);
154
155
  }
155
156
  } else {
156
- setError(null);
157
+ const timeout = setTimeout(() => setError(null), 0);
158
+ return () => clearTimeout(timeout);
157
159
  }
158
160
  }, [authEnabled, state, error, errorTimeout]);
159
161
  React.useEffect(() => {
160
162
  if (!authEnabled || state !== "connected") {
161
- setClients([]);
162
- setTunnels([]);
163
+ const timeout = setTimeout(() => {
164
+ setClients([]);
165
+ setTunnels([]);
166
+ }, 0);
167
+ return () => clearTimeout(timeout);
163
168
  }
164
169
  }, [authEnabled, connectionKey, state]);
165
170
  return { state, error, tunnels, clients };
@@ -1,5 +1,5 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { ITerminalOptions, Terminal } from '@xterm/xterm';
2
+ import * as React from 'react';
3
3
  import { WebTTYClientConfig, WebTTYExecutionConfig, WebTTYEvents } from '@rstreamlabs/webtty';
4
4
 
5
5
  interface WebTTYTerminalProps extends WebTTYClientConfig, WebTTYExecutionConfig, WebTTYEvents {
@@ -26,6 +26,6 @@ interface WebTTYTerminalProps extends WebTTYClientConfig, WebTTYExecutionConfig,
26
26
  */
27
27
  formatError?: (message: string) => string;
28
28
  }
29
- declare function WebTTYTerminal(props: WebTTYTerminalProps): react_jsx_runtime.JSX.Element;
29
+ declare function WebTTYTerminal(props: WebTTYTerminalProps): React.JSX.Element;
30
30
 
31
31
  export { WebTTYTerminal, type WebTTYTerminalProps };
@@ -1,5 +1,5 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { ITerminalOptions, Terminal } from '@xterm/xterm';
2
+ import * as React from 'react';
3
3
  import { WebTTYClientConfig, WebTTYExecutionConfig, WebTTYEvents } from '@rstreamlabs/webtty';
4
4
 
5
5
  interface WebTTYTerminalProps extends WebTTYClientConfig, WebTTYExecutionConfig, WebTTYEvents {
@@ -26,6 +26,6 @@ interface WebTTYTerminalProps extends WebTTYClientConfig, WebTTYExecutionConfig,
26
26
  */
27
27
  formatError?: (message: string) => string;
28
28
  }
29
- declare function WebTTYTerminal(props: WebTTYTerminalProps): react_jsx_runtime.JSX.Element;
29
+ declare function WebTTYTerminal(props: WebTTYTerminalProps): React.JSX.Element;
30
30
 
31
31
  export { WebTTYTerminal, type WebTTYTerminalProps };
@@ -186,16 +186,21 @@ function useRstream(options) {
186
186
  clearTimeout(timeout);
187
187
  };
188
188
  } else if (state === "connected") {
189
- setError(null);
189
+ const timeout = setTimeout(() => setError(null), 0);
190
+ return () => clearTimeout(timeout);
190
191
  }
191
192
  } else {
192
- setError(null);
193
+ const timeout = setTimeout(() => setError(null), 0);
194
+ return () => clearTimeout(timeout);
193
195
  }
194
196
  }, [authEnabled, state, error, errorTimeout]);
195
197
  React.useEffect(() => {
196
198
  if (!authEnabled || state !== "connected") {
197
- setClients([]);
198
- setTunnels([]);
199
+ const timeout = setTimeout(() => {
200
+ setClients([]);
201
+ setTunnels([]);
202
+ }, 0);
203
+ return () => clearTimeout(timeout);
199
204
  }
200
205
  }, [authEnabled, connectionKey, state]);
201
206
  return { state, error, tunnels, clients };
@@ -1,7 +1,7 @@
1
1
  import "../chunk-2JFL7TS5.mjs";
2
2
  import {
3
3
  useRstream
4
- } from "../chunk-I4FMNQJD.mjs";
4
+ } from "../chunk-YZQKMOHW.mjs";
5
5
  export {
6
6
  useRstream
7
7
  };
package/dist/index.d.mts CHANGED
@@ -1,8 +1,7 @@
1
1
  export { WebTTYTerminal, WebTTYTerminalProps } from './components/index.mjs';
2
2
  export { UseRstreamOptions, useRstream } from './hooks/index.mjs';
3
3
  export { RstreamProvider, useRstreamContext } from './providers/index.mjs';
4
- import 'react/jsx-runtime';
5
4
  import '@xterm/xterm';
5
+ import 'react';
6
6
  import '@rstreamlabs/webtty';
7
7
  import '@rstreamlabs/tunnels';
8
- import 'react';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  export { WebTTYTerminal, WebTTYTerminalProps } from './components/index.js';
2
2
  export { UseRstreamOptions, useRstream } from './hooks/index.js';
3
3
  export { RstreamProvider, useRstreamContext } from './providers/index.js';
4
- import 'react/jsx-runtime';
5
4
  import '@xterm/xterm';
5
+ import 'react';
6
6
  import '@rstreamlabs/webtty';
7
7
  import '@rstreamlabs/tunnels';
8
- import 'react';
package/dist/index.js CHANGED
@@ -415,16 +415,21 @@ function useRstream(options) {
415
415
  clearTimeout(timeout);
416
416
  };
417
417
  } else if (state === "connected") {
418
- setError(null);
418
+ const timeout = setTimeout(() => setError(null), 0);
419
+ return () => clearTimeout(timeout);
419
420
  }
420
421
  } else {
421
- setError(null);
422
+ const timeout = setTimeout(() => setError(null), 0);
423
+ return () => clearTimeout(timeout);
422
424
  }
423
425
  }, [authEnabled, state, error, errorTimeout]);
424
426
  React2.useEffect(() => {
425
427
  if (!authEnabled || state !== "connected") {
426
- setClients([]);
427
- setTunnels([]);
428
+ const timeout = setTimeout(() => {
429
+ setClients([]);
430
+ setTunnels([]);
431
+ }, 0);
432
+ return () => clearTimeout(timeout);
428
433
  }
429
434
  }, [authEnabled, connectionKey, state]);
430
435
  return { state, error, tunnels, clients };
package/dist/index.mjs CHANGED
@@ -5,10 +5,10 @@ import "./chunk-2JFL7TS5.mjs";
5
5
  import {
6
6
  RstreamProvider,
7
7
  useRstreamContext
8
- } from "./chunk-SSAIWCGG.mjs";
8
+ } from "./chunk-UQDRDSGV.mjs";
9
9
  import {
10
10
  useRstream
11
- } from "./chunk-I4FMNQJD.mjs";
11
+ } from "./chunk-YZQKMOHW.mjs";
12
12
  export {
13
13
  RstreamProvider,
14
14
  WebTTYTerminal,
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { UseRstreamOptions, useRstream } from '../hooks/index.mjs';
3
2
  import * as React from 'react';
4
3
  import '@rstreamlabs/tunnels';
@@ -67,6 +66,6 @@ interface RstreamProviderProps {
67
66
  options?: UseRstreamOptions;
68
67
  children: React.ReactNode | ((value: RstreamContextValue) => React.ReactNode);
69
68
  }
70
- declare function RstreamProvider({ options, children }: RstreamProviderProps): react_jsx_runtime.JSX.Element;
69
+ declare function RstreamProvider({ options, children }: RstreamProviderProps): React.JSX.Element;
71
70
 
72
71
  export { RstreamProvider, useRstreamContext };
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { UseRstreamOptions, useRstream } from '../hooks/index.js';
3
2
  import * as React from 'react';
4
3
  import '@rstreamlabs/tunnels';
@@ -67,6 +66,6 @@ interface RstreamProviderProps {
67
66
  options?: UseRstreamOptions;
68
67
  children: React.ReactNode | ((value: RstreamContextValue) => React.ReactNode);
69
68
  }
70
- declare function RstreamProvider({ options, children }: RstreamProviderProps): react_jsx_runtime.JSX.Element;
69
+ declare function RstreamProvider({ options, children }: RstreamProviderProps): React.JSX.Element;
71
70
 
72
71
  export { RstreamProvider, useRstreamContext };
@@ -187,16 +187,21 @@ function useRstream(options) {
187
187
  clearTimeout(timeout);
188
188
  };
189
189
  } else if (state === "connected") {
190
- setError(null);
190
+ const timeout = setTimeout(() => setError(null), 0);
191
+ return () => clearTimeout(timeout);
191
192
  }
192
193
  } else {
193
- setError(null);
194
+ const timeout = setTimeout(() => setError(null), 0);
195
+ return () => clearTimeout(timeout);
194
196
  }
195
197
  }, [authEnabled, state, error, errorTimeout]);
196
198
  React.useEffect(() => {
197
199
  if (!authEnabled || state !== "connected") {
198
- setClients([]);
199
- setTunnels([]);
200
+ const timeout = setTimeout(() => {
201
+ setClients([]);
202
+ setTunnels([]);
203
+ }, 0);
204
+ return () => clearTimeout(timeout);
200
205
  }
201
206
  }, [authEnabled, connectionKey, state]);
202
207
  return { state, error, tunnels, clients };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RstreamProvider,
3
3
  useRstreamContext
4
- } from "../chunk-SSAIWCGG.mjs";
5
- import "../chunk-I4FMNQJD.mjs";
4
+ } from "../chunk-UQDRDSGV.mjs";
5
+ import "../chunk-YZQKMOHW.mjs";
6
6
  export {
7
7
  RstreamProvider,
8
8
  useRstreamContext
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstreamlabs/react",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "React hooks and components for building rstream-enabled UIs.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,26 +45,26 @@
45
45
  "type-check": "tsc --noEmit"
46
46
  },
47
47
  "devDependencies": {
48
- "@turbo/gen": "^2.9.5",
49
- "@types/node": "^25.5.2",
48
+ "@turbo/gen": "^2.10.0",
49
+ "@types/node": "^26.0.1",
50
50
  "@types/react-dom": "19.2.3",
51
- "@types/react": "19.2.14",
51
+ "@types/react": "19.2.17",
52
52
  "eslint-config": "*",
53
53
  "tsup": "^8.5.1",
54
54
  "typescript-config": "*",
55
55
  "typescript": "5.9.3"
56
56
  },
57
57
  "dependencies": {
58
- "@rstreamlabs/rstream": "3.3.0",
59
- "@rstreamlabs/tunnels": "3.4.0",
58
+ "@rstreamlabs/rstream": "3.4.0",
59
+ "@rstreamlabs/tunnels": "3.6.0",
60
60
  "@rstreamlabs/webtty": "1.9.0",
61
61
  "@xterm/addon-fit": "^0.11.0",
62
62
  "@xterm/addon-unicode11": "^0.9.0",
63
63
  "@xterm/addon-web-links": "^0.12.0",
64
64
  "@xterm/addon-webgl": "^0.19.0",
65
65
  "@xterm/xterm": "^6.0.0",
66
- "react-dom": "^19.2.5",
67
- "react": "^19.2.5"
66
+ "react-dom": "^19.2.7",
67
+ "react": "^19.2.7"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@types/react": "*",