Ember upgrade: what's the plan for Mixins, specifically bufferedProperty?

I’m working on COMPATIBILITY: move thumbnail selector to Glimmer & new Component modal system by merefield · Pull Request #32 · paviliondev/discourse-tc-topic-list-previews · GitHub

I was using bufferedProperty on a Modal Controller, but I’ve now been forced to move to a Component to support the new Component modal architecture.

However, I believe still need to use bufferedProperty (I’m updating a value in the Topic Meta).

This however, raises an error:

export default class AwesomeModalComponent extends Component.extend(
  bufferedProperty("model")
) {

… and I get TypeError: n.default.extend is not a function

I have found some examples of this pattern, but only for Controllers:

Be good to know what the plan is here on the “TODO”

3 Likes

The easiest short-term answer is: continue using a Classic Component for your modal (i.e. not a glimmer component). Classic Components still support mixins.

Sticking to a classic component (i.e. the strategy described in Converting modals from legacy controllers to new DModal component API) will give you the cleanest 1:1 upgrade from the old controller-based system.

Longer-term, we will need to figure out alternatives to some of our core mixins. But we haven’t quite got there yet.

4 Likes

Just to follow up and say thanks. I used this exact approach and got everything working - I moved everything to Glimmer bar the modal itself which needed the Mixin.

btw, bufferedProperty seems to perform a lot of magic and doesn’t seem to follow any of the standard rules related to passing of changes!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.