processing / p5.js-web-editor

The p5.js Editor is a website for creating p5.js sketches, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! You can create, share, or remix p5.js sketches without needing to download or configure anything.
https://editor.p5js.org
GNU Lesser General Public License v2.1
1.41k stars 1.35k forks source link

Sync sketch open in multiple places using web sockets #1249

Open catarak opened 4 years ago

catarak commented 4 years ago

Nature of issue?

New feature details:

If you have a sketch open in multiple tabs, whether it be the edit or the full screen views, if you edit the code in the edit view, the sketch does not update in the other tabs.

As discussed in #1234 comment, this could be handled in a variety of ways:

plxity commented 4 years ago

@catarak How can we use local storage in this? :thinking:

WebSockets is a good idea to implement this feature.

ashu8912 commented 4 years ago

I think serviceWorker is the more preferred way.

iainnash commented 4 years ago

Would using something like https://github.com/AOHUA/redux-state-sync make sense?

catarak commented 4 years ago

This is on my mind as I was thinking about how to implement #1337. Would it perhaps make sense to solve this in the same way as handling updates for multiple users? Or should they be handled differently?

catarak commented 3 years ago

The solution is definitely to dispatch sketch updates via websockets, after #1759 is completed.