jdiamond/Nustache — pull request #55 by jonwingfield (2013-07-05 15:11:59+00:00)
Title: Compiled Templates

Morning, pretty cool project you've got here! I've been using it a bit with a WebAPI project that will be in production in a few months and decided that Compiled Templates support would be really nice.

I've got most of the work done to support them, but before I send some giant pull request your way, I have a few questions:

1. I'm using expressions to compile the templates, which means I need NetFx 4.0+. (3.5 doesn't support block expressions and that makes this difficult to impossible). How do you want to handle this? I'm almost done refactoring to Visitor pattern which will leave the original code 99% untouched. Do you want me to create a separate core project for NetFx4? Also, is it OK to upgrade the test project to 4.0? This will make life a lot easier.

2. I've added the mustache specs from here: (https://github.com/mustache/spec). This helped me tremendously with implementing this feature. (I also fixed a few whitespace issues with the current implementation). Is this OK? If so, there are still some unsupported tests (mainly around delimiters, but also some whitespace issues with partials). What would you like to see done with these?

The code in its current state is here if you want to review it: https://github.com/jonwingfield/Nustache/tree/CompiledTemplateSupport.

Thanks for your hard work on this project! Hopefully this contribution makes things even better!