-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add a way to skip compilation if a certain metadata tag is set #135
Conversation
Kenny, what is the use case for skipping compilation? On 8 Nov 2016 20:53, "Kenny Williams" notifications@github.com wrote: Right now the only way to tell Sablono to not compile the body is by type compiled." I am totally open to other (preferably short) names though.You can view, comment on, or merge this pull request online at: #135
File Changes
Patch Links: — |
To avoid the (macroexpand-1 '(html
[:div {}
(function-that-returns-react-component)]))
=> (js/React.createElement "div" nil (sablono.interpreter/interpret (function-that-returns-react-component))) With the metadata tag I added, the call to (macroexpand-1 '(html
[:div {}
^:! (function-that-returns-react-component)]))
=> (js/React.createElement "div" nil (function-that-returns-react-component)) |
Ok, I would like to have more descriptive (and possibly short) name for the name of the |
Maybe one of these: |
What about : inline ? On 10 Nov 2016 22:24, "Kenny Williams" notifications@github.com wrote:
|
Was concerned about the brevity of I also like The |
|
Works for me. On Nov 12, 2016 8:35 AM, "r0man" notifications@github.com wrote:
|
@kennyjwilli I think I would like to go with |
@r0man Updated metadata tag to |
@kennyjwilli Thanks! Will cut a release soon ... |
Right now the only way to tell Sablono to not compile the body is by type hinting it as a
String
orNumber
. Because this type hint doesn't make sense for all cases, I think it would be nice to have a short, general type hint telling Sablono to just return the form, skipping compilation. In this PR I named that type hint:!
because it is short and can be thought of as "not compiled." I am totally open to other (preferably short) names though.