3 ms·
Why isn't it better to redefine insertBefore of an already inserted element to being state-preserving? If I want to kill state, I can do a remove first.
by tommiegannert 2y ago
Why isn't it better to redefine insertBefore of an already inserted element to being state-preserving? If I want to kill state, I can do a remove first.
- Klaster_1 2y agoThis would break the WEB. JS DOM bindings are a backwards-compatible public API.
- tommiegannert 2y agoI reject that claim as-is. In what situations would it break? Standards evolve. Changes to cookies, iframes, newly required HTTP headers all "broke" the web. Not to mention Flash deprecation. But somehow we survived. Sure, this would theoretically be a backwards incompatible change. But if no one is using insertBefore without really meaning moveBefore, it's not a concern in practice.
- nitwit005 2y agoYou're both denying it would break, and saying it's okay for it to break, which are contradictory arguments.
- tommiegannert 2y agoPutting it your way, I'm saying it might break short-term, but long-term it would be fine.