mozilla / tofino

Project Tofino is a browser interaction experiment.
https://mozilla.github.io/tofino
Apache License 2.0
647 stars 68 forks source link

Consider offloading virtual dom rendering to workers #1323

Open victorporof opened 7 years ago

victorporof commented 7 years ago

Let's use react-worker-dom: https://github.com/web-perf/react-worker-dom assuming that the project isn't abandoned.

victorporof commented 7 years ago

Blockers: https://github.com/web-perf/react-worker-dom/issues/5 and https://github.com/web-perf/react-worker-dom/issues/12

axemclion commented 7 years ago

@victorporof The project is not abondoned, but I am waiting for the big changes that Fiber will bring in, before moving it to v15. Looks like other custom renderers are also waiting for this change.

Also, I am the only one working on React-worker-dom, but if you guys plan to use it in production, I could use some help on the project, and would love to collaborate.

victorporof commented 7 years ago

@axemclion Great to hear the project isn't abandoned. I'll have a closer look through the source.

victorporof commented 7 years ago

Discussed this with @joewalker a bit and other potential problems with experimenting with this for a browser frontend stack would be handling ipc communication from the renderer thread to the main thread (don't know if one can import electron's ipcRenderer in workers), and grabbing data from dom nodes in event emitters in components (for example, handling input.onChange and getting the new input element's text contents).

Moving over everything into workers (including all the app state) is probably easy/doable, but looks like we'll need a concrete story for custom message passing / event handling between the worker and renderer.

jsantell commented 7 years ago

Are you running into performance problems where we'll need this?

victorporof commented 7 years ago

Not at the moment, but since this is a browser tech research project, it's definitely worth investigating.