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

replace loadable-content with react-loadable #198

Merged
merged 4 commits into from
Nov 12, 2018

Conversation

MortezaT
Copy link
Contributor

@MortezaT MortezaT commented Oct 3, 2018

fixes #197

@wellyshen
Copy link
Owner

@MortezaT Thank you for this PR. There're some async components seems not be replaced by react-loadable

@MortezaT
Copy link
Contributor Author

MortezaT commented Oct 6, 2018

@wellyshen
There is no need for any further changes.
everything works just alright.

@wellyshen
Copy link
Owner

@MortezaT Thank you for doing this change. I'm reviewing this PR. I found there's an error from the console log of Google Chrome as following. Can you help to fix it?

2018-10-06 11 56 46

@MortezaT
Copy link
Contributor Author

MortezaT commented Oct 7, 2018

@wellyshen that's a react 16 issue which interprets white spaces as difference between SSR (which is not minified in development) and client.js (chunked and minified).

If you run it in production you'll see no errors.

@wellyshen
Copy link
Owner

@MortezaT Thank you for sharing this issue. I remember that I didn't choice react-loadable was because I can't solve this issue at that time. So I choose loadable-component instead but the downside is it doesn't support style in SSR. For better developing experience I still wish we can get ride of this error in development. I will spend time to find the solution. as soon as I solve the error. I'll merge this PR. Thank you for your hard working 👍

@Rid
Copy link
Contributor

Rid commented Oct 30, 2018

@wellyshen @MortezaT I'm looking into this error, here seems to be the chronology of the error:

  1. The html is rendered on the server with the full User List sent to the browser
  2. Once the client has loaded it then begins to load the components for the route

So after 1. the DOM contains the User List <div>, however at the start of 2. no components are loaded so the <div> containing the User List is no longer there, hence the error.

I'm not familiar enough with react-loadable yet to understand if this is normal behaviour, I can't understand how the server and client DOM will match if the component needs to be loaded in the client before displaying the data (as this will always require a Loading... <div> whereas the server has pre-rendered with the component already loaded).

I'll continue investigating and update you later.

@wellyshen
Copy link
Owner

@Rid Thank you for your time.

@Rid Rid mentioned this pull request Nov 1, 2018
@wellyshen wellyshen merged commit 389ddb1 into wellyshen:master Nov 12, 2018
@wellyshen
Copy link
Owner

@all-contributors please add @MortezaT for code

@allcontributors
Copy link
Contributor

@wellyshen

I've put up a pull request to add @MortezaT! 🎉

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.

Loadable-component doesn't have any stratgies for prefetching
3 participants