Add a static .prefetch() method to async! wrapper#604
Merged
Conversation
import Foo from 'async!./foo' Foo.prefetch() // we know we'll want it. render(<Foo />)
lukeed
approved these changes
Jul 27, 2018
Member
|
You almost exceeded your byte limit on this one. |
prateekbh
approved these changes
Jul 27, 2018
Member
reznord
approved these changes
Jul 28, 2018
Member
Author
|
Test errors look like a cert generation issue. |
Member
|
Yup, can we fix the tests cert issue as well? (For making travis happy) |
This file contains hidden or 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
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.
What kind of change does this PR introduce?
Introduces a new static
.prefetch()method on AsyncComponent (the wrapper component returned byasync!imports:This can be useful for loading related routes.
Did you add tests for your changes?
Nope.
Summary
It is sometimes useful to prefetch lazy chunks when you know they'll be needed soon. This is a pretty tiny and unobtrusive way to do it.
Does this PR introduce a breaking change?
Nope.