@rerun-io/web-viewer 0.16.0-rc.2 → 0.16.0-rc.3

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/README.md CHANGED
@@ -41,7 +41,7 @@ viewer.stop();
41
41
  ```
42
42
 
43
43
  The `rrd` in the snippet above should be a URL pointing to either:
44
- - A hosted `.rrd` file, such as <https://app.rerun.io/version/0.16.0-rc.2/examples/dna.rrd>
44
+ - A hosted `.rrd` file, such as <https://app.rerun.io/version/0.16.0-rc.3/examples/dna.rrd>
45
45
  - A WebSocket connection to the SDK opened via the [`serve`](https://www.rerun.io/docs/reference/sdk-operating-modes#serve) API
46
46
 
47
47
  If `rrd` is not set, the Viewer will display the same welcome screen as <https://app.rerun.io>.
package/index.d.ts CHANGED
@@ -18,8 +18,13 @@ declare module '@rerun-io/web-viewer' {
18
18
  * The viewer must have been started via `WebViewer.start`.
19
19
  *
20
20
  * @param rrd URLs to `.rrd` files or WebSocket connections to our SDK.
21
+ * @param options
22
+ * - follow_if_http: Whether Rerun should open the resource in "Following" mode when streaming
23
+ * from an HTTP url. Defaults to `false`. Ignored for non-HTTP URLs.
21
24
  */
22
- open(rrd: string | string[]): void;
25
+ open(rrd: string | string[], options?: {
26
+ follow_if_http?: boolean;
27
+ }): void;
23
28
  /**
24
29
  * Close a recording.
25
30
  *
@@ -129,8 +134,18 @@ declare module '@rerun-io/web-viewer/re_viewer.js' {
129
134
  panic_message(): string | undefined;
130
135
 
131
136
  panic_callstack(): string | undefined;
132
-
133
- add_receiver(url: string): void;
137
+ /**
138
+ * Add a new receiver streaming data from the given url.
139
+ *
140
+ * If `follow_if_http` is `true`, and the url is an HTTP source, the viewer will open the stream
141
+ * in `Following` mode rather than `Playing` mode.
142
+ *
143
+ * Websocket streams are always opened in `Following` mode.
144
+ *
145
+ * It is an error to open a channel twice with the same id.
146
+ *
147
+ */
148
+ add_receiver(url: string, follow_if_http?: boolean): void;
134
149
 
135
150
  remove_receiver(url: string): void;
136
151
  /**
package/index.d.ts.map CHANGED
@@ -18,5 +18,5 @@
18
18
  null,
19
19
  null
20
20
  ],
21
- "mappings": ";cAuBaA,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkJTC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBC/JPC,SAASA;;eAGZC,wBAAwBA;;;;;;;;;;;;;;eAuBxBC,kBAAkBA;;;;;;;;;;eAmBlBC,oBAAoBA;;;;;;;;eAapBC,SAASA"
21
+ "mappings": ";cAuBaA,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqJTC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBClKPC,SAASA;;eAGZC,wBAAwBA;;;;;;;;;;;;;;eAuBxBC,kBAAkBA;;;;;;;;;;eAmBlBC,oBAAoBA;;;;;;;;eAapBC,SAASA"
22
22
  }
package/index.js CHANGED
@@ -88,14 +88,17 @@ export class WebViewer {
88
88
  * @see {WebViewer.start}
89
89
  *
90
90
  * @param {string | string[]} rrd URLs to `.rrd` files or WebSocket connections to our SDK.
91
+ * @param {{ follow_if_http?: boolean }} options
92
+ * - follow_if_http: Whether Rerun should open the resource in "Following" mode when streaming
93
+ * from an HTTP url. Defaults to `false`. Ignored for non-HTTP URLs.
91
94
  */
92
- open(rrd) {
95
+ open(rrd, options = {}) {
93
96
  if (!this.#handle) {
94
97
  throw new Error(`attempted to open \`${rrd}\` in a stopped viewer`);
95
98
  }
96
99
  const urls = Array.isArray(rrd) ? rrd : [rrd];
97
100
  for (const url of urls) {
98
- this.#handle.add_receiver(url);
101
+ this.#handle.add_receiver(url, options.follow_if_http);
99
102
  if (this.#handle.has_panicked()) {
100
103
  throw new Error(`Web viewer crashed: ${this.#handle.panic_message()}`);
101
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rerun-io/web-viewer",
3
- "version": "0.16.0-rc.2",
3
+ "version": "0.16.0-rc.3",
4
4
  "description": "Embed the Rerun web viewer in your app",
5
5
  "licenses": [
6
6
  {
package/re_viewer.d.ts CHANGED
@@ -99,9 +99,18 @@ export class WebHandle {
99
99
  */
100
100
  panic_callstack(): string | undefined;
101
101
  /**
102
+ * Add a new receiver streaming data from the given url.
103
+ *
104
+ * If `follow_if_http` is `true`, and the url is an HTTP source, the viewer will open the stream
105
+ * in `Following` mode rather than `Playing` mode.
106
+ *
107
+ * Websocket streams are always opened in `Following` mode.
108
+ *
109
+ * It is an error to open a channel twice with the same id.
102
110
  * @param {string} url
111
+ * @param {boolean | undefined} [follow_if_http]
103
112
  */
104
- add_receiver(url: string): void;
113
+ add_receiver(url: string, follow_if_http?: boolean): void;
105
114
  /**
106
115
  * @param {string} url
107
116
  */
package/re_viewer_bg.js CHANGED
@@ -10,20 +10,6 @@ heap.push(undefined, null, true, false);
10
10
 
11
11
  function getObject(idx) { return heap[idx]; }
12
12
 
13
- let heap_next = heap.length;
14
-
15
- function dropObject(idx) {
16
- if (idx < 132) return;
17
- heap[idx] = heap_next;
18
- heap_next = idx;
19
- }
20
-
21
- function takeObject(idx) {
22
- const ret = getObject(idx);
23
- dropObject(idx);
24
- return ret;
25
- }
26
-
27
13
  let WASM_VECTOR_LEN = 0;
28
14
 
29
15
  let cachedUint8Memory0 = null;
@@ -103,6 +89,20 @@ function getInt32Memory0() {
103
89
  return cachedInt32Memory0;
104
90
  }
105
91
 
92
+ let heap_next = heap.length;
93
+
94
+ function dropObject(idx) {
95
+ if (idx < 132) return;
96
+ heap[idx] = heap_next;
97
+ heap_next = idx;
98
+ }
99
+
100
+ function takeObject(idx) {
101
+ const ret = getObject(idx);
102
+ dropObject(idx);
103
+ return ret;
104
+ }
105
+
106
106
  const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
107
107
 
108
108
  let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
@@ -222,11 +222,11 @@ function makeMutClosure(arg0, arg1, dtor, f) {
222
222
  return real;
223
223
  }
224
224
  function __wbg_adapter_32(arg0, arg1) {
225
- wasm.wasm_bindgen__convert__closures__invoke0_mut__hfd827e3087c96cca(arg0, arg1);
225
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5b1e3d49288de840(arg0, arg1);
226
226
  }
227
227
 
228
228
  function __wbg_adapter_35(arg0, arg1, arg2) {
229
- wasm.wasm_bindgen__convert__closures__invoke1_mut__hff75729e8d8e3a19(arg0, arg1, addHeapObject(arg2));
229
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ff5e9949b0a21b5(arg0, arg1, addHeapObject(arg2));
230
230
  }
231
231
 
232
232
  function __wbg_adapter_38(arg0, arg1) {
@@ -264,7 +264,7 @@ function __wbg_adapter_55(arg0, arg1, arg2) {
264
264
  }
265
265
 
266
266
  function __wbg_adapter_64(arg0, arg1, arg2) {
267
- wasm.wasm_bindgen__convert__closures__invoke1_mut__hb75772ddcede7981(arg0, arg1, addHeapObject(arg2));
267
+ wasm.wasm_bindgen__convert__closures__invoke1_mut__h1825eb34d949dd69(arg0, arg1, addHeapObject(arg2));
268
268
  }
269
269
 
270
270
  function __wbg_adapter_67(arg0, arg1, arg2) {
@@ -568,12 +568,21 @@ export class WebHandle {
568
568
  }
569
569
  }
570
570
  /**
571
+ * Add a new receiver streaming data from the given url.
572
+ *
573
+ * If `follow_if_http` is `true`, and the url is an HTTP source, the viewer will open the stream
574
+ * in `Following` mode rather than `Playing` mode.
575
+ *
576
+ * Websocket streams are always opened in `Following` mode.
577
+ *
578
+ * It is an error to open a channel twice with the same id.
571
579
  * @param {string} url
580
+ * @param {boolean | undefined} [follow_if_http]
572
581
  */
573
- add_receiver(url) {
582
+ add_receiver(url, follow_if_http) {
574
583
  const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
575
584
  const len0 = WASM_VECTOR_LEN;
576
- wasm.webhandle_add_receiver(this.__wbg_ptr, ptr0, len0);
585
+ wasm.webhandle_add_receiver(this.__wbg_ptr, ptr0, len0, isLikeNone(follow_if_http) ? 0xFFFFFF : follow_if_http ? 1 : 0);
577
586
  }
578
587
  /**
579
588
  * @param {string} url
@@ -622,10 +631,6 @@ export class WebHandle {
622
631
  }
623
632
  }
624
633
 
625
- export function __wbindgen_object_drop_ref(arg0) {
626
- takeObject(arg0);
627
- };
628
-
629
634
  export function __wbindgen_string_get(arg0, arg1) {
630
635
  const obj = getObject(arg1);
631
636
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -635,6 +640,10 @@ export function __wbindgen_string_get(arg0, arg1) {
635
640
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
636
641
  };
637
642
 
643
+ export function __wbindgen_object_drop_ref(arg0) {
644
+ takeObject(arg0);
645
+ };
646
+
638
647
  export function __wbindgen_string_new(arg0, arg1) {
639
648
  const ret = getStringFromWasm0(arg0, arg1);
640
649
  return addHeapObject(ret);
@@ -687,12 +696,12 @@ export function __wbindgen_number_get(arg0, arg1) {
687
696
  getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
688
697
  };
689
698
 
690
- export function __wbg_new_d5a0639d318f3757() {
699
+ export function __wbg_new_83d61ca77025d6af() {
691
700
  const ret = new Error();
692
701
  return addHeapObject(ret);
693
702
  };
694
703
 
695
- export function __wbg_stack_859d1c42605c06b3(arg0, arg1) {
704
+ export function __wbg_stack_829a27f9f3a30c38(arg0, arg1) {
696
705
  const ret = getObject(arg1).stack;
697
706
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
698
707
  const len1 = WASM_VECTOR_LEN;
@@ -3429,19 +3438,19 @@ export function __wbg_changedTouches_9667f17739458e92(arg0) {
3429
3438
  return addHeapObject(ret);
3430
3439
  };
3431
3440
 
3432
- export function __wbg_warn_87b3c0ae4e05c120(arg0, arg1) {
3441
+ export function __wbg_warn_92f59beb04c257f2(arg0, arg1) {
3433
3442
  console.warn(getStringFromWasm0(arg0, arg1));
3434
3443
  };
3435
3444
 
3436
- export function __wbg_info_6e8225925ec4693f(arg0, arg1) {
3445
+ export function __wbg_info_27e26841845d55b3(arg0, arg1) {
3437
3446
  console.info(getStringFromWasm0(arg0, arg1));
3438
3447
  };
3439
3448
 
3440
- export function __wbg_debug_37a00352e443b759(arg0, arg1) {
3449
+ export function __wbg_debug_5cc8027c90c78a2d(arg0, arg1) {
3441
3450
  console.debug(getStringFromWasm0(arg0, arg1));
3442
3451
  };
3443
3452
 
3444
- export function __wbg_trace_81472c9cac70d900(arg0, arg1) {
3453
+ export function __wbg_trace_9557117b3153e5eb(arg0, arg1) {
3445
3454
  console.trace(getStringFromWasm0(arg0, arg1));
3446
3455
  };
3447
3456
 
@@ -3811,78 +3820,78 @@ export function __wbindgen_memory() {
3811
3820
  return addHeapObject(ret);
3812
3821
  };
3813
3822
 
3814
- export function __wbindgen_closure_wrapper1580(arg0, arg1, arg2) {
3815
- const ret = makeMutClosure(arg0, arg1, 497, __wbg_adapter_32);
3823
+ export function __wbindgen_closure_wrapper2558(arg0, arg1, arg2) {
3824
+ const ret = makeMutClosure(arg0, arg1, 723, __wbg_adapter_32);
3816
3825
  return addHeapObject(ret);
3817
3826
  };
3818
3827
 
3819
- export function __wbindgen_closure_wrapper1582(arg0, arg1, arg2) {
3820
- const ret = makeMutClosure(arg0, arg1, 497, __wbg_adapter_35);
3828
+ export function __wbindgen_closure_wrapper2560(arg0, arg1, arg2) {
3829
+ const ret = makeMutClosure(arg0, arg1, 723, __wbg_adapter_35);
3821
3830
  return addHeapObject(ret);
3822
3831
  };
3823
3832
 
3824
- export function __wbindgen_closure_wrapper3463(arg0, arg1, arg2) {
3825
- const ret = makeMutClosure(arg0, arg1, 1119, __wbg_adapter_38);
3833
+ export function __wbindgen_closure_wrapper3473(arg0, arg1, arg2) {
3834
+ const ret = makeMutClosure(arg0, arg1, 1131, __wbg_adapter_38);
3826
3835
  return addHeapObject(ret);
3827
3836
  };
3828
3837
 
3829
- export function __wbindgen_closure_wrapper6544(arg0, arg1, arg2) {
3830
- const ret = makeMutClosure(arg0, arg1, 2476, __wbg_adapter_41);
3838
+ export function __wbindgen_closure_wrapper6554(arg0, arg1, arg2) {
3839
+ const ret = makeMutClosure(arg0, arg1, 2488, __wbg_adapter_41);
3831
3840
  return addHeapObject(ret);
3832
3841
  };
3833
3842
 
3834
- export function __wbindgen_closure_wrapper6546(arg0, arg1, arg2) {
3835
- const ret = makeMutClosure(arg0, arg1, 2476, __wbg_adapter_44);
3843
+ export function __wbindgen_closure_wrapper6556(arg0, arg1, arg2) {
3844
+ const ret = makeMutClosure(arg0, arg1, 2488, __wbg_adapter_44);
3836
3845
  return addHeapObject(ret);
3837
3846
  };
3838
3847
 
3839
- export function __wbindgen_closure_wrapper6548(arg0, arg1, arg2) {
3840
- const ret = makeMutClosure(arg0, arg1, 2476, __wbg_adapter_47);
3848
+ export function __wbindgen_closure_wrapper6558(arg0, arg1, arg2) {
3849
+ const ret = makeMutClosure(arg0, arg1, 2488, __wbg_adapter_47);
3841
3850
  return addHeapObject(ret);
3842
3851
  };
3843
3852
 
3844
- export function __wbindgen_closure_wrapper19264(arg0, arg1, arg2) {
3845
- const ret = makeMutClosure(arg0, arg1, 7700, __wbg_adapter_50);
3853
+ export function __wbindgen_closure_wrapper19260(arg0, arg1, arg2) {
3854
+ const ret = makeMutClosure(arg0, arg1, 7715, __wbg_adapter_50);
3846
3855
  return addHeapObject(ret);
3847
3856
  };
3848
3857
 
3849
- export function __wbindgen_closure_wrapper19266(arg0, arg1, arg2) {
3850
- const ret = makeMutClosure(arg0, arg1, 7700, __wbg_adapter_50);
3858
+ export function __wbindgen_closure_wrapper19262(arg0, arg1, arg2) {
3859
+ const ret = makeMutClosure(arg0, arg1, 7715, __wbg_adapter_50);
3851
3860
  return addHeapObject(ret);
3852
3861
  };
3853
3862
 
3854
- export function __wbindgen_closure_wrapper25792(arg0, arg1, arg2) {
3855
- const ret = makeMutClosure(arg0, arg1, 10791, __wbg_adapter_55);
3863
+ export function __wbindgen_closure_wrapper25789(arg0, arg1, arg2) {
3864
+ const ret = makeMutClosure(arg0, arg1, 10806, __wbg_adapter_55);
3856
3865
  return addHeapObject(ret);
3857
3866
  };
3858
3867
 
3859
- export function __wbindgen_closure_wrapper25794(arg0, arg1, arg2) {
3860
- const ret = makeMutClosure(arg0, arg1, 10791, __wbg_adapter_55);
3868
+ export function __wbindgen_closure_wrapper25791(arg0, arg1, arg2) {
3869
+ const ret = makeMutClosure(arg0, arg1, 10806, __wbg_adapter_55);
3861
3870
  return addHeapObject(ret);
3862
3871
  };
3863
3872
 
3864
- export function __wbindgen_closure_wrapper25796(arg0, arg1, arg2) {
3865
- const ret = makeMutClosure(arg0, arg1, 10791, __wbg_adapter_55);
3873
+ export function __wbindgen_closure_wrapper25793(arg0, arg1, arg2) {
3874
+ const ret = makeMutClosure(arg0, arg1, 10806, __wbg_adapter_55);
3866
3875
  return addHeapObject(ret);
3867
3876
  };
3868
3877
 
3869
- export function __wbindgen_closure_wrapper25798(arg0, arg1, arg2) {
3870
- const ret = makeMutClosure(arg0, arg1, 10791, __wbg_adapter_55);
3878
+ export function __wbindgen_closure_wrapper25795(arg0, arg1, arg2) {
3879
+ const ret = makeMutClosure(arg0, arg1, 10806, __wbg_adapter_55);
3871
3880
  return addHeapObject(ret);
3872
3881
  };
3873
3882
 
3874
- export function __wbindgen_closure_wrapper32378(arg0, arg1, arg2) {
3875
- const ret = makeMutClosure(arg0, arg1, 13734, __wbg_adapter_64);
3883
+ export function __wbindgen_closure_wrapper31528(arg0, arg1, arg2) {
3884
+ const ret = makeMutClosure(arg0, arg1, 13191, __wbg_adapter_64);
3876
3885
  return addHeapObject(ret);
3877
3886
  };
3878
3887
 
3879
- export function __wbindgen_closure_wrapper32729(arg0, arg1, arg2) {
3880
- const ret = makeMutClosure(arg0, arg1, 13901, __wbg_adapter_67);
3888
+ export function __wbindgen_closure_wrapper32725(arg0, arg1, arg2) {
3889
+ const ret = makeMutClosure(arg0, arg1, 13916, __wbg_adapter_67);
3881
3890
  return addHeapObject(ret);
3882
3891
  };
3883
3892
 
3884
- export function __wbindgen_closure_wrapper32791(arg0, arg1, arg2) {
3885
- const ret = makeMutClosure(arg0, arg1, 13914, __wbg_adapter_70);
3893
+ export function __wbindgen_closure_wrapper32787(arg0, arg1, arg2) {
3894
+ const ret = makeMutClosure(arg0, arg1, 13929, __wbg_adapter_70);
3886
3895
  return addHeapObject(ret);
3887
3896
  };
3888
3897
 
package/re_viewer_bg.wasm CHANGED
Binary file
@@ -8,7 +8,7 @@ export function webhandle_destroy(a: number): void;
8
8
  export function webhandle_has_panicked(a: number): number;
9
9
  export function webhandle_panic_message(a: number, b: number): void;
10
10
  export function webhandle_panic_callstack(a: number, b: number): void;
11
- export function webhandle_add_receiver(a: number, b: number, c: number): void;
11
+ export function webhandle_add_receiver(a: number, b: number, c: number, d: number): void;
12
12
  export function webhandle_remove_receiver(a: number, b: number, c: number): void;
13
13
  export function webhandle_open_channel(a: number, b: number, c: number, d: number, e: number): void;
14
14
  export function webhandle_close_channel(a: number, b: number, c: number): void;
@@ -79,8 +79,8 @@ export function intounderlyingsource_cancel(a: number): void;
79
79
  export function __wbindgen_malloc(a: number, b: number): number;
80
80
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
81
81
  export const __wbindgen_export_2: WebAssembly.Table;
82
- export function wasm_bindgen__convert__closures__invoke0_mut__hfd827e3087c96cca(a: number, b: number): void;
83
- export function wasm_bindgen__convert__closures__invoke1_mut__hff75729e8d8e3a19(a: number, b: number, c: number): void;
82
+ export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5b1e3d49288de840(a: number, b: number): void;
83
+ export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ff5e9949b0a21b5(a: number, b: number, c: number): void;
84
84
  export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he3e77c8746920ad8(a: number, b: number): void;
85
85
  export function wasm_bindgen__convert__closures__invoke1_mut__h545ec82ded2d9534(a: number, b: number, c: number): void;
86
86
  export function wasm_bindgen__convert__closures__invoke0_mut__h3e523de377ad9304(a: number, b: number): void;
@@ -88,7 +88,7 @@ export function __wbindgen_add_to_stack_pointer(a: number): number;
88
88
  export function wasm_bindgen__convert__closures__invoke0_mut__h48ee5bf1e8dab96d(a: number, b: number, c: number): void;
89
89
  export function wasm_bindgen__convert__closures__invoke1_mut__h389a8557fc3a6c1d(a: number, b: number, c: number): void;
90
90
  export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4415f29ff9ffe1e6(a: number, b: number, c: number): void;
91
- export function wasm_bindgen__convert__closures__invoke1_mut__hb75772ddcede7981(a: number, b: number, c: number): void;
91
+ export function wasm_bindgen__convert__closures__invoke1_mut__h1825eb34d949dd69(a: number, b: number, c: number): void;
92
92
  export function wasm_bindgen__convert__closures__invoke1_mut__h74463477a347a8fe(a: number, b: number, c: number): void;
93
93
  export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__haf670f9b2e2edd2a(a: number, b: number, c: number): void;
94
94
  export function __wbindgen_free(a: number, b: number, c: number): void;