The most complex aspect of product customization is rendering. Given the rapidly changing landscape of HTML Canvas, WebGL and server-side rendering, we chose not to abstract any of the rendering. This left us open to vary our rendering strategy per project.
What eventually dictated our aproach to sharing logic was the way we structured the recipe data. After creating a prototype admin interface and concocting some mock recipes, I noticed that the recursive recipe data structure looked a lot like a DOM tree.
If we could write product feature queries with something akin to CSS selector strings, it would be both easy to learn, easy to maintain and efficient to transmit. Rules could be written and stored on the server in an SQL database and we could reason about them both there and in the browser.
I looked into JSONSelect but ruled it out for a couple of reasons. The first was a raft of unresolved issues and open pull reqests on Github. The second was the verbosity of the selectors. By designing a custom query language specifically for MTOC I was able to whittle down the average query string length by more than half.