File tree 2 files changed +25
-13
lines changed
2 files changed +25
-13
lines changed Original file line number Diff line number Diff line change 64
64
- Make typescript types for webxdc available as a standalone package so that
65
65
developers can use this in their own projects.
66
66
67
- ## Architecture
68
-
69
- - can we have only a single web socket that handles all frontends? We could
70
- broadcast to all clients at once. The drawbacks of this are that the client
71
- becomes dependent on more than just its own backend, and that we cannot
72
- easily distinguish between instances and make one of them broken in some way.
73
- It might also break CSP.
74
-
75
67
## Other
76
68
77
69
- Update webxdc specification based on what I learned about it.
Original file line number Diff line number Diff line change 1
- - I tried hard to make things work with Vite but had to go back to webpack to
2
- gain the control I needed -- I need to be able to produce a frontend UI
3
- bundle as well as the simulator ` webxdc.js ` bundle with a specific name. I
4
- couldn't get Vite to support that. webpack provides the required control, at
5
- the cost of more configuration.
1
+ # Design notes
2
+
3
+ ## one websocket per instance
4
+
5
+ Each instance has its own websocket it uses to communicate to the backend. It
6
+ can be argued that only a single websocket is necessary that all instances use.
7
+ This would allow a broadcast of messages to all clients at once.
8
+
9
+ But there are drawbacks as the client becomes dependent on more than its own
10
+ backend. This would require an exception in CSP, which is doable. More
11
+ difficult is that the client would need to know which port to connect to, which
12
+ would somehow need to be injected into ` webxdc.js ` . In the current architecture
13
+ the client can easily talk to its own host without any further knowledge.
14
+
15
+ ## Webpack versus vite
16
+
17
+ I tried hard to make things work with Vite as this was already in use with
18
+ other projects within the webxdc org, but had to go to webpack to gain the
19
+ control I needed -- I need to be able to produce a frontend UI bundle as well
20
+ as the simulator ` webxdc.js ` bundle with a specific name. I couldn't get Vite
21
+ to support that. webpack provides the required control, at the cost of more
22
+ configuration.
23
+
24
+ As an alternative I could have used ` rollup ` which should offer the control
25
+ and is what vite itself uses.
You can’t perform that action at this time.
0 commit comments