Closed stereobooster closed 7 years ago
I'm not familiar with this webworkify thing. Also, I don't see how it connects to react-loadable.
Anyway, is this a trick to load more JavaScript later? Or if I understand (unlikely) what react-loadable is, it's a wrapper for the webpack tricks that can load more JS later (and in the case of react-loadable, it's done based on certain components being needed).
Either way. The goal has to be for minimalcss to stay away from how loading works as much as possible and simply wait till the network is idle and then focus on downloaded CSS and the DOM.
How can I reproduce this without too fancy a setup? Can this blob:... stuff be reduced to something super simple I can put into a test html file.
How can I reproduce this without too fancy a setup?
I suppose this will do:
var blob = new Blob(['p{color:#000}'], { type: 'text/stylesheet' });
var url = URL.createObjectURL(blob);
var linkTag = document.createElement("link");
linkTag.setAttribute("rel", "stylesheet");
linkTag.setAttribute("href", url);
document.body.appendChild(linkTag);
And running fetch
, will that require a network call or will the browser immediately resolve?
Browser will resolve it without network
Your project is very helpful. My current pages prerendered with react-snap start to render at 0.5 seconds and have about 80% of content painted. But main js bundle is 200+kb (because I use react-mapbox-gl, which is pretty heavy). So I decided to use dynamic imports and react-loadable. But now I get this error.
UPD: this happens because of webworkify, which is used by mapbox-gl.
this is how to read those files