Re:Show HN: Make an app by adding JSON to this app
by gliechtenstein on Saturday November 05, 2016 @08:24AM
(#12879457)
There's a $cache action where you can store any JSON object into cache associated with the current url and reuse it later https://jasonette.github.io/documentation/actions/#cache-vs-...
Also there's an undocumented mode called "offline", where the JSON loads from the server once and after that it always loads from the initially fetched JSON stored locally. You just need to set "head": {"offline": "true}
Hope this answers the question!
Re:Show HN: Make an app by adding JSON to this app
by joelhaasnoot on Saturday November 05, 2016 @09:25AM
(#12879672)
It'd be even better if you could ship a version to the App Store with an embedded JSON. That way you'll always have some version of your app. Or does it do that already?
Re:Show HN: Make an app by adding JSON to this app
by gliechtenstein on Saturday November 05, 2016 @10:08AM
(#12879823)
Why would you want to have a version of your app? I think one of the coolest part is it works like a website but natively.
If you wanted to version apps, I think you could version it at git level, or just think of it as an API deployment. No?
Re:Show HN: Make an app by adding JSON to this app
by CJKinni on Saturday November 05, 2016 @10:42AM
(#12879935)
I didn't ask the question, but had the same thought. Basically, what if the first time someone loads your app, they don't have a network connection? After the first load, it sounds like I can handle the issue with the cache, but I care a lot about a good experience the first time someone opens the app.
Still, very cool!
Re:Show HN: Make an app by adding JSON to this app
by gliechtenstein on Saturday November 05, 2016 @12:05PM
(#12880308)
Currently, it is possible to set a data-uri as the root url (in a correct format https://en.wikipedia.org/wiki/Data_URI_scheme) I think that's one way you could handle this situation.
Or one could fork the code and change a couple of lines to make this work, technically it would be just a couple of lines of code, but I think policy-wise it needs to be thought out.
Please follow the project and feel free to start an issue thread, we can discuss further! :)
Re:Show HN: Make an app by adding JSON to this app
by joelhaasnoot on Saturday November 05, 2016 @11:57AM
(#12880271)
This indeed: there are more cases than you think where someone downloads your app but has no internet connection when using it. And that could be the first time. Shipping a JSON file ensures the end user will always have something. That something could be as simple as a message "I'm loading data, internet connection is required".
Re:Show HN: Make an app by adding JSON to this app
by shakna on Saturday November 05, 2016 @10:44AM
(#12879944)
Versioning means you can use Continuous Deployment easier. Once all the tests pass for your new feature, it gets shipped, but not before.
Re:Show HN: Make an app by adding JSON to this app
by gliechtenstein on Saturday November 05, 2016 @11:11AM
(#12880057)
Yup that's what I meant by API versioning. Instead of having to deploy the physical app to the appstore, you are deploying your API, since basically you're building your native app on the server.
I quite like the look from the limited glance over. (Probably going in my list for the next tiny thing I have to build).