Skip to content

Defer loading log files till after page load#1437

Merged
ssalinas merged 5 commits into
masterfrom
dont-block-for-logs
Mar 7, 2017
Merged

Defer loading log files till after page load#1437
ssalinas merged 5 commits into
masterfrom
dont-block-for-logs

Conversation

@PtrTeixeira

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@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
Copy Markdown
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

ssalinas commented Mar 3, 2017

Copy link
Copy Markdown
Contributor

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

@ssalinas

ssalinas commented Mar 7, 2017

Copy link
Copy Markdown
Contributor

👍

@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.

2 participants