jelhan / ember-style-modifier

{{style}} element modifier for ember.js
MIT License
36 stars 12 forks source link

Support conditionally usage of modifier #239

Open jelhan opened 7 months ago

jelhan commented 7 months ago

The modifier does not have cleanup logic. In most cases that's okay. The element is destroyed anyways when modifier is removed. But it likely breaks when the modifier is applied conditionally.

Adding cleanup logic in a destructor may have negative impact on performance. See https://github.com/emberjs/rfcs/pull/1007#issuecomment-1953203678 on that topic. We should investigate the trade-off before shipping.

Conditionally applying this modifier does not seem to be a common case. At least no one reported a bug regarding missing cleanup. We should make sure to not harm everyone for a theoretical bug affecting no actual use case.