-
-
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
[WIP] [BUGFIX canary] Allow contextual components to be a glimmer component #12617
[WIP] [BUGFIX canary] Allow contextual components to be a glimmer component #12617
Conversation
The path/checklist seems correct to me. |
Quick update: I haven't forgot about this. I'm doing some tests on Glimmer components before going full speed into solving the issue. I have divide first task in two since I need to implement the other feature to test it. |
I have yet to do the |
f68909e
to
19817f7
Compare
@@ -83,7 +85,7 @@ ComponentNodeManager.create = function ComponentNodeManager_create(renderNode, e | |||
if (isAngleBracket) { | |||
assert(`You cannot invoke the '${tagName}' component with angle brackets, because it's a subclass of Component. Please upgrade to GlimmerComponent. Alternatively, you can invoke as '{{${tagName}}}'.`, component.isGlimmerComponent); | |||
} else { | |||
assert(`You cannot invoke the '${tagName}' component with curly braces, because it's a subclass of GlimmerComponent. Please invoke it as '<${tagName}>' instead.`, !component.isGlimmerComponent); | |||
assert(`You cannot invoke the '${tagName}' component with curly braces, because it's a subclass of GlimmerComponent. Please invoke it as '<${tagName}>' instead.`, !component.isGlimmerComponent || isClosureComponent || isComponentHelper); |
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.
Is isClosureComponent
threaded through here just for the assertion?
Perhaps we can just move the assertion further up the stack and avoid this. It kind of stinks to be passing these flags around.
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.
Yes. Currently looking if I can just change isAngleBracket
to mean behave like a GlimmerComponent
. Otherwise, this can be hard to maintain.
19817f7
to
f5bf7d0
Compare
Some update on this: I removed if (stream[MUTABLE_REFERENCE]) {
return stream;
} to: if (stream[MUTABLE_REFERENCE] && !internal) {
return stream;
} given that a mutable stream needs to be marked internal to be unboxed if needed. Some changes were introduced in the rendering process too. Some conditionals depend on the component being a GlimmerComponent, but others actually depend on it being called with angle brackets. Would it be possible to talk to someone in Slack to check a few things? Last, I'll spend some time adding more tests, specially from #12613 to see we support GlimmerComponents properly. After all is working, I'll clean the code. Sorry for the delay. Still working on this. |
@Serabe there has been some discussion about this lately, and it will need adjustment (sorry!). @wycats would like to hold off on invoking glimmer components with However, dot syntax invocation with <my-form model=model as |f|>
<f.button name='firstName' />
<f.submit>Save</f.submit>
</my-form> Of course this only applies to glimmer components. Happy to chat via Slack this week. |
☔ The latest upstream changes (presumably #12682) made this pull request unmergeable. Please resolve the merge conflicts. |
@homu, thank you. I'll be rebasing master soon, though I'll try to squash the commits so far (the conflict happens in |
9a9eab5
to
6c4b264
Compare
HTMLBars need to be able to generate components with syntax `my.comp` for implementing contexual components. emberjs/ember.js#12617
HTMLBars need to be able to generate components with syntax `my.comp` for implementing contexual components. emberjs/ember.js#12617
This PR needs tildeio/htmlbars#438 due to |
6c4b264
to
d80ac03
Compare
Yes. I'll upload a PR tomorrow morning for this. I'm not uploading this tonight cause npm is taking longer than usual and I cannot check the tests 😞 |
Thanks @Serabe!
|
Adding some tests and then I'll remove the autounboxing feature. With the new requirements it is not needed. |
a04b764
to
e9c46f5
Compare
☔ The latest upstream changes (presumably #12712) made this pull request unmergeable. Please resolve the merge conflicts. |
e9c46f5
to
9684049
Compare
Rebased! |
☔ The latest upstream changes (presumably #12746) made this pull request unmergeable. Please resolve the merge conflicts. |
Example: ```hbs <my-form model=model as |f|> <f.button name='firstName' /> <f.submit>Save</f.submit> </my-form> ```
9684049
to
a6e377b
Compare
☔ The latest upstream changes (presumably #13096) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm not sure of the path forward on this. We should likely let the dust settle on the glimmer integration efforts and attack again.... |
Thanks so much for working on this @Serabe, but since we did a full migration to ember-glimmer and removed support for angle bracket components I am going to close this PR. I am sure we will work together on this again when we get angle bracket components going again... |
Currently, contextual components does not work when the component being closured is a glimmer component. This PR aims to fix #12590
Addauto
flag tomut
s added by the compiler. (Needs some test)Make GlimmerComponents render as a contextual componentUnbox auto muts when rendering a component using the component helper if the component is a GlimmerComponentTest unboxing ofauto
mut
s<my.comp>
workauto
mut
s