Closed gliechtenstein closed 6 years ago
with preload now being inlined what's the reason for the old style file:// reference in settings.plist?
<key>preload</key>
<string>file://preload.json</string>
That's for the very first view that the app launches with.
The very first view by definition doesn't have another view that can preload for them, so that's why it's needed. If you get rid of that field it will just launch with a blank screen, which is also fine.
This was confusing to me as well. Maybe the key should be different? say, firstlaunch
or something?
I added a launch image to my app before this was in the works, but this would work in iOS as well as Android, making it easier to manage.
Thanks - I think I get it now, you define the preload before the preload happens, all except the first preload. Is there any convenient way of referring to the original built-in (preload.json) for those that just want to use the one that the app is compiled with or is that maybe the default when transitioning views?
I understand how the naming can be confusing, so have changed the "preload" attribute at settings to "launch".
The filename itself is still file://preload.json
since you can use it for any view through mixins. For example:
{
"href": {
"url": "..",
"preload": {
"@": "file://preload.json"
}
}
}
As of latest on the develop
branch, the file://preload.json
is set ONLY for the launch screen, and for rest of the views you need to set preload
attributes yourself manually.
I've done some testing with the preload feature, the only times it's good to use the preload
attribute are:
Otherwise it's better NOT to use the preload
, especially if you just need to load the JSON once and don't do any dynamic rendering on $load
via $network.requests, templates and $render. Looks like the preload screen itself adds a bit of a delay. Most views without a dynamic fetch/rendering load almost instantly WITHOUT a preload screen.
Changes
loading.json
approach to loading screen because it was introducing too many unexpected bugspreload
attribute tohref
.Now
href
has gained an additional attribute namedpreload
, which is basically a JSON object that represents the loading screen's body (effectively the$jason.body
of the loading screen). Here's an example:Benefits
loading.json
approach which only had a single loading view available for the entire view.file://loading.json
to customize loading screens. Now it's inline and you no longer need a file for this. Which means you can switch the loading screen even after shipping the app, just like rest of Jasonette.Examples