-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamic loading of assets (full-offline support) (WIP) #61
base: master
Are you sure you want to change the base?
Conversation
this might work.
step one of fixing stuff
step two of fixing offline
trying out something
@BinBashBanana need some help on this: could you explain, to the best of your knowledge, how the cores are loaded in this? i need to know where it is hitching on to get past where i am at. |
just realized that, by default, index.html doesnt even work locally (with internet), meanwhile i have a menu working (without internet). so, at least i have progress towards something functioning. |
let's try this
I'm already working on this for the next release (v6.6), see #52. Since cores are 2-6 MB (per core), I don't want to bundle them all in one file, but instead download them once and use the Cache web API for offline use. I will bundle the essential assets (javascript, css, etc) into the offline html file. To answer your question, each core has 2 parts; the .js file and the .wasm file. The .js file is loaded from |
@BinBashBanana still going to work on this to a functional state on my own: i need something to spend my free time on anyways. i will adapt my end goal to that though: ends up with less work on your end for |
i am silly
Ok! |
..it never even loads the core |
This happens when you load the core from a |
Which is, indeed, what my purpose here is: any idea on why they do not function? Thinking about potential workarounds: I guess I could try to implement indexdb loading to get around it, but that seems like a handful that I don't exactly want to attack until necessary. |
Most browsers disable XHR/fetch to
|
(Doing this may increase load times, because modern WASM streaming won't work) |
Ah, I see. Everything works from Github Pages: now I guess I have to figure out how to actually use indexeddb, now. And.. also do that with the BIOS files, too. ...Or just embed the BIOS files in the repo.. but that's a bit storage-wasteful. probably just do the above, as much as that may suck to program. |
This is why I want to use a service worker cache, it will make it much easier for the asset bundle, cores, and BIOSes.
Originally posted by @BinBashBanana in #52 (comment) |
Although, now that I think about it, service workers may not work on |
Just a heads up, this is not dynamic linking. Dynamic linking is something else I have planned for the future, see here. |
sorry: must have mixed up "linking" with "loading" somewhere, haha. to clarify: i always meant "loading". oops. |
@BinBashBanana: thinking of different ways this could be implimented: i have a few i could work on, and wanted your opinion on it. possible approaches
|
I think automatically downloading everything would be a bad idea, so I want to have a manager (one of the modal windows) for it. Unobtrusive would probably be best (?) |
@BinBashBanana this is roughly what i had in mind (ignore the quick paint art) |
Something like that yeah. There are no per-core assets, besides the BIOS files. So it could look like:
|
right, that makes sense |
i havent forgotten about this: life has only taken priority for a bit. it will probably stay like that for a bit more.. taking a couple of days to myself, to recover and focus on myself, and also thanksgiving stuff.
|
sorry about going kind of stale on this. life has been rough, and i haven't been feeling very motivated. this is still something i am willing to work on, it's just going to take a bit. |
It's all good. I frequently feel demotivated as well. |
todo here now.
this is the pull request for dynamic loading of assets in webretro. for discussion, and a general "problem tracker". goals and stuff are above.