You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observe console below that outputs the jQuery event when listening for a base.log event type. The actual event type is base where we expected base.log:
When the event is fired, the debug statement in the console above shows the event type type: "base" which is incorrect.
My memory is a bit hazy on this, and I thought I asked@joelrbrandt about it, but I always thought that this notation would screw up somehow with jQuery's namespace notation. It never really manifested as a bug for a few reasons that I can tell:
Most of our node domains only ever register 1 type of event. So there wasn't an opportunity to mishandle anything yet.
2.@iwehrman introduced NodeDomain which may mask the problem by adding it's own namespace when listening to events from NodeConnection before re-dispatching them. e.g. NodeDomain listens for the change event fileWatcher.change.NodeDomainEvent then dispatches simply change. However, the event type that comes back from NodeConnection is still fileWatcher with a namespace of change.
I ran into an issue when working on a node extension that for some reason never completed loading. What I found was that NodeConnection itself listens for base.newDomains before resolving the promise for NodeConnection.loadDomains(). When stepping through the code, I saw the base.newDomains event fire, but it was never handled by the event listener.
The text was updated successfully, but these errors were encountered:
Issue by jasonsanjose
Thursday Feb 20, 2014 at 17:55 GMT
Originally opened as adobe/brackets#6933
base.log
event type. The actual event type isbase
where we expectedbase.log
:Explanation:
Following the event handling convention here: https://github.com/adobe/brackets/wiki/Brackets-Node-Process:-Overview-for-Developers#wiki-architecture, the demo extension adds an event listener for
log
in thebase
domain, e.g.$(connection).on("base.log", myEventHandler)
. See https://github.com/jasonsanjose/brackets-simple-node/blob/master/main.js#L65.When the event is fired, the debug statement in the console above shows the event type
type: "base"
which is incorrect.My memory is a bit hazy on this, and I thought I asked
@
joelrbrandt about it, but I always thought that this notation would screw up somehow with jQuery's namespace notation. It never really manifested as a bug for a few reasons that I can tell:2.
@
iwehrman introducedNodeDomain
which may mask the problem by adding it's own namespace when listening to events fromNodeConnection
before re-dispatching them. e.g.NodeDomain
listens for thechange
eventfileWatcher.change.NodeDomainEvent
then dispatches simplychange
. However, the event type that comes back fromNodeConnection
is stillfileWatcher
with a namespace ofchange
.The relevant jQuery source is here https://github.com/jquery/jquery/blob/master/src/event.js#L238.
I ran into an issue when working on a node extension that for some reason never completed loading. What I found was that
NodeConnection
itself listens forbase.newDomains
before resolving the promise forNodeConnection.loadDomains()
. When stepping through the code, I saw thebase.newDomains
event fire, but it was never handled by the event listener.The text was updated successfully, but these errors were encountered: