<div dir="ltr"><div>Dear Troy, thanks for the kind words!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Troy A. Griffitts <<a href="mailto:scribe@crosswire.org">scribe@crosswire.org</a>> ezt írta (időpont: 2022. jan. 14., P, 18:43):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Welcome Zoltán!<br><br>I am curious how local storage is used and how much is available. We jump through all kinds of hoops to get libsword compiled and accessible on both iOS and Android for Bishop. It would be nice if maybe we could simply ship a WASM lib with Bishop for both platforms.<br></div></blockquote><div><br></div><div>I uploaded a WASM build to <a href="https://github.com/kovzol/crosswire-sword-mirror/releases/tag/2022Jan03">https://github.com/kovzol/crosswire-sword-mirror/releases/tag/2022Jan03</a>. This should be ready to use for inclusion in other WASM based projects. I will send you a detailed description on how one could easily build it from scratch (in a different email).</div><div><br></div><div>The local storage is surprisingly easy to set. Emscripten wants to know which native folder is to be used in the browser and it can be set by using the --preload-file option on linking. The documentation at <a href="https://emscripten.org/docs/porting/files/packaging_files.html#packaging-using-emcc">https://emscripten.org/docs/porting/files/packaging_files.html#packaging-using-emcc</a> explains this very well. I simply packaged the ~/.sword folder to get access to the same Bible texts I installed for the native version by using installmgr. In my case the texts KJV, LXX and SBLGNT took about 10 MB of disk space, and Emscripten created a .data file that had to be uploaded on the web server too. Loading this amount of data is very fast, less than 1 second. I guess, storing a couple of other texts is still manageable. Maybe some compression could also be done, but I haven't investigated this question yet. When a .data file exists, it seems a web server is required -- maybe the .data file can also be bundled in the .js, so no web server must be used. I will check this later. (The .js file can contain the .wasm code if you want, that's the simplest way to avoid using a web server for WASM based web applications.)</div><div><br></div><div>In fact, everything is compiled transparently, no action is to be done in Sword to access the local storage, nothing. Emscripten takes care of every step: this works incredibly smoothly.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>I noticed your patch is to our cmake build. Greg Hellings holds the pumpkin there, so I defer to his wisdom on inclusion. Greg, if you're busy, I am happy to commit if you have a brief look and "OK" the change.<br><br><a href="https://github.com/kovzol/crosswire-sword-mirror/commit/2ed499fe72141345a9d90053b0c96be5549df6ca" target="_blank">https://github.com/kovzol/crosswire-sword-mirror/commit/2ed499fe72141345a9d90053b0c96be5549df6ca</a></div></blockquote><div><br></div><div>Yes, this change should be harmless for the other parts of Sword. :-)</div><div><br></div><div>Best regards, Zoltán</div><div><br></div></div></div>