| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The root cause of #1218 is that `invokePartial` creates a stack of data frames
for nested partial blocks, but `resolvePartial` always uses the value at top of
the stack without "popping" it. The result is an infinite recursive loop, as
references to `@partial-block` in the partial at the top of the stack resolve to
itself.
So, walk up the stack of data frames when evaluating. This is accomplished by
1) setting the `partial-block` property to `noop` after use and
2) using `_parent['partial-block']` if `partial-block` is `noop`
Fix #1218
|
|
|
|
| |
Fixes #1135
|
|
|
| |
These were a bad idea to begin with and without the trackIds implementation they don’t make much sense.
|
|
|
|
| |
Closes #1145
|
|
|
| |
Fixes #1099
|
|
|
|
|
| |
If a decorator is used within a partial but not in the calling template, the hash is not passed in. For now error on the side of always including as just assigning values has minimal overhead.
Fixes #1089
|
| |
|
|
|
|
|
|
| |
Allows for partials to be defined within the current template to allow for localized code reuse as well as for conditional behavior within nested partials.
Fixes #1018
|
|
|
|
| |
These allow for a given block to be wrapped in helper methods or metadata and allow for more control over the current container and method before the code is run.
|
| |
|
|
|
|
|
|
| |
This allows for failover for missing partials as well as limited templating ability through the `{{> @partial-block }}` partial special case.
Partial fix for #1018
|
|
|
| |
There is no real need for us to do `.call(container` other than for backwards compatibility with legacy versions. Using the 4.x release as a chance to optimize this behavior.
|
| |
|
|
|
|
|
| |
Certain optimizations for simple templates could result in objects returned by helpers returned rather than their string representation, resulting in some odd edge cases. This ensures that strings are always returned from the API for consistency.
Fixes #1054.
|
|
|
|
|
|
|
| |
Creating a new depth value seems to confuse users as they don’t expect things like `if` to require multiple `..` to break out of. With the change, we avoid pushing a context to the depth list if it’s already on the top of the stack, effectively removing cases where `.` and `..` are the same object and multiple `..` references are required.
This is a breaking change and all templates that utilize `..` will have to check their usage and confirm that this does not break desired behavior. Helper authors now need to take care to return the same context value whenever it is conceptually the same and to avoid behaviors that may execute children under the current context in some situations and under different contexts under other situations.
Fixes #1028
|
|
|
| |
Fixes #914
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Converts the tool chain to use babel, eslint, and webpack vs. the previous proprietary solutions.
Additionally begins enforcing additional linting concerns as well as updates the code to reflect these rules.
Fixes #855
Fixes #993
|
|
|
|
|
|
|
|
|
| |
Uses the subexpression syntax to allow for dynamic partial lookups. Ex:
```
{{> (helper) }}
```
Fixes #933
|
|
|
|
|
|
|
|
| |
Causes templates to throw when lookup fields are not defined within the context. Strict mode will throw when any field is omitted. assumeObjects mode maintains the existing behavior of outputting an empty response when fields are not defined but allows for performance/size optimizations by not doing safety checks for intermediate objects in the lookup chain.
Strict mode effectively disables the helperMissing and inverse handling for blockHelperMissing as templates will throw rather than call those features for missing data fields.
Fixes #651
Fixes #805
|
|
|
| |
Fixes #907
|
|
|
| |
This helps unify the code handling and will also be needed to support string/id tracking on partials.
|
| |
|
|
|
| |
Fixes #901
|
| |
|
| |
|
| |
|
|
|
| |
Also fixes the template._child implementation which broke with the depthed work.
|
|
|
| |
Fixes #806
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Provides the mustache behavior of recursive lookup without the use of depthed paths.
Note that this does incur a fairly dramatic performance penalty for depthed queries.
|
| |
|
|
|
| |
Approximately doubles the throughput performance of depthed templates and clears the way for doing recursive path lookups in pathed mode.
|
| |
|
|
|
| |
This has a very positive impact on precompiled output size, particularly for known-helpers cases, and little or no impact on the throughput numbers.
|
| |
|
| |
|
| |
|
|
|
| |
This allows for metadata to be associated with the template and a simplification of the template init logic.
|
| |
|
| |
|
|
|
|
| |
setup options to use a hash helper.
|
| |
|
|
|
| |
Fixes #636
|
|
|
| |
Fixes #656
|
|
|
|
|
| |
Allows for overrides by 3rd parties
Fixes #679
|
|
|
| |
Fixes #675
|
|
|
| |
Allows us to execute jshint in non-forced mode.
|
|
|
|
|
|
| |
Allows for monkey patching (under ES5 systems). This somewhat mirrors
the proposed behavior in https://github.com/square/es6-module-transpiler/issues/37
but applies the behavior via manual code changes rather than compiler
support.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
Gruntfile.js
Rakefile
dist/handlebars.js
dist/handlebars.runtime.js
lib/handlebars.js
lib/handlebars/base.js
lib/handlebars/runtime.js
lib/handlebars/utils.js
package.json
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The idea is that the environment wraps up the mutable stuff in
Handlebars (like the helpers) and that you could theoretically create a
new one at any time and pass it in to Handlebars.template.
Every test makes a new environment and uses it in template compilation.
|
| |
| |
| |
| |
| | |
At this point, I have only 2 fails in the Node build, but I'm doing a
bunch of manual stuff locally and still have a bunch of hacks.
|
|/ |
|
| |
|
|
|
|
|
|
| |
Include program id and depth on the generated wrapper objects. This
allows helpers who are passed these objects to differentiate between
helpers for cases where they may want to cache the generated DOM
structure.
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
This check reduces duplicated code as well as also failing if the
template was precompiled on a version before the check was added.
|
|\ \
| |/ |
|
| |
| |
| |
| | |
data: true if necessary.
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
| |
* For example, mozilla returns [xpconnect native prototype wrapper] vs [object Function]
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
faster. Use Handlebars.VM.compile instead of Handlebars.compile to use the optimized version.
Major TODOS:
* clean up a bunch of code duplication in the compiler
* reorganize the compiler
* add support for debug symbols which would make it possible
to provide information about what part of the source caused
a runtime error.
|
| |
|
|
|
|
| |
modules that work in both CommonJS and the browser?
|
|
|
|
| |
things like link_to in a Rails context)
|
|
|
|
| |
the helpers or partials later
|
| |
|
| |
|
|
|
|
|
|
| |
* foo"bar" is an invalid param
* {{foo}}bar{{/baz}} is invalid
* fix a number of issues with inverse sections
* add partials
|
|
|
|
|
|
|
| |
* add helperMissing.not to the specs
* add Handlebars.Utils.isEmpty
* add runtime handling for inverse sections
* fix __get__ to pass an IdNode to evaluate
* handle case in wrapProgram where context is undefined
|
|
|
|
|
|
|
|
|
|
|
|
| |
* {{}} escape their contents, {{{}}} and {{& }} do not
* Add support in the parser, tokenizer and AST for partials
with context (support is still not there in the runtime)
* Fix some inconsistencies with the old behavior involving
the correct printing of null and undefined
* Add Handlebars.Exception
* Fixed an issue involving ./foo and this/foo
* Fleshed out helperMissing in the specs (this will be
moved out into handlebars proper once registerHelper
and registerPartial are added)
|
|
|
|
| |
from the original suite to go
|
| |
|
|
|