3 ms·
Ah, okay this is interesting. The entire notebook is one iframe, which lets you do more of the metaprogramming and sharing variables. Both printing (via console
by angleofrepose 6y ago
Ah, okay this is interesting. The entire notebook is one iframe, which lets you do more of the metaprogramming and sharing variables. Both printing (via console) and non-printing infinite loops crash the iframe until you close the page. And the reason my document.innerHTML = "" test was recoverable is that your notebook-top-button-container is not in the iframe (and it has that refresh button!).
I'll have to look more into async stuff. Great eval article there. I've found these four lines to work for importing content[1]. I dove into realms[2] and the realms shim [3] a while ago after reading about Figma's engineering behind plugins [4] but I never figured out how I might use that for my system.
You might take a look at how the codemirror author built his book [5] and editor [6] in this repo [7]. He implements the loop detection I derided in my first comment. I shouldn't be so harsh, it's a good and simple idea. It's just not an answer, more of a hack. My interests align pretty well with the p5js editor audience[8], so some of the early issues there convey why the simple loop detection isn't ideal.
I'll drop you a link soon!
[1]: https://stackoverflow.com/a/5282268 https://stackoverflow.com/a/5282268
[2]: https://github.com/tc39/proposal-realms https://github.com/tc39/proposal-realms
[3]: https://github.com/Agoric/realms-shim https://github.com/Agoric/realms-shim
[4]: https://www.figma.com/blog/how-we-built-the-figma-plugin-system/#an-api-for-an-interpreter https://www.figma.com/blog/how-we-built-the-figma-plugin-sys...
[5]: https://eloquentjavascript.net/ https://eloquentjavascript.net/
[6]: https://eloquentjavascript.net/code/ https://eloquentjavascript.net/code/
[7]: https://github.com/marijnh/Eloquent-JavaScript/tree/master/html/js https://github.com/marijnh/Eloquent-JavaScript/tree/master/h...
[8]: https://github.com/processing/p5.js-web-editor/issues/174 https://github.com/processing/p5.js-web-editor/issues/174