You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this is for issues, but I think the docs for precompiling could use significantly more details or at least examples of what each option looks like. For instance, for the knownHelpers option it says
Hash containing list of helpers that are known to exist (truthy) at template execution time. Passing this allows the compiler to optimize a number of cases. Builtin helpers are automatically included in this list and may be omitted by setting that value to false.
I'm not quite sure what that means. Is it an array of helper names? Or, just making this up, an array of [{"<helper name>: true/false},...]? I can't seem to even find any examples on stackoverflow and while I could look through the code for the precompile function, that shouldn't have to be the case.
And the same with partials, which aren't explained. Does calling Handlebars.registerPartial before precompiling include them? Or is there no way official way to do so (because I've seen some hacks/workarounds)?
This discussion was converted from issue #1896 on October 11, 2022 22:05.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I know this is for issues, but I think the docs for precompiling could use significantly more details or at least examples of what each option looks like. For instance, for the
knownHelpers
option it sayshttps://handlebarsjs.com/api-reference/compilation.html#handlebars-compile-template-options
I'm not quite sure what that means. Is it an array of helper names? Or, just making this up, an array of
[{"<helper name>: true/false},...]
? I can't seem to even find any examples on stackoverflow and while I could look through the code for the precompile function, that shouldn't have to be the case.And the same with partials, which aren't explained. Does calling
Handlebars.registerPartial
before precompiling include them? Or is there no way official way to do so (because I've seen some hacks/workarounds)?Beta Was this translation helpful? Give feedback.
All reactions