Open cleong-tc opened 6 years ago
Thanks, I'll see if I can recreate.
I created a glitch: https://glitch.com/edit/#!/sophisticated-turkey?path=server.js:13:0
What I see there seems to work:
Using your deps list. What's different?
@matthewp : in package.json
change "can-zone": "=0.6.13"
to "can-zone": "=0.6.12"
and you should see the additional terminal-console-message mobile-index.events.element.beforeremove
.
sorry, i am not familiar with glitch.com
. i need to figure out how to see the console-output.
Ah, I see. Interesting... ok, this gives me something to work with so I'll check it out.
@matthewp : beforeremove
-event seems to be firing in done-ssr@2, so i am fine with ignoring this issue.
Hm, so probably not a bug in can-zone but rather more likely in done-ssr. Trying to think if we had tests with beforeremove...
can-zone@0.6.13 added
Node.prototype.removeEventListener
toregister.js
which caused can-component/can-controlbeforeremove
-event to not fire. https://v3.canjs.com/doc/can-component/beforeremove.htmlit seems the
beforeremove
-event-handlers are being removed byNode.prototype.removeEventListener()
(incan-simple-dom/lib/simple-dom/event.js
) beforeNode.prototype.dispatchEvent()
can call thebeforeremove
-event-handlers.Node.prototype.removeEventListener()
is removing thebeforeremove
-event-handlers becauseif (handlersByType[index] === handler) {
evaluates to true for can-zone@0.6.13 (vs false for can-zone@0.6.12).in my donejs@1 sample app, with can-zone@0.6.12 the log-message for the
beforeremove
-event is displayed in the terminal-console, but with can-zone@0.6.13 the log-message is missing. we use thebeforeremove
-event to cleanup timers and element-event-bindings.src/index.stache
...src/mobile/index/index.js
...package.json
...can-view-import@3.2.1
to resolve a memory-leak-issue because of can-view-import-promise.