Add rendrApp to the Handlebars object - #1
Open
azriel46d wants to merge 143 commits into
Open
Conversation
Because when it's in peerDependencies, it can't require the module for use by the 'view' Handlebars helper.
Previously, this module was hardcoded to look for pre-compiled Handlebars templates in `rendr.entryPath + '/app/templates/compiledTemplates'`. Now, that's the default, but apps that use this module can manipulate the `exports.templatePatterns` array to specify the template path patterns that match a given source file. This is useful for when a Rendr app supports different sets of templates for different pages; for example, an app could have a set of desktop templates and a set of mobile templates.
0.0.6: Add support for multiple template source files.
Owner
|
Good idea @azriel46d . https://github.com/airbnb/rendr-handlebars is the actively maintained fork. I'll update the README. Still wanna see this merged here? |
Author
|
@hurrymaplelad just realised that i wasnt on the right fork :). As you wish, i'll add it to the other one |
Collaborator
|
👍 let's discuss on airbnb/rendr-handlebars. Thanks for the pull! |
Before, `{{partial}}` was incorrectly looking for the `_app` property;
it could find it in the helper context (`this._app`), but not in the
helper options (`options.data._app`), which are utilized by block
helpers like `{{#each}}` for passing through the app context.
This adds a `getProperty(key, context, options)` method which DRYs up
that logic.
Also cleans up the context logic in `{{partial}}`.
Fix use of {{partial}} inside block helper like {{each}}
move rendr dependency to peerDependencies
removed entryPath from layoutfinder and getTemplate ensure app is always passed in view Added tests for multi-template-safe adapter requiring
the change to local entryPath requires the newer version of rendr
Remove global entry path
upgrade dependencies and fix tests that broke when upgrading chai
add version 1.0.0
added documentation for passing a model to a subview within a forEach loop
I'm making a big assumption that everyone is using precompiled templates with this module.
Allow an instance of templateFinder to be passed in
Only ship the handlebars runtime to the client
remove handlebars as a dependency, let the app the inject it
…his is a breaking (major) change.
Rendr version needs to be greater than 1.1.0, not 1.2.0
check if collection is a collection object before checking whether it is empty
fix nested partial view client render issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adding the rendrApp instance so that the instance is always available to the helpers