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

Chunks are not splitted #225

Closed
xD3CODER opened this issue May 20, 2019 · 10 comments
Closed

Chunks are not splitted #225

xD3CODER opened this issue May 20, 2019 · 10 comments

Comments

@xD3CODER
Copy link
Contributor

Hi,

I just noticed that code splitting though React-Loadable seems to not work anymore.

Expected Behavior

Pages required with react-loadable should be split in different bundles

Actual Behavior

All code is bundled inside a single chunk file

Your Environment

  • Node 10.8
@Rid
Copy link
Contributor

Rid commented May 20, 2019

I've also noticed this issue, I've already fixed it in my project and I'll make a PR tomorrow for it here.

@Rid
Copy link
Contributor

Rid commented May 21, 2019

This is now fixed in #226, @wellyshen ptal.

@xD3CODER
Copy link
Contributor Author

This is now fixed in #226, @wellyshen ptal.

Mmh, I tried your solution, but it doesn't seem to work any better.
I think it's time to move on https://github.com/smooth-code/loadable-components because react-loadable is not maintained and has not been updated since a long time

@Rid
Copy link
Contributor

Rid commented May 22, 2019

@xD3CODER what is yarn analyze outputting? I've tested #226 and code splitting is definitely working. Are you using dynamic imports on the code which you want splitted?

We were previously using loadable-components, but you can see why we switched here: #197

@xD3CODER
Copy link
Contributor Author

That's weird, i'll retry this afternoon.

Now loadable-components support prefetch, and the library is recommanded by react team as alternative of lazy

@Rid
Copy link
Contributor

Rid commented May 22, 2019

This was the main issue I had when trying to implement it here last time:
gregberge/loadable-components#135

It seems there are still some outstanding issues related to SSR:
gregberge/loadable-components#345
gregberge/loadable-components#343
gregberge/loadable-components#230

We would probably need those fixed/resolved before we can think about trying again.

@Rid
Copy link
Contributor

Rid commented May 22, 2019

I will try loadable-components again today as I think most of those issues wouldn't apply here.

@xD3CODER
Copy link
Contributor Author

xD3CODER commented May 22, 2019

I just tried loadable-components I have the same issue:
https://github.com/smooth-code/loadable-components/issues/135

@xD3CODER
Copy link
Contributor Author

@xD3CODER what is yarn analyze outputting? I've tested #226 and code splitting is definitely working. Are you using dynamic imports on the code which you want splitted?

We were previously using loadable-components, but you can see why we switched here: #197

My fault, your fix works well

@xD3CODER
Copy link
Contributor Author

I made the same mistake with loadable-component, it's work well, i'll make a PR soon

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

No branches or pull requests

2 participants