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

Merge API Changes #1

Merged
merged 6 commits into from Feb 24, 2018
Merged

Merge API Changes #1

merged 6 commits into from Feb 24, 2018

Conversation

adam-26
Copy link
Owner

@adam-26 adam-26 commented Feb 24, 2018

Prepare for forked release

Instead of only passing `loaded` to custom `render()`, pass _state_ to give full control when rendering the dynamically loaded component(s).

This allows easily implementing behaviors such as transitions, and blocking of nested route rendering until all modules are loaded.

This is _almost_ entirely backwards compatible. The **only** change required by users of previous versions is to use `object destructuring` syntax for the “loaded” argument.

Example: `render(loaded, props)` must change to `render({ loaded }, props)`

This can be done with a simple find & replace.
Allows developers to manually preload webpack modules.

**example use-case**: _preloading all modules required by a deeply nested route_
When dynamically loading a deeply nested route (many levels deep), you can provide a better user experience when all required modules are loaded before rendering the route for the user.
 * This prevents a waterfall rendering of nested components.
 * Allows developers to handle errors and display an error page if the route fails to load, rather than having to display error messages for each component/module that failed to load
Reduces file size, and makes debugging easier.
Modified PR to make it fully backward compatible.

If a `Loadable` defines a `loading` prop, the component will behave exactly as it has previously.

When no `loading` prop is defined, the first argument the render method receives is `state` instead of `loaded`.

Added support for rendering using react elements.
Allow the webpack plugin to ignore specific chunk names when writing the manifest file.
Initial commit
@adam-26 adam-26 merged commit 57e3d33 into master Feb 24, 2018
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

1 participant