create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Flashing of unstyled HTML in extract-text-webpack-plugin, reconsider setting allChunks: true?

Open lawlmart opened this issue 9 years ago • 8 comments

Although setting allChunks: false in the configuration of extract-text-webpack-plugin increases the initial page load, it has the consequence of flashing unstyled HTML as the user moves between uncached chunks, since the page renders before addStyles can do its magic. So far it's been the only customization I need and I'd love to not have to eject.

This was originally discussed in #408 but the unstyled flashing wasn't mentioned which I feel is a dealbreaker. If this isn't up for continued debate than you can just close it.

lawlmart avatar May 30 '17 20:05 lawlmart

We currently don't have the time to look into this, but I'll tag it for later review. Thanks!

Timer avatar Jun 06 '17 18:06 Timer

I didn't know this was a problem. Is this a known issue in webpack? Is it even possible to fix?

I'm okay with allChunks: true I guess.

gaearon avatar Jun 06 '17 18:06 gaearon

Can you provide a project reproducing this?

gaearon avatar Jun 22 '17 18:06 gaearon

It sounds like this has been reproduced and the consensus is to set allChunks: true. I’d love to see this fixed soon, would you accept a PR?

lawlmart avatar Sep 26 '17 17:09 lawlmart

currently doing this via patch package. I feel this is an opinionated solve but not sure any practical alternatives exist? At the very least this is a big gotcha for code splitting with CRA

rt2zz avatar Dec 12 '17 00:12 rt2zz

What's the status on this one? I'm experiencing this issue as well. Edit: nevermind, this issue only exists for me in dev because of style-loader. In prod, ExtractTextPlugin fixes it.

mhluska avatar Dec 16 '17 20:12 mhluska

I don't know. Is there a pull request from somebody affected that fixes it?

gaearon avatar Jan 08 '18 20:01 gaearon

Hey guys, this should be fixed with the mini-css-extract-plugin which we've added as part of webpack 4 in the next branch. I don't believe there will be any more releases for CRA 1.x. Please test the CRA2 release if possible, and open a new issue if you see something wrong.

bugzpodder avatar May 31 '18 17:05 bugzpodder