-
Notifications
You must be signed in to change notification settings - Fork 188
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
Defer loading log files till after page load #1437
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Move the action of loading the log files from S3 from `refresh`, where the `rootComponent` blocks page load until the Promise resolves, to `componentDidMount`, where it doesn't block page load. This is intended as a temporary fix, rather than a best-practice course of action.
thanks @PtrTeixeira |
Moves the fetch request back into the `refresh` method, but don't return it. This keeps the refresh code centralized, but will still prevent it from blocking the page load.
@PtrTeixeira seems I was incorrect about being able to do that. We can take another look at a more permanent solution for this tomorrow |
It might be worth just adding another parameter to |
Adds another hook for `rootComponent` to interact with the component lifecycle. In particular, the `onLoad` function provides a hook that will run during `componentDidMount`, in contrast to `refresh`, which provides a hook into `componentWillMount`. The intended use case is for kicking off actions which should be handled eventually, but which should not prevent the page from loading. The issue with doing those in `refresh` is that `rootComponent` will display a spinner until the promise returned from `refresh` is entirely complete; there isn't a mechanism for only having some requests block.
Looks good, this should be good to go to |
👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Move the action of loading the log files from S3 from
refresh
, wherethe
rootComponent
blocks page load until the Promise resolves, tocomponentDidMount
, where it doesn't block page load. This is intendedas a temporary fix, rather than a best-practice course of action.
/cc @ssalinas