vitlich
vitlich9mo ago

wasm notebooks

Hi, a newbie question, as I have 0 experience with web apps or WASM. If I create a WASM permalink, where does this notebook live? Somewhere on Marimo server? Is there any limitation when it comes to length or content of such notebook?
11 Replies
Myles Scolnick
Myles Scolnick9mo ago
This page should cover some of the limitations - https://docs.marimo.io/guides/wasm.html The code lives in the URL as a url hash. You can save the permalink which is saved in our servers. That just gives you a shorter link
vitlich
vitlichOP9mo ago
Alright, thanks!
RJ Budzyński
RJ Budzyński9mo ago
Well but the length of url's isn't unlimited, no?
Myles Scolnick
Myles Scolnick9mo ago
There is no spec of a limit but Chrome is up to 2mb in the hash
RJ Budzyński
RJ Budzyński9mo ago
I believe I read somewhere that it was 2k rather than 2M May have been outdated info of course And in any case - even if a browser can send a request with a ridiculously long url, don't servers have their own limits on the length of a url they will accept? I'm assuming that it's implied that more code in notebook -> longer url Furthermore, even if a looooong url could work as the target of a link, the browser combobox might not like to receive it by a paste operation. Hmm could it be a good idea to have a function in marimo that produces a clickable link to the code of the current notebook, that would open the WASM version?
Myles Scolnick
Myles Scolnick9mo ago
Browsers don’t send the hash - and the code is now stored in the hash. So it won’t make it to the server The browser combo box accepts up to 2mb. If you hit this limit, we have ideas to get around but I don’t think we will need it now. There is already a link in the top menu dropdown to open the notebook in wasm.
RJ Budzyński
RJ Budzyński9mo ago
Great 😃 But I don't understand how the short URLs are generated, if the code isn't sent to the server? Just curious. I don't see that link in 0.3.10 - I assume it will appear in the next release?
Myles Scolnick
Myles Scolnick9mo ago
We might be confusing each other. When the short urls are generated, which are totally optional and just a cleanliness thing, we send it to the server via a POST and the code is not in the url. But this is a tradeoff of saving your code on our servers. Not everyone wants to which is why we default to keeping it in the url. The link has been there in a while : it’s under Share > WebAssembly Link
RJ Budzyński
RJ Budzyński9mo ago
okay I get it - what I meant was that before I can generate a short url, I gotta get my code into a WASM notebook, assuming I edited it in my local merimo. And if that is a lot of code, the length of the url might be a problem. But what you are saying is that it won't be a problem unless I have actual megabytes of code and hit the combobox limit.
Myles Scolnick
Myles Scolnick9mo ago
Yep that is correct. And you are right, it is two steps if you always want the short link from your local marimo. But the links from the local marimo should be fine (even though long). We just wanted to default to not save anything on our servers since most won’t want that
RJ Budzyński
RJ Budzyński9mo ago
👍