-
-
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
Element Modifiers #811
Element Modifiers #811
Conversation
- If we merge [RFC #757 "Default Modifier Manager][rfc-0757], | ||
it may seem redundant with this RFC. | ||
- There is the potential for confusion between the `ember-modifier` package and | ||
the `@ember/modifier` package which ships as part of `ember-source`. |
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.
what if ember-modifier is re-exported from @ember/modifier
? adding Modifier
and modifier
to the exports from @ember/modifier
?
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.
@NullVoxPopuli this is meant by "Integrate ember-modifier
into the @ember/modifier
package directly." in "Alternatives".
I can expand that to be more specific
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.
yeah, like, I think there are some pretty good ergonomics to that alternative, and I'm curious what others think.
Calling that out is good, I totally forgot about the similar import paths 😅
(good RFC, @SergeAstapov !!! <3)
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.
@chriskrycho may know more about the potential downsides of this approach.
From my perspective, this would be logical to have imports like
import Modifier, { modifier } from '@ember/modifier';
as it would follow what we do with helpers, where we have imports like
import Helper, { helper } from '@ember/component/helper';
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.
tangent, but I think the /component/
part of the helper imports is weird 😅
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.
This is one of the questions I intend to talk through at the Framework core team meeting on Friday! One of the reasons is that there is open design question going forward: should this kind of thing be in @ember/*
or @glimmer/*
?
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.
oo, good point. probably makes more sense for @glimmer/*
, tbh -- even though ember feels like the place to be only because it feels more maintained. 🙈
Status: this was on the agenda for this week’s Framework Core Team meeting, but we had a couple of longer discussions about other open RFCs before we got to it. I expect we’ll be able to cover it next week. |
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.
I personally would love to see this come from @glimmer/modifier
, what do folks think?
|
||
## Alternatives | ||
|
||
- Introduce [RFC #757 "Default Modifier Manager][rfc-0757] |
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.
I think this is the direction we should go in. ember-modifier's function-based modifiers feel like a stop-gap solution for the default modifier manager and it would be better to simply focus on that RFC instead. It would also be consistent with the already merged "Default helper manager" RFC and is one less thing we would have to import.
I realize adding the modifier
function would be the modifier equivalent of the already existing helper
function, but I think that should be deprecated once the default helper manager is shipped 😄.
The scope of this RFC could then be reduced to only the class based modifier API of ember-modifier which ideally, as mentioned in the RFC and by others, would be exported from @glimmer/modifier
or @ember/modifier
.
Thanks for writing this RFC ❤️!
Some notes on last week’s Framework team meeting and one-off discussions—
(2) is related why we’re not just taking the path @Windvis suggested (though that is also a space we want to iterate on): we see a path to rationalizing modifiers, effects (of which modifiers are a special case), helpers, resources, etc. into a single unified design. Continuing to ship The key is that we have a minimal and incremental path forward by adopting
I'll review shortly with the recommended tweaks, and we’ll hopefully talk about it again at this week’s Framework meeting! |
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.
One comment about the suggestions I'm making here:
This is explicitly not setting a precedent for adding other Ember ecosystem addons to the default blueprint, and should not be taken to invite RFCs to that end. The Framework Core team discussed the need for this primitive and the best path forward and then asked @SergeAstapov to write this RFC.
Hmm, this seems somewhat strange to me (and I missed the core team meeting referenced). Can you explain why? Is your expectation that every app will create at least one modifier of it's own (that's not 100% obvious to me)? I think I'd vaguely prefer to add a blueprint for |
Without (necessarily) implying argument, how is that an improvement over just shipping the capability out of the box? Is the concern about adding bloat to the generated app build if it's included by default, or something else? Assuming we ship it as a v2 addon (pulling in the upcoming v4 version of the release, likely this week), which will in turn get resolved by way of |
Oh: the reason for adding
|
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.
Thanks for making these changes! Looks good to me. I have it on the agenda again for Friday's core team meeting!
A data point on the expected usage level:
This would not by itself be a signal to make it official, but it is a good data point for whether "most" apps will use it. |
I agree, I don't think it is fundamentally different (other than the current design doesn't really support Glimmer.js or GlimmerX users, for roughly no good reason).
We don't have these in the default blueprint though (because they are not real packages). After thinking about this a bit more, I think my main issue is that we aren't being prescriptive enough in this RFC. Some questions:
|
@rwjblue for the first question, currently RFC says:
we may edit it to make (of course if that path will be agreed upon):
As for the second question, |
Wouldn’t it make more sense (both from an ease-of-implementation POV and an ease-of-figuring-it-out-to-maintain-it POV) to just leave it as a blueprint supplied by |
I do like your suggested tweak (quoted just below), but I think this only really works if we also ensure that |
I definitely agree that the simplest implementation is to "just" provide
I will provide an alternate question / example: Also, to be clear, I think it would be 100% fine to actually do both:
|
Oh, also, FWIW I think what I'm saying in #811 (comment) really ought to apply to |
@rwjblue I think you have an intuition/some experience/a lot of knowledge here that isn't obvious to me reading the conversation! Why could we as a community not absorb changes there? I'm asking because, assuming Embroider v2 addon format versions of these packages, it seems to me that the only reason the complication would exist is if we don't just add them to the package and make blueprints do special things (otherwise we would just cut a major and people could upgrade piecemeal: it is only Classic builds' Highlander Rules which would break that?)… but I assume that's because I'm missing something that is obvious to you from having worked on this problem space. Can you expand on why this is true?
|
I have put this on the agenda for tomorrow's Framework team meeting! |
The current RFC prose states that We must address this with official guidance, and this RFC is the right place to start. The two simple options are: make it a dependency, make it a devDep/peerDep. Both of those have trade offs, I personally think peer dep is the right relationship here, but at the very least this RFC must say something about this. |
I agree that this must be addressed. But I'm not sure if this RFC is the right place to do so. It seems to not only affect newly added |
@jelhan it may indeed need its own RFC, but we need to figure that out before introducing this unless we want to possibly cause a high degree of churn across the ecosystem. Note that it is specifically the act of introducing it to the default blueprint, with the need for guidance around what to do, which risks that churn: until we do that, it's in the same boat as any other addon in the ecosystem (and there are no planned API changes for when we bring it in, as it stands!). |
We discussed this at Framework today and decided to put it into Final Comment Period, with intent to merge it! Thanks, @SergeAstapov! |
What is the status on this? Label for final comment period has not been added. And it has not been merged. |
Whoops! We've been talking about a bunch of things and just forgot to circle back to this. I'll do an async check on Monday and it should get merged then! |
Folks have been busy, but I have merging this at the top of the agenda for this week's Framework team meeting; it should get merged then! |
When we merge, we'll have to manually trigger the advancement PR since this one affects two RFC files. |
We expect that we will add additional timing capabilities as part of addressing #652. I hope publishing such a RFC in the next week. The new low-level primitives providing more granular control of modifier timing would need to be exposed in high-level APIs provided by |
Advance RFC #811 "Element Modifiers" to Stage Ready for Release
Advance RFC #811 `"Element Modifiers"` to Stage Released
At emberjs/rfcs#934 we're tracking an effort to implement the RFC emberjs/rfcs#811. In that RFC (at https://github.com/emberjs/rfcs/blob/master/text/0811-element-modifiers.md#how-we-teach-this) there are two things which are suggested for documentation in the guides: * Update references that mention `ember-modifier` must be installed, since it ships in the default blueprint (confirmed at https://github.com/ember-cli/ember-new-output/blob/master/package.json#L50) * Introduce the class-based modifier API. In this PR I've linked to the upstream documentation at https://github.com/ember-modifier/ember-modifier#usage to execute on that suggestion. I don't believe we need to laborously explain the class-based APIs to guides readers, it just distracts from some otherwise straight-forward use cases and examples.
At emberjs/rfcs#934 we're tracking an effort to implement the RFC emberjs/rfcs#811. In that RFC (at https://github.com/emberjs/rfcs/blob/master/text/0811-element-modifiers.md#how-we-teach-this) there are two things which are suggested for documentation in the guides: * Update references that mention `ember-modifier` must be installed, since it ships in the default blueprint (confirmed at https://github.com/ember-cli/ember-new-output/blob/master/package.json#L50) * Introduce the class-based modifier API. In this PR I've linked to the upstream documentation at https://github.com/ember-modifier/ember-modifier#usage to execute on that suggestion. I don't believe we need to laborously explain the class-based APIs to guides readers, it just distracts from some otherwise straight-forward use cases and examples.
Advance RFC #811 `"Element Modifiers"` to Stage Recommended
Rendered
This RFC supersedes the original RFC #353 "Modifiers"