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)?
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)?