-
Notifications
You must be signed in to change notification settings - Fork 26
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
Pure JS implementation? #11
Comments
I'm so glad someone is thinking of doing this in a cross-platform way! I am not aware of any technical limitations. I wrote it in Objective-C because I understand iOS dev much better than I understand PhoneGap, and needed a reliable system out in a couple of days. I have no idea how reliable this system would be if you implemented it in JS. One nice thing about doing it with native code is that the application could be updated even if it was totally broken (think parse errors, file corruption...) Let me know if I can help. |
I am waiting to hear back from my project manager about whether we want OTA update support for Android enough to justify me taking the time to work on porting phonegap-air to JavaScript. I will let you know when I do. If I were to start working on this, it would be helpful to have an overview of what the code does at a level of detail somewhere between what you already have in the README file and the detail of the code of itself. I ask for that because I simply cannot read Objective-C code 😄. |
I just heard back from my project manager, and getting phonegap-air to work for Android would be useful for our app, but it is not our highest priority right now. But I will let you know if/when I am given the green light to begin working on this. Thanks for your input and willingness to help! |
Sure, let me know when you do want to work on this. |
Why don't you use a mechanism using HTML5 cache ? What do you think ? |
I am not sure if the method you're proposing is feasible. You should create a simple proof of concept. |
I thought a bit more about it and in fact no, it will not work so well because of the Same Origin Policy. However, maybe having a js script that will poll by itself the cache manifest, then download everything in a separated folder if needed and create an array of files to link (css, js). Then it can be in pure js. The only changes to do are to poll the cache manifest (or any other list of file), download everything in the right folder, then add every file in a list that can be read from the embedded script. I can try to implement something like this. |
For what it's worth, every implementation I've seen has involved saving the scripts to localstorage then eval'ing. For example, with Sencha Touch the process goes like: There's an open source library that may follow a similar idea: http://addyosmani.github.io/basket.js/ |
I've something very basic working. It loads a JSON list from a webserver then save the files listed there and load them in the FileSystem. Here is a repository my current tests: https://github.com/Gp2mv3/js-updater |
This looks a really awesome library, and I am looking forward to using it in a current project! I am curious though why you wrote it in Objective-C rather than in cross-platform JavaScript. Were there technical limitations that made a pure JS implementation impossible? I ask because if it is feasible I would consider helping rewrite what you already have in JavaScript so that it will be cross-platform compatible.
The text was updated successfully, but these errors were encountered: