When writing Babel plugins, what can I assume about the same node being processed more than once? When or how can this happen? What are common protections if I don't want my annotations to appear twice? Should I always check if I've "seen" this node already?
-
-
Does path object have a shared lifetime with its node? Is path a bad key?
-
Paths are associated with a parent and a key, the node object is fairly irrelevant. You should usually get the same Path instance for a given position, similar to React I think!
- 1 more reply
New conversation -
-
-
@sebmck what scenario will get you to process the same node again? -
Another plugin replacing a parent will trigger a retraversal of the subtree, running your visitor again. There’s other scenarios. I’ll look into it and get some code pointers when I can.
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 