-
Notifications
You must be signed in to change notification settings - Fork 191
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
Fix nested calls to helpers in dynamic helpers #1293
Merged
Merged
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
Currently, nested calls to helpers in dynamic helpers cause problems because the nested helper overwrites the register that we were using to pass along the helper definition. This is actually a worse way of doing something that the `Dup` opcode is designed to do anyways, so I updated to do that, following the same pattern in DynamicModifiers. Added tests for both dynamic helpers and modifiers with nested helpers.
NullVoxPopuli
approved these changes
Apr 1, 2021
rwjblue
approved these changes
Apr 1, 2021
chancancode
added a commit
to emberjs/ember.js
that referenced
this pull request
Apr 20, 2021
Per [RFC 496](https://github.com/emberjs/rfcs/blob/master/text/0496-handlebars-strict-mode.md#3-no-implicit-invocation-of-argument-less-helpers), this commit deprecates the implicit invocation of argument-less helpers and requires explicit parenthesis if: 1. Non-strict mode, AND 2. `helper` is a free variable (not `this.helper`, `@helper` or a local variable), AND 3. No arguments are provided to the helper, AND 4. It's in a component invocation's named argument position (not `<div id={{helper}}>` or `<Foo bar={{helper}}>`), AND 5. Not parenthesized (not `@foo={{(helper)}}`), AND 6. Not interpolated (not `@foo="{{helper}}"`). The cases in real apps where all of the above are true should be quite rare, as most helpers take at least one argument. This is probably not the most efficient/minimal changes to the compiler infrastructure, but I chose to optimize for making the change easier to remove/rollback (i.e. adding new nodes instead of changing existing ones) as we won't be needing this for very long. This also bumps `@glimmer/*` to latest which also brings in the bugfix commit glimmerjs/glimmer-vm#1293.
chancancode
added a commit
to emberjs/ember.js
that referenced
this pull request
Apr 21, 2021
Per [RFC 496](https://github.com/emberjs/rfcs/blob/master/text/0496-handlebars-strict-mode.md#3-no-implicit-invocation-of-argument-less-helpers), this commit deprecates the implicit invocation of argument-less helpers and requires explicit parenthesis if: 1. Non-strict mode, AND 2. `helper` is a free variable (not `this.helper`, `@helper` or a local variable), AND 3. No arguments are provided to the helper, AND 4. It's in a component invocation's named argument position (not `<div id={{helper}}>` or `<Foo bar={{helper}}>`), AND 5. Not parenthesized (not `@foo={{(helper)}}`), AND 6. Not interpolated (not `@foo="{{helper}}"`). The cases in real apps where all of the above are true should be quite rare, as most helpers take at least one argument. This is probably not the most efficient/minimal changes to the compiler infrastructure, but I chose to optimize for making the change easier to remove/rollback (i.e. adding new nodes instead of changing existing ones) as we won't be needing this for very long. This also bumps `@glimmer/*` to latest which also brings in the bugfix commit glimmerjs/glimmer-vm#1293.
chancancode
added a commit
to emberjs/ember.js
that referenced
this pull request
Apr 21, 2021
Per [RFC 496](https://github.com/emberjs/rfcs/blob/master/text/0496-handlebars-strict-mode.md#3-no-implicit-invocation-of-argument-less-helpers), this commit deprecates the implicit invocation of argument-less helpers and requires explicit parenthesis if: 1. Non-strict mode, AND 2. `helper` is a free variable (not `this.helper`, `@helper` or a local variable), AND 3. No arguments are provided to the helper, AND 4. It's in a component invocation's named argument position (not `<div id={{helper}}>` or `<Foo bar={{helper}}>`), AND 5. Not parenthesized (not `@foo={{(helper)}}`), AND 6. Not interpolated (not `@foo="{{helper}}"`). The cases in real apps where all of the above are true should be quite rare, as most helpers take at least one argument. This is probably not the most efficient/minimal changes to the compiler infrastructure, but I chose to optimize for making the change easier to remove/rollback (i.e. adding new nodes instead of changing existing ones) as we won't be needing this for very long. This also bumps `@glimmer/*` to latest which also brings in the bugfix commit glimmerjs/glimmer-vm#1293.
chancancode
added a commit
that referenced
this pull request
Apr 22, 2021
Before #1293, the `Load` operation would have popped the helper definition off of the evalution stack. After the #1293, nothing is popping it off anymore and that creates problem downstream. This balances things out by inserting a `Pop(1)` in the original frame. I couldn't think of a good way to test this, and this is blocking Ember beta, so we will merge this now (Ember has a test confirming this works) and @pzuraq will add a test later.
chancancode
added a commit
that referenced
this pull request
Apr 22, 2021
Fix evaluation stack off-by-one error introduced in #1293
chancancode
added a commit
to emberjs/ember.js
that referenced
this pull request
Apr 22, 2021
Per [RFC 496](https://github.com/emberjs/rfcs/blob/master/text/0496-handlebars-strict-mode.md#3-no-implicit-invocation-of-argument-less-helpers), this commit deprecates the implicit invocation of argument-less helpers and requires explicit parenthesis if: 1. Non-strict mode, AND 2. `helper` is a free variable (not `this.helper`, `@helper` or a local variable), AND 3. No arguments are provided to the helper, AND 4. It's in a component invocation's named argument position (not `<div id={{helper}}>` or `<Foo bar={{helper}}>`), AND 5. Not parenthesized (not `@foo={{(helper)}}`), AND 6. Not interpolated (not `@foo="{{helper}}"`). The cases in real apps where all of the above are true should be quite rare, as most helpers take at least one argument. This is probably not the most efficient/minimal changes to the compiler infrastructure, but I chose to optimize for making the change easier to remove/rollback (i.e. adding new nodes instead of changing existing ones) as we won't be needing this for very long. This also bumps `@glimmer/*` to latest which also brings in the bugfix commit glimmerjs/glimmer-vm#1293.
chancancode
added a commit
to emberjs/ember.js
that referenced
this pull request
Apr 22, 2021
Per [RFC 496](https://github.com/emberjs/rfcs/blob/master/text/0496-handlebars-strict-mode.md#3-no-implicit-invocation-of-argument-less-helpers), this commit deprecates the implicit invocation of argument-less helpers and requires explicit parenthesis if: 1. Non-strict mode, AND 2. `helper` is a free variable (not `this.helper`, `@helper` or a local variable), AND 3. No arguments are provided to the helper, AND 4. It's in a component invocation's named argument position (not `<div id={{helper}}>` or `<Foo bar={{helper}}>`), AND 5. Not parenthesized (not `@foo={{(helper)}}`), AND 6. Not interpolated (not `@foo="{{helper}}"`). The cases in real apps where all of the above are true should be quite rare, as most helpers take at least one argument. This is probably not the most efficient/minimal changes to the compiler infrastructure, but I chose to optimize for making the change easier to remove/rollback (i.e. adding new nodes instead of changing existing ones) as we won't be needing this for very long. This also bumps `@glimmer/*` to latest which also brings in the bugfix commit glimmerjs/glimmer-vm#1293. (cherry picked from commit 62e2816)
This was referenced May 21, 2021
Merged
Closed
This was referenced Jun 6, 2021
This was referenced Jun 14, 2021
This was referenced Jul 12, 2021
This was referenced Jul 19, 2021
This was referenced Aug 2, 2021
1 task
1 task
1 task
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.
Currently, nested calls to helpers in dynamic helpers cause problems
because the nested helper overwrites the register that we were using to
pass along the helper definition. This is actually a worse way of doing
something that the
Dup
opcode is designed to do anyways, so I updatedto do that, following the same pattern in DynamicModifiers. Added tests
for both dynamic helpers and modifiers with nested helpers.
Original issue: tracked-tools/ember-could-get-used-to-this#41