faceyspacey/react-universal-component

Why is ReportChunks considered a last resort?

Closed this issue · 1 comments

From the docs:

This is not the recommended use of locating chunk names and only should be used when absolutely necessary.

It seems like this library assumes that you're going to deploy the code and then have the server's start script build and then run the server in a single step. That isn't the case for us - we like to have a short container startup time, and building + running would mean that there'd be a 3.5min delay between the server starting and actually being able to serve requests.

We implemented RUC before the existence of ReportChunks and hacked around the issue by sticking the stats.json file in the server bundle and then importing it at runtime. This is significantly more complicated than the use of ReportChunks, and it seems like it would be a much better solution for us.

Why is it not recommended?

Yeah, it originally was designed as such. However, id say there's no problem in doing so