Our build process already has a small utility which processes all of the enums in specified C header files into C code consisting of lookup tables of strings, which code is then made part of the main app. This lets us use the literal strings corresponding to those enums in our XML data files... kludgy, but it gets us where we need to be. I think I could do something similar to generate JS code which defines constants having the values of those enums from the C header files.
My question: It would probably be much simpler, and easier to maintain, to simply process every enum in a *.h file than to try to narrow it down to only the ones we actually need for the JS stuff. My guess that if the JS has to include a bunch of constants that it never does anything with, there will be something of a performance hit. How bad is this likely to be? Is it worth the coding hassle to try to keep the resulting generated JS as lean as possible?