-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exciting! Could you explain more? #2
Comments
Seems like related, but not fully. The idea to run react in webworkers isn't new. I guess there was a talk a couple of years ago, and then there was react-native-dom, which I got interested. But, the difficulty is handling events from DOM. It's really hard to transfer all DOM events. I have some previous work with webworkers like react-hooks-worker and redux-in-worker. Both of these are to avoid transferring the events. But their usages are a bit limited. I'm not super familiar with react-flight or RSC, but the idea of only transferring props clicked me. That might be a solution to bridge between main thread and worker thread. I wasn't so sure but keeping react elements (vdom) referential identity seems to keep states. There are still some to do, but the transfer method I implemented worked so far. I'm happy to discuss about this project with someone. So, please give follow-up questions and also take a deeper look. |
The serializer seems to be the most important part. The most difficult part is, how to resolve the limitation of serialization? Here is my understanding. Q1: How do you serialize JSX object like Q2: How do you serialize function like Q3: It seems that |
I fixed this in v0.0.2. It will now deep-render if the component is not registered. (we may want to come up better ideas with this register mechanism.)
Correct. Non serializable JSX elements can't be transferred. Such components should be registered. See how In react-worker-components,
Yes, you get the point correctly. As noted above, currently, there are registered user-defined components and non-registered user-defined components. registered ones are replaced with string names. non-registered ones must be serializable. I'm not sure if this approach has any other pitfalls. There might be. |
To keep states, element referential identity wasn't important. Maybe only element type (function). |
I haven't looked into this project closely. But I am really excited! Could you explain more?
Is this issue related to this project?
The text was updated successfully, but these errors were encountered: