Skip to content

Commit 0b5e81a

Browse files
committed
Revert "Encode buffers into base64 before serializing & sending from client to server"
This reverts commit 30aedcf.
1 parent 30aedcf commit 0b5e81a

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

js/src/comm.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { encode } from "base64-arraybuffer";
21
import { Throttler } from "./utils";
32

43
// This class is a striped down version of Comm from @jupyter-widgets/base
@@ -30,17 +29,11 @@ export class ShinyComm {
3029
metadata?: any,
3130
buffers?: ArrayBuffer[] | ArrayBufferView[]
3231
): string {
33-
34-
// Encode buffers as base64 before stringifying the message
35-
const buffers_64 = (buffers || []).map((b: ArrayBuffer | ArrayBufferView) => {
36-
const buffer = b instanceof ArrayBuffer ? b : b.buffer;
37-
return encode(buffer);
38-
});
39-
4032
const msg = {
4133
content: {comm_id: this.comm_id, data: data},
4234
metadata: metadata,
43-
buffers: buffers_64,
35+
// TODO: need to _encode_ any buffers into base64 (JSON.stringify just drops them)
36+
buffers: buffers || [],
4437
// this doesn't seem relevant to the widget?
4538
header: {}
4639
};

shinywidgets/static/output.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)