Conversation
…der are now consider partials, which are an special type of view. Adding support for application.json->viewEngine->preloadTemplates to preload any view in memory, and this is disabled by default for now
…c config across the board. Adding support for preloadTemplates for HB client and server to avoid loading the template if is is part of the expanded instance. Adding support for partials on hb client and server.
… objects over and over again. removing viewId argument that is not really relevant for this abstraction.
…stance. removing unnecesary dependencies and unnecessary configuration that is not semantically correct for action-context or mojito-client
LGTM. @caridy What's the reason that nested partials do not work? |
@ericf that's a good question. As today, whenever you call to render a template in mojito you will pass what we call a viewObject (yes, probably not the best name), and this object represent a |
@caridy Based on what you have implemented here, nested partials should work just fine. Here's a very simple example: |
Perfect. |
Hi everyone, The Drew |
Was redone as #842. |
Example:
by following that structure, you should be able to define
foo.hb.html
like this:Few more notes:
Details:
instance.partials
with a similar structure thaninstance.views
after expanding the instance.partials/*
folder are now consider partials, which are an special type of view.application.json->viewEngine->preloadTemplates
to preload any view in memory, and this is disabled by default.application.json->viewEngine->cacheTemplates
as a static config across the board.view-renderer
is now a class and a factory to avoid creating renderer objects over and over again.Y.mojito.ViewRenderer()
factory to access the renderer instance.mojito-perf
).action-context
ormojito-client
likecacheTemplates
andpathToRoot
.