-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Reimplement inline link-to as an AST transform #12229
Conversation
4ec49a8
to
8083c97
Compare
Hmm, this strategy doesn't work with custom link-tos. Might just close this. |
I think that it is fine that the inline form is specifically for |
@mmun - This needs a rebase and some updates when you have a minute. |
This is only marginally different from the current state with extending the I'm in favor of implementing this as an AST transform even with the knowledge that it does make it a bit more magical. (I don't imagine that most people using Ember expect that the code they write is going to be modified like this before it runs which may confuse somebody's debugging session.) @mmun you want to bring this home, or for me to adopt it? |
@nathanhammond Sure, feel free to adopt! :) |
I've given you access to my fork of ember.js if you'd prefer to rebase this branch. |
Just a side-thought, we may need to make the AST, or atleast the transforms/reducers be part of the public API at some point. I have seen a trend, of really cool things being implemented as AST transforms, but it does worry might slightly due to the potential instability. I am not saying, we need to drop everything at finalize this, but we explore what it would take. |
df45585
to
9c300d9
Compare
Ready for review and possible landing. :) |
9c300d9
to
b664d42
Compare
b664d42
to
9eed8e3
Compare
Rebased again. Gonna land when 🍏.... |
…js#13432 This PR partially reverts emberjs#12229 given that it made the inline form of components extending from `LinkTo` impossible. Beware that matching the exact behaviour is not there yet (as it wasn't before emberjs#12229) given that {{{link-to title route}}} would unescape title while {{{my-link-to title route}}} would not. This behaviour was not working before and therefore is not working after this revert. This PR does not address whether the inline form for link-to should be deprecated or not.
This PR partially reverts #12229 given that it made the inline form of components extending from `LinkTo` impossible. Beware that matching the exact behaviour is not there yet (as it wasn't before #12229) given that {{{link-to title route}}} would unescape title while {{{my-link-to title route}}} would not. This behaviour was not working before and therefore is not working after this revert. This PR does not address whether the inline form for link-to should be deprecated or not. (cherry picked from commit 04390f1)
…js#13432 This PR partially reverts emberjs#12229 given that it made the inline form of components extending from `LinkTo` impossible. Beware that matching the exact behaviour is not there yet (as it wasn't before emberjs#12229) given that {{{link-to title route}}} would unescape title while {{{my-link-to title route}}} would not. This behaviour was not working before and therefore is not working after this revert. This PR does not address whether the inline form for link-to should be deprecated or not.
I also had to fix broken tests that didn't pass enough arguments to link-to because they were triggering an assertion that
params.length > 0
.