-
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
Rewrite inline let to have lexical scope #12
Conversation
@mmun thank you! Ember 1.13 test is failing. In the current test suite, we're not testing inline let in 1.13. Should we exclude the AST transform from for Ember 1.13 or is it possible to make it work with 1.13? |
Should be possible. :) EDIT: Actually, it would be a pain to get it working in 1.13 so I disable the transform below 2.0.0. |
d3ffd30
to
f54ac23
Compare
f54ac23
to
35a3a97
Compare
I've changed the example in the PR message to demonstrate that bindings are created in parallel rather than series (E.g. the semantics are like LISP's |
This is pretty awesome 🎉 |
@@ -17,22 +13,6 @@ export default { | |||
options.template.yield(params); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For < 2.0 users, shouldn't there be an else
with a warning that inline usage is not allowed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do that.
is this glimmer 2 compatible? |
An excellent question, is there a way that we can test it? |
emberjs/ember.js#14156 looks like we can build vs canary? |
So looks like it's going to require some work to get it working on Glimmer. We can track it with #14, but I don't think it should hold this up getting merged. |
Absolutely, thanks guys so much for helping us make this work. |
@cowboyd I have a follow up PR soon that adds the warning. |
EDIT: The syntax of {{let}} and {{#let}} has changed since this PR.
This PR reimplements inline let as an HTMLBars AST transform. There is no notion of inline let at runtime. It works by rewriting the let statements as nested blocks. For example,
is transformed to (excluding whitespace changes to make it easier to read):
Both templates generate the DOM