gsf / whiskers.js

Whiskers templating library for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deprecate partials parameter

gsf opened this issue · comments

Whiskers can be simpler and more flexible if we drop the partials parameter and instead put partials in the context object. This allows for treating partials like context variables, using {if partial} and such. It means the only difference between {variable} and {>variable} is that the latter is sent through the rendering engine. If collisions are an issue, one can still put partials in a "partials" object within the context object and refer to them with {>partials.partialName}.

The next version of whiskers.js will look for partials first in the context object, then in the partials object. It will also console.warn that the partials parameter is deprecated. The version after that will drop the parameter altogether.