-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Default managers #754
Default managers #754
Conversation
2415895
to
0d53e25
Compare
Framework core team discussed this today (with a smaller than usual group, so not everybody was able to give feedback yet). One piece of feedback was that it would be concerning if these default behaviors were pluggable (because the difference would be quite invisible and hard to google/discover). Reading the RFC more carefully, I think that is not your intention though. You're proposing that these three managers should be the baked-in defaults in Ember, correct? This RFC may preclude adding plain function components in the future, because there are ambiguous positions like: {{this.foo 1 2 3}} Which can be either a component or a helper. If people start invoking plain functions as helpers using this syntax, then we cannot later do: To resolve potential problems, I think it would be helpful to build a matrix of template positions vs javascript types and explain what happens in each case. Something like:
(although I don't think this is complete, I'm just illustrating the idea) It's ideal if any combinations we don't want to support yet are errors, as opposed to silently doing something odd. The RFC should probably consider whether this change will cause confusing error messages when people make typos. For example, if you meant to say: <Whatever @onClose={{this.handler}} /> And then you try to curry an argument incorrectly: <Whatever @onClose={{this.handler 1}} /> Today you would get an error about |
Thanks @ef4 (and team!) I think I've addressed all your comments, including adding to the drawbacks sections wherein someone would want to define a function component and invoke it via curlies. This proposal eliminates that possibility, leaving only AngleBracketInvocation for function-components... which... is fine? 🙃 |
…ation (and add Unresolved question)
bracket syntax. However, using functions as components would still be possible with angle bracket | ||
invocation. | ||
|
||
The difference between `<Component @handler={{this.handler}} />` and `<Component @handler={{this.handler 1}} />` |
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.
In strict mode, this is a non-issue because ambiguous invocations must be invoked via {{ (this.handler) }}
.
But, idk when strict mode is going to be default, or if default managers should be a reward for setting strict mode in your app (optional-feature?) idk
We discussed this at todays core team meeting and had a bit more feedback:
Thanks again for pushing forward on this @NullVoxPopuli! |
Closing this RFC, in favor of separate RFCs (linked from the PR description) |
Rendered
Superseded by: