Open ivan-aksamentov opened 2 years ago
This would also allow to switch data URLs dynamically, to be able to fetch data from a non-default location.
This will be handy to organize experiments and to preview freshly generated data, especially if we Move data out of git repository #301. For example newly generated data can be stored on a preview S3 bucket and the web app can fetch data from it instead of from production bucket.
Currently, the data is made available to the application through the synchronous ES6
import
, processed by webpack, which bundles JSON files into resulting JS files along with the application code.An import was an easy and quick solution in the beginning
but it's no longer great nowadays, because data size have grown substantially, blowing up the app bundle, making the app very slow and requiring more resources for CI builds.
An alternative would be to host data separately from the app bundle and to fetch it dynamically from the network.
Fetching data from a network location have some additional disadvantages:
Steps:
import
spublic
directory during build, along with other static data