Uh oh!
There was an error while loading. Please reload this page.
Show bundle download progress on iOS - #15066
Conversation
facebook-github-bot
commented
Jul 19, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
| RCTLoadingProgress *progress = [RCTLoadingProgress new]; | ||
| progress.status = @"Downloading JavaScript bundle"; | ||
| // Progress values are in bytes transform them to kilobytes for smaller numbers. | ||
| progress.done = done != nil ? @([done integerValue] / 1024) : nil; |
There was a problem hiding this comment.
Why do we convert to kilobytes here?
There was a problem hiding this comment.
Mostly just to make the numbers smaller, we don't really have a way to show units with the current setup so it's no really clear what the numbers are anyway.
There was a problem hiding this comment.
Why we don't make them smaller right before displaying them?
There was a problem hiding this comment.
This is as close as we get to displaying them, this is also used for showing the packager module transform progress so it just takes a progress number and the total then formats it to something like "10% (10/100)".
facebook-github-bot
commented
Jul 25, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
janicduplessis
commented
Aug 2, 2017
@shergin Could you check why this didn't import |
facebook-github-bot
commented
Aug 3, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
shergin
commented
Aug 6, 2017
@janicduplessis This strange but one of our internal builds failes with this error: Do you have any idea? Seems this diff even don't modifies this line. |
@shergin Fixed the error. I just removed the nullability specifier since we didn't use any in that file to begin with. Weird that the error was surfacing at the wrong place :o Seems like this is new warning that can be enabled in xcode 9. Didn't update the projects to enable it for now but we might want to do that in the future when xcode 9 is released and update the projects to the new defaults. |
facebook-github-bot
commented
Aug 10, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
facebook-github-bot
commented
Aug 11, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
shergin
left a comment
There was a problem hiding this comment.
This awesome PR breaks RCTMultipartStreamReaderTests, unfortunately.
| } | ||
| } | ||
| - (BOOL)readAllParts:(RCTMultipartCallback)callback progressCallback:(RCTMultipartProgressCallback)progressCallback |
There was a problem hiding this comment.
If we changed the signature of this method, may be we can name it a bit better including callback word into this? Something like readAllPartsWithCallback:progressCallback: or something even better?
There was a problem hiding this comment.
Maybe "CompletionCallback" so it's clear how it's different from the progress callback?
There was a problem hiding this comment.
Oups forgot to update the signature in tests, also updated it to readAllPartsWithCompletionCallback:progressCallback:. Should land this time!
facebook-github-bot
commented
Aug 14, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: This shows progress for the download of the JS bundle (different from the packager transform progress that we show already). This is useful especially when loading the JS bundle from a remote source or when developing on device (on simulator + localhost it pretty much just downloads instantly). This will be nice for the expo client since all bundles are loaded over the network and can take several seconds to load. This depends on react/metro#28 to work but won't crash or anything without it, it just won't show the progress percentage.  **Test plan** Tested that bundle download progress is shown properly in RNTester on both localhost + simulator and on real device with network conditionner to simulate a slow loading bundle. Tested that it doesn't cause issues if the packager doesn't send the Content-Length header. Closes#15066 Differential Revision: D5449073 Pulled By: shergin fbshipit-source-id: 43a8fb559393bbdc04f77916500e21898695bac5
Summary: This shows progress for the download of the JS bundle (different from the packager transform progress that we show already). This is useful especially when loading the JS bundle from a remote source or when developing on device (on simulator + localhost it pretty much just downloads instantly). This will be nice for the expo client since all bundles are loaded over the network and can take several seconds to load. This depends on react/metro#28 to work but won't crash or anything without it, it just won't show the progress percentage.  **Test plan** Tested that bundle download progress is shown properly in RNTester on both localhost + simulator and on real device with network conditionner to simulate a slow loading bundle. Tested that it doesn't cause issues if the packager doesn't send the Content-Length header. Closesreact#15066 Differential Revision: D5449073 Pulled By: shergin fbshipit-source-id: 43a8fb559393bbdc04f77916500e21898695bac5
Summary: This shows progress for the download of the JS bundle (different from the packager transform progress that we show already). This is useful especially when loading the JS bundle from a remote source or when developing on device (on simulator + localhost it pretty much just downloads instantly). This will be nice for the expo client since all bundles are loaded over the network and can take several seconds to load. This depends on react/metro#28 to work but won't crash or anything without it, it just won't show the progress percentage.  **Test plan** Tested that bundle download progress is shown properly in RNTester on both localhost + simulator and on real device with network conditionner to simulate a slow loading bundle. Tested that it doesn't cause issues if the packager doesn't send the Content-Length header. Closesreact#15066 Differential Revision: D5449073 Pulled By: shergin fbshipit-source-id: 43a8fb559393bbdc04f77916500e21898695bac5
Summary: This shows progress for the download of the JS bundle (different from the packager transform progress that we show already). This is useful especially when loading the JS bundle from a remote source or when developing on device (on simulator + localhost it pretty much just downloads instantly). This will be nice for the expo client since all bundles are loaded over the network and can take several seconds to load. This depends on react/metro#28 to work but won't crash or anything without it, it just won't show the progress percentage.  **Test plan** Tested that bundle download progress is shown properly in RNTester on both localhost + simulator and on real device with network conditionner to simulate a slow loading bundle. Tested that it doesn't cause issues if the packager doesn't send the Content-Length header. Closesreact/react-native#15066 Differential Revision: D5449073 Pulled By: shergin fbshipit-source-id: 43a8fb559393bbdc04f77916500e21898695bac5
Summary: This shows progress for the download of the JS bundle (different from the packager transform progress that we show already). This is useful especially when loading the JS bundle from a remote source or when developing on device (on simulator + localhost it pretty much just downloads instantly). This will be nice for the expo client since all bundles are loaded over the network and can take several seconds to load. This depends on react/metro#28 to work but won't crash or anything without it, it just won't show the progress percentage.  **Test plan** Tested that bundle download progress is shown properly in RNTester on both localhost + simulator and on real device with network conditionner to simulate a slow loading bundle. Tested that it doesn't cause issues if the packager doesn't send the Content-Length header. Closesreact#15066 Differential Revision: D5449073 Pulled By: shergin fbshipit-source-id: 43a8fb559393bbdc04f77916500e21898695bac5
Summary: This shows progress for the download of the JS bundle (different from the packager transform progress that we show already). This is useful especially when loading the JS bundle from a remote source or when developing on device (on simulator + localhost it pretty much just downloads instantly). This will be nice for the expo client since all bundles are loaded over the network and can take several seconds to load. This depends on react/metro#28 to work but won't crash or anything without it, it just won't show the progress percentage.  **Test plan** Tested that bundle download progress is shown properly in RNTester on both localhost + simulator and on real device with network conditionner to simulate a slow loading bundle. Tested that it doesn't cause issues if the packager doesn't send the Content-Length header. Closesreact#15066 Differential Revision: D5449073 Pulled By: shergin fbshipit-source-id: 43a8fb559393bbdc04f77916500e21898695bac5
Summary: Android equivalent of #15066 Tested that download progress shows up properly when reloading the app. [ANDROID] [FEATURE] [DevSupport] - Show bundle download progress on Android Closes#17809 Differential Revision: D6982823 Pulled By: hramos fbshipit-source-id: da01e42b8ebb1c603f4407f6bafd68e0b6b3ecba
Summary: Android equivalent of #15066 Tested that download progress shows up properly when reloading the app. [ANDROID] [FEATURE] [DevSupport] - Show bundle download progress on Android Closes#17809 Differential Revision: D6982823 Pulled By: hramos fbshipit-source-id: da01e42b8ebb1c603f4407f6bafd68e0b6b3ecba
This shows progress for the download of the JS bundle (different from the packager transform progress that we show already). This is useful especially when loading the JS bundle from a remote source or when developing on device (on simulator + localhost it pretty much just downloads instantly). This will be nice for the expo client since all bundles are loaded over the network and can take several seconds to load.
This depends on react/metro#28 to work but won't crash or anything without it, it just won't show the progress percentage.
Test plan
Tested that bundle download progress is shown properly in RNTester on both localhost + simulator and on real device with network conditionner to simulate a slow loading bundle.
Tested that it doesn't cause issues if the packager doesn't send the Content-Length header.