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.
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)?
Add a bulleted list, <Ctrl+Shift+8>Add a numbered list, <Ctrl+Shift+7>Add a task list, <Ctrl+Shift+l>
Directly mention a user or teamReference an issue or pull request
Add heading textAdd bold text, <Ctrl+b>Add italic text, <Ctrl+i>Add a bulleted list, <Ctrl+Shift+8>Add a numbered list, <Ctrl+Shift+7>Add a task list, <Ctrl+Shift+l>
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
{{title}}
-
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