-
Notifications
You must be signed in to change notification settings - Fork 6
check interaction with render modifiers #203
Comments
Unfortunately because of the upstream assertion this is going to be difficult to use either way because My personal opinion is that this modifier should not invoke If
Is obviously more verbose, but fairly clear and readable and doable today with no changed. |
I agree, that message is very difficult to debug. On the other hand running all modifier in a new transaction (or with |
FWIW, using the runloop like this is a major codesmell and I highly recommend avoiding it unless absolutely necessary. This may point toward needing to write more modifiers directly, and the Basically, every time you do Custom modifiers are currently painful to write, since they are all global. I think template imports will help a lot with this. |
@pzuraq is it make sence to complete autotracking frame before modifiers run? |
or run |
oor, way to check is property tracked or not (@pzuraq) if tracked - run in next runloop, if not - just assign function ref(node, [ context, key ]) {
if (isTracked(context, key)) {
run.next(()=>context[key] = node);
} else {
context[key] = node;
}
} |
I don't think we will be exposing that functionality. Unidirectional dataflow is a good thing, not a bug to work around. Edit: Moreover, it doesn't scale to other forms of root state. What if tracking is happening through a |
// background - emberjs/ember.js#18698 (comment)
https://github.com/lifeart/ember-ref-modifier/blob/master/tests/dummy/app/components/glimmer-ref.js
since we setting property in next runloop, such code may fail
in other side, callback may solve issue
in other way, we can make
next runloop
sheduling optional, or remove it at all from modifier itself and give control to developers.other way - allow tracked chain computations rerun in same transaction if some of tracked properties is DOM node, but it seems low-level change.
The text was updated successfully, but these errors were encountered: