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
@jonschlinkert and I have talked about this and I've been looking through the current modules that have touch points to async helpers and trying some things out to try to improve the experience with some of the use cases that we've come across.
I think that the following steps can be taken to refactor and externalize some of the current pieces, while creating a couple new pieces for so cases:
the only real touch points in engine-cache are adding helpers to the asyncHelpers instance when compiling, and resolving async helper ids after the string has been rendered
moving this out of engine-cache makes way for the next step
base-async-helpers module that adds the async-helpers functionality to base applications
move asyncHelper, asyncHelpers, getAsyncHelper, and hasAsyncHelper methods from base-helpers to `base-async-helpers
wrap engine-cache methods to inject the async-helpers functionality into .compile and .render (this can be more configurable and only enabled for specific engines)
Make built-in singular and plural helpers "smarter" to know if they're being used as async or sync helpers. Either split them out into a module or just check for the callback.
base-handlebars-async-helpers module to add necessary helpers and batch methods in Handlebars to allow using async-helpers with built in Handlebars partial syntax.
I've done this in an example and tried to implement it directly in engine-handlebars, but engine-handlebars is not able to get a reference to the asyncHelpers instance created by engine-cache.
I think splitting out the other pieces and adding this functionality as a plugin will let users choose when they're going to use async-helpers and if they'r using Handlebars, they can also include this module to fix some specific use cases.
Since we include engine-handlebars in assemble by default, we can include this also (or have an option to enable async-helpers which would then include base-async-helpers and base-handlebars-async-helpers)
optionalbase-engine-async-helpers module that will do something with engine-base to get async-helpers to work with regular javascript conditional statements (I don't know exactly how to do this yet, but we've thrown around a few ideas)
I'll be working on these changes over the next few days. Feedback is welcome and encouraged!
The text was updated successfully, but these errors were encountered:
@jonschlinkert and I have talked about this and I've been looking through the current modules that have touch points to async helpers and trying some things out to try to improve the experience with some of the use cases that we've come across.
I think that the following steps can be taken to refactor and externalize some of the current pieces, while creating a couple new pieces for so cases:
refactor async-helpers
remove async-helpers from engine-cache
asyncHelpers
instance when compiling, and resolving async helper ids after the string has been renderedbase-async-helpers
module that adds the async-helpers functionality tobase
applicationsasyncHelper
,asyncHelpers
,getAsyncHelper
, andhasAsyncHelper
methods frombase-helpers
to `base-async-helpersengine-cache
methods to inject theasync-helpers
functionality into.compile
and.render
(this can be more configurable and only enabled for specific engines)Make built-in
singular
andplural
helpers "smarter" to know if they're being used as async or sync helpers. Either split them out into a module or just check for the callback.base-handlebars-async-helpers
module to add necessary helpers and batch methods in Handlebars to allow using async-helpers with built in Handlebars partial syntax.engine-handlebars
, butengine-handlebars
is not able to get a reference to theasyncHelpers
instance created byengine-cache
.engine-handlebars
inassemble
by default, we can include this also (or have an option to enable async-helpers which would then includebase-async-helpers
andbase-handlebars-async-helpers
)optional
base-engine-async-helpers
module that will do something withengine-base
to get async-helpers to work with regular javascript conditional statements (I don't know exactly how to do this yet, but we've thrown around a few ideas)I'll be working on these changes over the next few days. Feedback is welcome and encouraged!
The text was updated successfully, but these errors were encountered: