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
With commit c4950ea I added the capability to share a jade_mixins store between renderings.
if locals.jade_mixins is an object when a rendering is done, then this object will be filled with all the mixin functions that were found and compiled in the template (this is an upsert mechanism)
The rendering of another template with the same locals.jade_mixins object will be able to reuse those mixins via the dynamic mixins notation +#{name}(...)
With this commit, nothing is done to make sure that the shared mixin will use the same bufas a new rendering. In effect, they DO NOT have the same bufso a trivial setup will not work.
At this stage, the recommended way to make sure that a shared mixin is effectively rendered where it should be is to make sure that the mixins begin with the prototype (jade, buf, ..) and are called with those 2 vars :
This feature not only enables mixin sharing, but can also be used for just-in-time mixin compilation since a mixin yields and can take care of the mixin compilation asynchronously.
@ForbesLindesay I moved the discussion we started on jade here. Any toughts are welcome !
The text was updated successfully, but these errors were encountered:
With commit c4950ea I added the capability to share a
jade_mixins
store between renderings.if
locals.jade_mixins
is an object when a rendering is done, then this object will be filled with all the mixin functions that were found and compiled in the template (this is an upsert mechanism)The rendering of another template with the same
locals.jade_mixins
object will be able to reuse those mixins via the dynamic mixins notation+#{name}(...)
With this commit, nothing is done to make sure that the shared mixin will use the same
buf
as a new rendering. In effect, they DO NOT have the samebuf
so a trivial setup will not work.At this stage, the recommended way to make sure that a shared mixin is effectively rendered where it should be is to make sure that the mixins begin with the prototype
(jade, buf, ..)
and are called with those 2 vars :This feature not only enables mixin sharing, but can also be used for just-in-time mixin compilation since a mixin yields and can take care of the mixin compilation asynchronously.
@ForbesLindesay I moved the discussion we started on jade here. Any toughts are welcome !
The text was updated successfully, but these errors were encountered: