millstone
millstone copied to clipboard
avoid downloading carto uri remote resources that are within commented code
We use regex magic to find carto uris needing downloaded/localized. Doing this before carto means that we have no reasonable way to know if the code is commented with // or /* code */. So we will end up downloading stuff that is not active, which is wasteful and could lead to odd behavior since data is cached.
Not sure about ways to avoid this however, without creating a dependency on carto, or moving the localization code back into carto, which would not be ideal (because it's nice to keep all this dodgy code in one place).
Looked into using carto.Parser({}).parse(s.data).toList({}) to try to pull out valid uris' but I'm a bit lost on the best way to iterate the result of that call. Will pick back up tomorrow.
The best way to do this (afaik) is to use effects to build a list; it's how we push around variables and such. I'll take a look at this tomorrow.