This PR adds documentation on how to integrate web workers in a UI with o1js to coincide with the improvements in the reference implementation that were introduced with this PR. The documentation provides an example of how to use the comlink package introduced in the reference implementation to simplify the communication with web workers.
Closes #1047
Impact
Currently web workers are necessary to build performant and usable UIs with o1js. Integrating and managing web workers with o1js is complex, and hard to manage according to many developers on discord. These developers have requested that we simplify the process. This step by step example documentation coupled with the improved web worker reference implementation improves the DX.
Changes
Sections on worker and worker client setup was added
Instructions on how to use comlink added
Updated UI Implementation code added to documentation steps
Future Plans
The long term goal is to eliminate the need for web workers with updates to o1js. In the short term we are aiming to improve the DX of building UIs with changes like this one. The example implementation and documentation will be incrementally improved until we reach the longer term goal with improvements to o1js.
Summary
This PR adds documentation on how to integrate web workers in a UI with
o1js
to coincide with the improvements in the reference implementation that were introduced with this PR. The documentation provides an example of how to use the comlink package introduced in the reference implementation to simplify the communication with web workers.Closes #1047
Impact
Currently web workers are necessary to build performant and usable UIs with
o1js
. Integrating and managing web workers witho1js
is complex, and hard to manage according to many developers on discord. These developers have requested that we simplify the process. This step by step example documentation coupled with the improved web worker reference implementation improves the DX.Changes
Future Plans
The long term goal is to eliminate the need for web workers with updates to
o1js
. In the short term we are aiming to improve the DX of building UIs with changes like this one. The example implementation and documentation will be incrementally improved until we reach the longer term goal with improvements too1js
.