Closed Nate-Wessel closed 2 years ago
This should not really change any functionality, but does clean up the code making it easier to do other things later on. @jamaps if you could, please just check that I haven't broken anything.
I've renamed all .topojson
files to .topo.json
to make clear that they're JSON and can be compiled as such by Webpack. This will save a round-trip to the server since the dynamic import will get the chunk data directly rather than importing just the chunk-name to be fetched.
This all seems to be working well, EXCEPT that now webpack is crashing for me in build-dev
mode when something it's watching changes. Does it have too many files to watch? Too much JSON in memory? It builds fine the first time.
Discussion of the problem here: https://github.com/webpack/webpack/issues/1914 No definitive solutions
Webpack issue, perversely, is fixed now
Glad to see that the issue fixed itself?! All looks good on Master :)
Glad to see that the issue fixed itself?!
After ~3 hours of focused debugging, it fixed itself ;-)
So, partly this will help me more easily figure out what data is available once we get into having a lot more files for the bike infra layer(s). Partly this is something I'd meant to do but hadn't yet figured out how to do at the time - and now I'm going back and doing it.
This PR switches from explicitly importing all data files at build time to importing them dynamically at run time based on the fact that we're already using consistent names and filepaths for everything. Now, if the data file at the expected path doesn't exist, we don't have it. It doesn't need to be explicitly imported/identified per-city.