In fact, this is mainly for the convenience of third-party developers and security considerations, because it is obviously impossible to require all application developers to use the same technology stack, and it is impossible to guarantee that third-party code can run on the same thread as the system without happening. Any problems (even malicious code). I mainly draw on the existing web-based plug-in systems such as vscode for web, figma, applets, electron, etc. They all use a multi-threaded model and provide all system APIs to the main thread.
I wrote an article before about the js sandbox attempt. At present, I have established an EventEmitter-based sandbox interface, and implemented two runtime sandboxes, web worker and quickjs virtual machine, and then implemented the system API and Added various applications to enrich the system.
Another key point of using multi-threading is performance. We may have some large applications, such as maps or 3D content. If multi-threading is not used, it is very difficult to run all functions normally without stalling. . .
Ya I also have 3rd party app support on my list of to do's. I was thinking of a type of controlled iframe with an api using post messages or a broadcast channel or something. It's fun stuff anyway. I tried to keep most of the code self contained for the existing apps.
In fact, this is mainly for the convenience of third-party developers and security considerations, because it is obviously impossible to require all application developers to use the same technology stack, and it is impossible to guarantee that third-party code can run on the same thread as the system without happening. Any problems (even malicious code). I mainly draw on the existing web-based plug-in systems such as vscode for web, figma, applets, electron, etc. They all use a multi-threaded model and provide all system APIs to the main thread.
I wrote an article before about the js sandbox attempt. At present, I have established an EventEmitter-based sandbox interface, and implemented two runtime sandboxes, web worker and quickjs virtual machine, and then implemented the system API and Added various applications to enrich the system.
blog.rxliuli.com/p/bafce41b0e68409...
Another key point of using multi-threading is performance. We may have some large applications, such as maps or 3D content. If multi-threading is not used, it is very difficult to run all functions normally without stalling. . .
Ya I also have 3rd party app support on my list of to do's. I was thinking of a type of controlled iframe with an api using post messages or a broadcast channel or something. It's fun stuff anyway. I tried to keep most of the code self contained for the existing apps.
Thanks! I will check this out. Performance is my focus for 2022 in regards to my app improvements.