-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Compiled templates support #28
Comments
Hi there, It's theoretically possible for the helpers to work with the compilation renderer however if it's in the same form as it currently is or in a reduced form of only allowing things that can be condensed into expression trees. Let us have a think and a demo and we can see what works. If you've got an idea of what kind of templates and helpers you'd want to use that would be useful. |
What initially brought me to this was the exact example in the docs: converting a decimal to a currency string. It would be cool to be able to return a template that would get rendered itself (in its own context). For instance I have some common event information that I want to include in multiple templates. Each template's model has a shared |
Yeah that kind of use case makes perfect sense, especially for sharing between templates. I'd usually advocate for transforming before your templating as suggested by the Mustache spec for removing logic from your templates but i'm aware this isn't always possible or practical 👍 |
I created a proof of concept here: https://github.com/natehitze/Stubble.Helpers/tree/add-compiled-helpers Any thoughts on that? |
It would be awesome if this worked with compiled templates. Is that even possible with how Stubble.Compilation works now? I tried changing some of the classes to use the Stubble.Compilation classes but quickly realized that that won't work at all since Stubble.Compilation renderers work differently than the standard renderers (...duh).
Side note - it might be helpful to put a note in the docs about how helpers don't work with compiled templates currently.
The text was updated successfully, but these errors were encountered: