Hi there! I've run into a few cases where I receive the following error while attempting to upgrade to using native classes that extend from Ability:
global failure: Error: You defined the class ExampleAbility that extends from Ember.Object using native class syntax, but you didn't mark it with the @classic decorator. All user classes that extend from this class must be marked as @classic, since they use classic features. If you want to remove the @classic decorator, you must remove the base class. For components, you can do this by converting to Glimmer components. For plain classes that extend from EmberObject, you can convert them into plain native classes that do not extend from EmberObject. If this class is a base class provided by the framework that you should be allowed to remove @classic from, please open an issue on the classic decorators repo: https://github.com/emberjs/ember-classic-decorator
One scenario I've been able to track down that has seemed to cause this is:
- Having a native class
A that extends from Ability
- Having a component
B that uses a can helper for A in its handlebars
- Having a component
C that wraps component B (think of something like C being a dropdown and B being an item for example)
- Having a tracked property within component
C
Removing the @tracked annotation from the property from component C in that scenario will allow for extending from Ability with no issues. I can work on trying to get a minimal reproducer if that is helpful here.
I've noticed that #151 removes the dependency on EmberObject from Ability which I imagine should resolve this issue without requiring the @classic decorator. Is this pull request still being actively worked on? Would be great to be able to use native class syntax without requiring the decorator.
Thanks in advance for the help. Let me know if I can provide any further information!
Hi there! I've run into a few cases where I receive the following error while attempting to upgrade to using native classes that extend from
Ability:One scenario I've been able to track down that has seemed to cause this is:
Athat extends fromAbilityBthat uses acanhelper forAin its handlebarsCthat wraps componentB(think of something likeCbeing a dropdown andBbeing an item for example)CRemoving the
@trackedannotation from the property from componentCin that scenario will allow for extending fromAbilitywith no issues. I can work on trying to get a minimal reproducer if that is helpful here.I've noticed that #151 removes the dependency on
EmberObjectfromAbilitywhich I imagine should resolve this issue without requiring the@classicdecorator. Is this pull request still being actively worked on? Would be great to be able to use native class syntax without requiring the decorator.Thanks in advance for the help. Let me know if I can provide any further information!