Closed anp closed 7 years ago
:+1:
Hi,
I was just going through the react native scripts and xdl libraries. Here is what I can understand so far. Please do tell me if I am missing something, as the documentation is a bit sparse and I might have missed something:
To get some kind of information about the last request, we will need to either hook into the xdl library, and pass in some kind of middleware to the express server being created here But this functionality is not present in xdl right now.
The other option will be to hook into the xdl Logs, and look for the last request, which I don't think is the most ideal of solutions.
The easiler solution however would be to just warm both caches at startup.
I suspect that the easiest way to do this is going to be to build something in xdl which makes use of the ProjectSettings API: https://github.com/exponent/xdl/blob/master/src/ProjectSettings.js. This information is stored in the project's .expo
directory, so we can store information there about what platforms have been loading.
cc @jesseruder
Can you please clarify something, I'm sorry. Are we looking to warm the respective platform's cache when a user say runs npm run android/ios
, or do we decide the platfrom based on the actual platform from which the app is accessed, i.e. an iphone or an android?
I think the ideal situation would be a combination:
yarn run android
or yarn run ios
regardless of what's been loaded most recentlyRecording the last platform loaded in ProjectSettings
sounds reasonable.
I think now that we have progress indicators this isn't a big deal. In the future we will also show the progress in the app as well. Closing this for now.
If it's a fresh project, warm both.
Figure out a way to save which platform was last requested. On subsequent starts, only warm the cache with the last requested platform.