You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
👍 low priority, but this ticket can serve as a reminder to circle back on this once the code is working. Basically we should investigate organizing the code such that code depending on other header-only libs is separate from the code that depends on node/nan, as a first step.
One thing that this would enable is more detailed benchmarks - we could incorporate learnings from hpp-skel as well to test with Google Benchmark, plus running benchmarks in node.
Takes all pure C++ code, compiles it into a static library (for best compiling speed. Note: ideally that static library is just the inclusion of the _ipl.hpp per .ipp implementation architecture hpp-skel#3)
Back here to share further thoughts and ideas for next actions. I think the main goal here should be to first separate the code that deals with vector tiles as much as possible from the code that deals with node specific functionality. After that split is in place then it will become more feasible/clear for whether the vector tile specific code can/should live elsewhere. Also, after that split it would become more feasible to add an emscriptem/web-assembly API interface inside vtquery to complement the node interface.
So, what this would look like is:
A new .hpp file that consolidates code that does not depend on #include <nan.h>. The src/util.hpp would function as this if the CallbackError code where moved out.
The vtquery.cpp getting smaller as a lot of code moves out. For example most of the code inside Execute ideally could be moved into the non-nan header. The gocha here is that code depends on TileObject which has a small dependency on nan/node due to Nan::Persistent<v8::Object> buffer_ref - perhaps this could be templated or otherwise moved off the class to avoid this TileObject having a dependency on node? If it could then the TileObject could be used from a web assembly API...
One update on this idea (seen above in the motivations). I no longer think that it is critical that we do any direct unit testing here in pure C++ because:
Activity
springmeyer commentedon Oct 16, 2017
👍 low priority, but this ticket can serve as a reminder to circle back on this once the code is working. Basically we should investigate organizing the code such that code depending on other header-only libs is separate from the code that depends on node/nan, as a first step.
mapsam commentedon Oct 23, 2017
One thing that this would enable is more detailed benchmarks - we could incorporate learnings from hpp-skel as well to test with Google Benchmark, plus running benchmarks in node.
springmeyer commentedon Oct 23, 2017
Yes. Breaking apart the pure C++ code now, even while stored inside this repo, would enable easier direct unit testing in C++. @mapsam happy to walk you through what this looks like. In short https://github.com/mapbox/route-annotator/blob/master/binding.gyp is a good example. What that does is:
_ipl.hppper .ipp implementation architecture hpp-skel#3)springmeyer commentedon Feb 6, 2018
Back here to share further thoughts and ideas for next actions. I think the main goal here should be to first separate the code that deals with vector tiles as much as possible from the code that deals with node specific functionality. After that split is in place then it will become more feasible/clear for whether the vector tile specific code can/should live elsewhere. Also, after that split it would become more feasible to add an emscriptem/web-assembly API interface inside vtquery to complement the node interface.
So, what this would look like is:
.hppfile that consolidates code that does not depend on#include <nan.h>. Thesrc/util.hppwould function as this if theCallbackErrorcode where moved out.vtquery.cppgetting smaller as a lot of code moves out. For example most of the code inside Execute ideally could be moved into the non-nan header. The gocha here is that code depends onTileObjectwhich has a small dependency on nan/node due toNan::Persistent<v8::Object> buffer_ref- perhaps this could be templated or otherwise moved off the class to avoid thisTileObjecthaving a dependency on node? If it could then theTileObjectcould be used from a web assembly API...springmeyer commentedon Feb 6, 2018
One update on this idea (seen above in the motivations). I no longer think that it is critical that we do any direct unit testing here in pure C++ because:
springmeyer commentedon Feb 10, 2018
Example of what I have in mind: mapbox/vtvalidate#14