-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partials loading through RequireJS #16
Open
Aintaer
wants to merge
11
commits into
millermedeiros:master
Choose a base branch
from
behance:partials
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Any partials that have the delimiter character will be considered a requirement for the module and pulled in through require()
Partial names can now be module path names - Absolute paths: /path/to/module - Relative to current module: ../to/future - Prefixed names when given a prefixPath config - path/to/module -> prefixPath/path/to/module
To conserve on the bytes :)
It is important to use the plugin-local version of require so as not to be subject to contexts of the global.
The build path was previously broken as any require() calls will invariably return undefined during build. This and a shadowed name caused the build map to be empty. This now builds correctly.
Closed
The delimiter should prevent the partial name from being registered as something to resolve.
Instead of return a custom render function, use a custom template.ri function. This allows partials to have their own requirements bound to them.
+1 |
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.
Allows autoloading of partials by recursively using RequireJS
{{> /path/to/partial}}
{{> ./siblingPartial}}
pathPrefix
for default partial path lookups, e.g.pathPrefix: 'templates'
{{> lib/sharedPartial}}
=>templates/lib/sharedPartial.mustache