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

Rework docs around code splitting #1369

Merged

Conversation

tstirrat15
Copy link
Contributor

Fixes #1368

Motivation

I was having a hard time grokking the docs around code splitting, so I opened #1386. @theKashey helped me understand what was going on, and I wanted to update and clarify the docs if I could.

Changes

  • Rework docs under code splitting header
  • Add section specifically about the tail update warning

README.md Outdated

<!-- TODO: make sure that these are all currently compatible -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, should we add React.lazy?

README.md Outdated

<!-- TODO: make sure that these are all currently compatible -->
* [Loadable Components](https://github.com/smooth-code/loadable-components/)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a test in the examples. It's a bit complicated, as long as you can test only one library in a single point of time (or they would help each other to update).
Probably the last version of loadable components is not reload-friendly.

README.md Outdated
If you use a non-yet-friendly library, like [react-async-component](github.com/ctrlplusb/react-async-component) you have to mark all your "loaded components" as _hot-exported_:
If you use a not-yet-friendly library, like [react-async-component](github.com/ctrlplusb/react-async-component),
or are having problems with hot reloading failing to reload code-split components,
you can manually mark the components at the code-split boundaries.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can manually mark the components as hot (below the code-split boundary)

@theKashey
Copy link
Collaborator

Looking much better!

@tstirrat15
Copy link
Contributor Author

Sweet. I also tweaked those bits.

@theKashey theKashey merged commit e0b683d into gaearon:master Oct 29, 2019
@theKashey
Copy link
Collaborator

👍

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.

Documentation clarification around code splitting
2 participants