Skip to content
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 5 commits into from Mar 7, 2017
Merged

Conversation

PtrTeixeira
Copy link
Contributor

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.

/cc @ssalinas

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.
@ssalinas
Copy link
Member

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.
@ssalinas
Copy link
Member

@PtrTeixeira seems I was incorrect about being able to do that. We can take another look at a more permanent solution for this tomorrow

@PtrTeixeira
Copy link
Contributor Author

It might be worth just adding another parameter to rootComponent for 'These are things that I'd like loaded, but shouldn't block the page load'

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.
@ssalinas
Copy link
Member

ssalinas commented Mar 3, 2017

Looks good, this should be good to go to hs_stable @PtrTeixeira

@ssalinas
Copy link
Member

ssalinas commented Mar 7, 2017

👍

@ssalinas ssalinas merged commit 2edd9b2 into master Mar 7, 2017
@ssalinas ssalinas deleted the dont-block-for-logs branch March 7, 2017 14:10
@ssalinas ssalinas modified the milestone: 0.14.0 Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants