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
I wanted to examine partials and layouts to determine whether they are both truly needed. The rough current semantic explanation is that partials are, well, just partials, while layouts are partials but also more layout-like and intended for use with handlebars-layouts. It's also a holdover from fabricator, and I didn't really think deeply about it.
Currently: In the prepare phase, anything matched by the partials glob is registered as a partial on the handlebars instance. Additionally, anything matching the layouts glob is also registered as a partial. Thus, they are treated the same here.
In the parse phase, however, layouts are additionally added to a layouts property on the global drizzleData object—this becomes necessary for accessing them later in the render phase for handlebars-layouts reasons. I can expand on why that is necessary if y'all are curious but will leave it out here for brevity.
All that aside, I'm wondering if having separate partials really does anything for us. In a "combined" model, all of the things would get registered as partials and all of the things would be available on the global data object. I'm not sure what to call these things if we combine them, maybe templates?
Anyway, can you think of any reason that we should keep partials separate from layouts?
Right now, the builder has a number of
src
objects that defines where and how it builds parsed data. The defaultsrc
options are:I wanted to examine
partials
andlayouts
to determine whether they are both truly needed. The rough current semantic explanation is thatpartials
are, well, just partials, whilelayouts
are partials but also more layout-like and intended for use withhandlebars-layouts
. It's also a holdover fromfabricator
, and I didn't really think deeply about it.Currently: In the
prepare
phase, anything matched by thepartials
glob is registered as a partial on thehandlebars
instance. Additionally, anything matching thelayouts
glob is also registered as a partial. Thus, they are treated the same here.In the
parse
phase, however,layouts
are additionally added to alayouts
property on the globaldrizzleData
object—this becomes necessary for accessing them later in therender
phase forhandlebars-layouts
reasons. I can expand on why that is necessary if y'all are curious but will leave it out here for brevity.All that aside, I'm wondering if having separate
partials
really does anything for us. In a "combined" model, all of the things would get registered as partials and all of the things would be available on the global data object. I'm not sure what to call these things if we combine them, maybetemplates
?Anyway, can you think of any reason that we should keep
partials
separate fromlayouts
?/cc @tylersticka @mrgerardorodriguez @saralohr
The text was updated successfully, but these errors were encountered: