y-octo
y-octo copied to clipboard
add more compatibility test baseline using yjs
Currently we still use yrs as a baseline for binary compatible behavior, which increases testing complexity
I consider introducing a js runtime to provide the execution results of yjs as a reference benchmark during testing
It may be a convenient choice to directly use node to execute and output to stdio. Another option is to introduce quickjs or a similar streamlined js runtime, but this will increase compilation time and dependency complexity.
I will first investigate the feasibility of using nodejs to obtain execution results. This is the easiest way
### Tasks
- [x] https://github.com/toeverything/y-octo/pull/4
- [x] impl the function binding of node: #6
- [ ] test case for verify the data between yjs and y-octo-node #6
Consider using napi-rs to generate node bindings and write compatibility tests in nodejs. This approach has three advantages:
- We can offer node bindings for node.js user that they can has another choose in server side about crdt
- Directly using node bindings to test compatibility allows us to reuse yjs's test cases without extra result processing steps (like figuring out how to transfer yjs results to rust).
- One of the maintainers of napi-rs is a member of our team, making it easier to troubleshoot issues when they arise.