tilemill-project / tilemill

TileMill is a modern map design studio
https://tilemill-project.github.io/tilemill/
BSD 3-Clause "New" or "Revised" License
3.12k stars 528 forks source link

Avoid 2x map compilation to speed up project saves #1601

Open springmeyer opened 12 years ago

springmeyer commented 12 years ago

It appears that compileStylesheet is called twice in models/Project.server.bones when a user saves a project. This appears intentional as is evident in the asyncValidate method: https://github.com/mapbox/tilemill/blob/cc413c9799f3267d8dc8ea385ef0f5b88901630a/models/Project.server.bones#L74-83

I assume this was written this way to be able to catch errors in stylesheets and then if no errors are encountered to load the stylesheet completely. But why not try to load the stylesheet straight away, and then only if their are errors, compile it again to actually get them out?

See also #1150

ansis commented 12 years ago

I don't think its possibly to avoid this nicely since the second compilation happens in a different process, the tile server.