Commit 83d4308
Refactors and improves the prototype of a faster JSON-RPC protocol initially contributed by @tsmaeder (See also #10781).
The encoding approach used in the initial POC has some performance drawbacks when encoding plain JSON objects. We refactored the protocol to improve the performance for JSON objects whilst maintaining the excellent performance for encoding objects that contain binary data.
Integrates the new message-rpc prototype into the core messaging API (replacing vscode-ws-jsonrpc).
This has major impacts on the Messaging API as we no longer expose a `Connection` object (which was provided by vscode-ws-jsonrpc) and directly rely on a generic transport `Channel` implementation instead.
- Introduce `Channel` as the main transport concept for messages (instead of the dedicated `Connection` from vscode-jsonrpc)
- Replace usage of `vscode-ws-jsonrpc` with a custom binary RPC protocol.
- Remove 'vscode-ws-jsonrpc' depdency from "@theia/core/shared".
- Refactor all connection providers to use the new binary protocol.
- Ensure that the `RemoteFileSystemProvider` API uses `Uint8Arrays` over plain number arrays. This enables direct serialization as buffers and reduces the overhead of unnecessarily converting from and to `Uint8Arrays`.
- Refactor terminal widget and terminal backend contribution so that the widgets communicates with the underlying terminal process using the new rpc protocol.
- Rework the IPC bootstrap protocol so that it uses a binary pipe for message transmission instead of the `ipc` pipe which only supports string encoding.
- Extend the `JsonRpcProxyFactory` with an optional `RpcConnectionFactory` that enables adopter to creates proxies with a that use a custom `RpcProtocol`/`RpcConnection`.
The plugin API still uses its own RPC protocol implementation. This will be addressed in a follow-up PR. (See #11093)
Fix critical bugs
- GH-11196 Remove dev/debug logoutput from IPCChannel
- GH-11199 Refactor connection provider and channel multiplexer to properly handle a reconnecting backend
- Remove console log in websocket-channel if the socket is not connected. Otherwise we end up in an endless loop.
- Ensure that channels & RpcProtocol instances proplery dispose all resources if the backend disconnects.
- Ensure that all previously open channels and RpcProtocol instances are properly restored once the backend reconnects.
- #11203 Ensure that debugging is handled gracefully (implicitly fixed with the fix for #11199)
- Remove dependency to `reconnecting-websocket` which is no longer needed since the swap to socket.io
Fixes #11196
Fixes #11199
Contributed on behalf of STMicroelectronics.
Co-authored-by: Thomas Mäder <[email protected]>
1 parent 53a272e commit 83d4308
File tree
51 files changed
+2281
-642
lines changed- packages
- core
- src
- browser
- messaging
- common
- message-rpc
- messaging
- electron-browser/messaging
- electron-main/messaging
- node/messaging
- test
- debug/src
- browser
- node
- filesystem/src/common
- plugin-ext/src
- common
- main/browser/debug
- plugin/node/debug
- task/src/node
- terminal/src
- browser
- node
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
51 files changed
+2281
-642
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
| |||
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | | - | |
74 | 72 | | |
75 | 73 | | |
76 | 74 | | |
| |||
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
116 | | - | |
117 | | - | |
| 114 | + | |
118 | 115 | | |
119 | 116 | | |
120 | 117 | | |
| |||
This file was deleted.
This file was deleted.
Lines changed: 34 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
63 | 62 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
68 | 66 | | |
69 | | - | |
70 | | - | |
| 67 | + | |
71 | 68 | | |
72 | 69 | | |
73 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
74 | 90 | | |
75 | | - | |
| 91 | + | |
76 | 92 | | |
77 | 93 | | |
78 | 94 | | |
| |||
82 | 98 | | |
83 | 99 | | |
84 | 100 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
| |||
143 | 151 | | |
144 | 152 | | |
145 | 153 | | |
| 154 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
0 commit comments