<div dir="ltr"><div><div><div><div>Good discussion.<br><br></div><div>I for one would hate to see losing the momentum of a powerful web-based computing environment to start implementing stuff for editor-of-the-week (no offense). The notebook has the (already observed) potential to bring interactive computing to people that would never download a programming editor.<br><br>What about codemirror is lacking? Let's build it! Marijn is a really awesome dude, but can't build everything himself :)<br></div><div><br></div>Not to pre-empt Thomas and Matthias, but I have started hacking together a proof-of-concept architecture that moves the state of the notebook-being-used into another model that neatly handles persistence and multiple users. Disclaimer: <a href="/">it doesn't really work yet!<br></a><span id="goog_1904078995"></span><br><a href="https://github.com/nrbgt/derby-notebook" target="_blank" rel="nofollow">https://github.com/nrbgt/derby-notebook</a><br><br></div><div>When the user requests a notebook, its contents are pulled off the content manager and rebuilt into an evented model. This model includes everything from the original content, but adds enough stuff to make the state of the UI persistent:<br></div><ul><li>notebook<br></li><li>kernel</li><ul><li>state<br></li></ul><li>cell</li><ul><li>id</li><li>position in a linked list <- current sticky wicket!</li><li>state</li></ul><li>user</li><ul><li>id</li><li>current cell/mode</li></ul><li>widgets <- haven't started yet</li></ul></div>Then one or more clients (browsers or daemons) subscribe to and publish deltas to this model, which eventually get persisted to the backend and other clients. Because each client has its own local model, it is robust against latency, etc. and you don't have to make the decision between "updating the DOM" vs "updating the model" vs "sending an event"... there is only the model.<br><br></div>I don't think there is a compelling way to make _repr_javascript_ work with this, but widgets are *perfect* as they already work this way... though it may require adding an additional View.view_model if there are UI things that one would want to share among many users.<br><div><div><div><div><br><div>Pics or it didn't happen:<br></div><div><img alt="Inline image 1" src="cid:ii_14be5d4b0e554a17" height="236" width="463"><br><br></div><div>Right now, codemirror is doing a great job of handling text deltas between n browsers. The issue arises in correctly handling inserted/moved cells, and I'm working with the authors of derby, the application framework, to get these sorted out!<br></div><div><br></div></div></div></div></div></div>