pzuraq / macro-decorators

Decorators for getter/setter macros!
https://pzuraq.github.io/macro-decorators/
MIT License
62 stars 10 forks source link

Does not recompute in a Glimmer component #5

Closed lolmaus closed 4 years ago

lolmaus commented 4 years ago

Got this decorator:

function scaledProperty(propertyName) {
  return macro({
    get (target) {
      return target[propertyName] * target.args.scale / 1000;
    },
  });
}

It does not recompute when @scale passed into the component changes.

Same for the dynamic property — when its value changes, the macro does not recompute.

Is this my mistake?

pzuraq commented 4 years ago

Hey @lolmaus, thanks for reporting this. I've attempted to make a reproduction on Glitch: https://glitch.com/~pitch-lilac

It appears to be working, using the latest version of Ember and Glimmer components. Can you provide some more information about your setup? Are you using an older version of Ember/Glimmer components?

lolmaus commented 4 years ago

Thx for looking into this!

I probably do not fully understand all the implications of tracked priperties interop with classic approaches.