tangrams/tangram — pull request #68 by bcamper (2014-11-25 23:39:01+00:00)
Title: Unified build for main thread & workers

@iwillig here's my attempt to switch to a unified build file for both the main thread and the workers. Originally they were separate on the theory that some code (like the tessellator) was only needed in one file but not the other. In practice, with the browserify build process, it often wasn't possible to take advantage of this anyway, so there was a lot of unnecessary code in each.

Additionally, by using one build we can avoid a second file dependency and network request. As far as I know it's not possible to access the full content of the current script directly (in which case we could just instantiate that as the worker source), so we do have to initiate a network request; but it should use the browser cache so shouldn't incur much cost, leading to significantly less content loaded over the network overall.