millstone icon indicating copy to clipboard operation
millstone copied to clipboard

avoid downloading carto uri remote resources that are within commented code

Open springmeyer opened this issue 13 years ago • 2 comments

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).

springmeyer avatar Sep 20 '12 23:09 springmeyer

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.

springmeyer avatar Sep 25 '12 02:09 springmeyer

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.

tmcw avatar Sep 29 '12 21:09 tmcw