Open core-ai-bot opened 3 years ago
Comment by dangoor Thursday Mar 21, 2013 at 00:46 GMT
I think we should also accommodate extensions with whatever we do here, because they need to do the same things.
I have also wondered if a separate web socket is even required for each of these, or if the messages should just be sent along a single web socket. I can imagine that someone could end up with quite a collection of sockets open between the processes, especially once extensions are in the mix.
Comment by peterflynn Tuesday Apr 02, 2013 at 22:09 GMT
It looks like the StaticServer code changed recently (476bf996?) so that it no longer waits for _nodeConnectionDeferred.done() on each remote call, which simplifies things a bunch... but could be somewhat flaky in edge cases where the user invokes it very quickly after app startup.
Comment by peterflynn Friday Sep 13, 2013 at 14:45 GMT
This should probably be folded into our new user story: https://trello.com/c/VNcrH1YB/994-easily-expose-node-side-apis-to-brackets-side
Issue by peterflynn Wednesday Mar 20, 2013 at 21:41 GMT Originally opened as https://github.com/adobe/brackets/issues/3188
We now have two modules that use NodeConnection: StaticServer/main.js and Package.js. Both have a lot of duplicated boilerplate code for setting up the connection, and there's lots of duplicated boilerplate per remote call too.
Boilerplate per module:
Boilerplate per call into a Node-side API:
This is very error prone -- easy to forget an error case, for example -- and makes the code harder to follow.
It also seems bad that the standard pattern is to initialize every Node connection we'll ever conceivably need right at app startup. Ideally we could set this up so they were automatically created lazily when first needed.